mars.venus
Class ToolAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--mars.venus.ToolAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable

public class ToolAction
extends javax.swing.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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ToolAction(java.lang.Class toolClass, java.lang.String toolName)
          Simple constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Response when tool's item selected from menu.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolAction

public ToolAction(java.lang.Class toolClass,
                  java.lang.String toolName)
Simple constructor.

Parameters:
toolClass - Class object for the associated MarsTool subclass
toolName - Name of this tool, for the menu.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Response when tool's item selected from menu. Invokes tool's action() method.

Parameters:
e - the ActionEvent that triggered this call