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, enabled
Fields 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 newToolAction
for the specifiedMarsTool
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) Opens this action's corresponding tool by invoking itsMarsTool.action()
method.getTool()
Get theMarsTool
this 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 newToolAction
for the specifiedMarsTool
.- Parameters:
tool
- The tool this action will open when performed.
-
-
Method Details
-
getTool
Get theMarsTool
this 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.
-