skrueger.geotools
Class MapPaneToolBar.MapPaneToolBarAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by skrueger.geotools.MapPaneToolBar.MapPaneToolBarAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Enclosing class:
MapPaneToolBar

public static class MapPaneToolBar.MapPaneToolBarAction
extends AbstractAction

Extends the AbstractAction with maintaining an ID and the MapPaneToolBar the actions controls. Additionally this class automatically calls MapPaneToolBar.performToolButton(int, ActionEvent) or MapPaneToolBar.performActionButton(int, ActionEvent) depending on whether the action is added via MapPaneToolBar.addTool(MapPaneToolBarAction) or MapPaneToolBar.addAction(MapPaneToolBarAction).

Author:
Martin Schmitz (University of Bonn/Germany)
See Also:
Serialized Form

Field Summary
protected  int id
          The ID of the action
protected  MapPaneToolBar toolBar
          The tool bar, this action is made for.
 
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
MapPaneToolBar.MapPaneToolBarAction(int id, MapPaneToolBar toolBar)
          Creates a new action with a dummy description and no icon.
MapPaneToolBar.MapPaneToolBarAction(int id, MapPaneToolBar toolBar, String name)
          Creates a new action without an icon.
MapPaneToolBar.MapPaneToolBarAction(int id, MapPaneToolBar toolBar, String name, Icon icon)
          Creates a new action.
MapPaneToolBar.MapPaneToolBarAction(int id, MapPaneToolBar toolBar, String name, Icon icon, String toolTip)
          Creates a new action.
MapPaneToolBar.MapPaneToolBarAction(int id, MapPaneToolBar toolBar, XMapPaneTool tool)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          Calls MapPaneToolBar.performToolButton(int, ActionEvent) or MapPaneToolBar.performActionButton(int, ActionEvent) depending on whether the action is added to the toolbar via MapPaneToolBar.addTool(MapPaneToolBarAction) or MapPaneToolBar.addAction(MapPaneToolBarAction).
 int getID()
          Returns the (unique) id of this action.
 
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
 

Field Detail

id

protected int id
The ID of the action


toolBar

protected MapPaneToolBar toolBar
The tool bar, this action is made for.

Constructor Detail

MapPaneToolBar.MapPaneToolBarAction

public MapPaneToolBar.MapPaneToolBarAction(int id,
                                           MapPaneToolBar toolBar)
Creates a new action with a dummy description and no icon.

Parameters:
id - unique ID for the action
toolBar - toolbar this action is made for

MapPaneToolBar.MapPaneToolBarAction

public MapPaneToolBar.MapPaneToolBarAction(int id,
                                           MapPaneToolBar toolBar,
                                           String name)
Creates a new action without an icon.

Parameters:
id - unique ID for the action
toolBar - toolbar this action is made for
name - description used for buttons or menus

MapPaneToolBar.MapPaneToolBarAction

public MapPaneToolBar.MapPaneToolBarAction(int id,
                                           MapPaneToolBar toolBar,
                                           String name,
                                           Icon icon)
Creates a new action.

Parameters:
id - unique ID for the action
toolBar - toolbar this action is made for
name - description used for buttons or menus
icon - icon used for buttons or menus

MapPaneToolBar.MapPaneToolBarAction

public MapPaneToolBar.MapPaneToolBarAction(int id,
                                           MapPaneToolBar toolBar,
                                           String name,
                                           Icon icon,
                                           String toolTip)
Creates a new action.

Parameters:
id - unique ID for the action
toolBar - The MapPaneToolBar this action is made for
name - description used for buttons or menus
icon - icon used for buttons or menus
toolTip - Tooltip to use for the button or menu

MapPaneToolBar.MapPaneToolBarAction

public MapPaneToolBar.MapPaneToolBarAction(int id,
                                           MapPaneToolBar toolBar,
                                           XMapPaneTool tool)
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Calls MapPaneToolBar.performToolButton(int, ActionEvent) or MapPaneToolBar.performActionButton(int, ActionEvent) depending on whether the action is added to the toolbar via MapPaneToolBar.addTool(MapPaneToolBarAction) or MapPaneToolBar.addAction(MapPaneToolBarAction).


getID

public int getID()
Returns the (unique) id of this action.

Returns: