Package mars.venus.actions
Class ToolAction
java.lang.Object
javax.swing.AbstractAction
mars.venus.actions.ToolAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
Connects a MarsTool class (class that implements MarsTool interface) to
the Mars menu system by supplying the response to that tool's menu item
selection.
- Version:
- August 2005
- Author:
- Pete Sanderson
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionToolAction(MarsTool tool) Create a newToolActionfor the specifiedMarsTool. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Opens this action's corresponding tool by invoking itsMarsTool.action()method.getTool()Get theMarsToolthis action corresponds to.Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
ToolAction
Create a newToolActionfor the specifiedMarsTool.- Parameters:
tool- The tool this action will open when performed.
-
-
Method Details
-
getTool
Get theMarsToolthis action corresponds to.- Returns:
- The tool this action will open when performed.
-
actionPerformed
Opens this action's corresponding tool by invoking itsMarsTool.action()method.- Parameters:
event- The event that triggered this call.
-