mars.venus
Class ToolAction
java.lang.Object
javax.swing.AbstractAction
mars.venus.ToolAction
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action
public class ToolAction
- extends AbstractAction
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.
- Author:
- Pete Sanderson
- See Also:
- Serialized Form
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 |
ToolAction
public ToolAction(Class toolClass,
String toolName)
- Simple constructor.
- Parameters:
toolClass
- Class object for the associated MarsTool subclasstoolName
- Name of this tool, for the menu.
actionPerformed
public void actionPerformed(ActionEvent e)
- Response when tool's item selected from menu. Invokes tool's action() method.
- Parameters:
e
- the ActionEvent that triggered this call