Class ToolAction

java.lang.Object
javax.swing.AbstractAction
mars.venus.actions.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.
Version:
August 2005
Author:
Pete Sanderson
See Also:
  • Constructor Details

    • ToolAction

      public ToolAction(MarsTool tool)
      Create a new ToolAction for the specified MarsTool.
      Parameters:
      tool - The tool this action will open when performed.
  • Method Details

    • getTool

      public MarsTool getTool()
      Get the MarsTool this action corresponds to.
      Returns:
      The tool this action will open when performed.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Opens this action's corresponding tool by invoking its MarsTool.action() method.
      Parameters:
      event - The event that triggered this call.