net.clackrouter.actions
Class AbstractActionDefault

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.clackrouter.actions.AbstractActionDefault
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, TranslatorConstants
Direct Known Subclasses:
AbstractActionFile, AbstractActionList, AbstractActionToggle, ClackAddComponent, ClackRunConnectivityTest, ClackShowConsole, ClackSpawnShell, ClackStartEthereal, ClackStopEthereal, ClackToggleRouteTableView, EditCell, EditCopy, EditCut, EditDelete, EditPaste, EditRedo, EditUndo, FileClose, FileExit, FileNew, FilePrint, HelpAbout, HelpHomepage, HelpSubmitABug, ViewScaleZoomIn, ViewScaleZoomOut, WindowCascade, WindowMaximize, WindowMinimize

public abstract class AbstractActionDefault
extends javax.swing.AbstractAction
implements TranslatorConstants

An abstract JGraphpad action. The base class for all JGraphpad actions.

See Also:
Serialized Form

Field Summary
protected  ClackFramework graphpad
          A reference back to the graphpad.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface net.clackrouter.jgraph.pad.resources.TranslatorConstants
PREFIX_COMPONENT, PREFIX_MESSAGE_ERROR, PREFIX_MESSAGE_INFORMATION, PREFIX_MESSAGE_WARING, SUFFIX_ACCELERATOR, SUFFIX_ACTION, SUFFIX_ICON, SUFFIX_IMAGE, SUFFIX_LABEL, SUFFIX_MENU, SUFFIX_MNEMONIC, SUFFIX_TEXT, SUFFIX_TITLE, SUFFIX_TOOL_TIP_TEXT
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractActionDefault()
          Constructor for AbstractActionDefault.
AbstractActionDefault(ClackFramework graphpad)
          Constructor for AbstractActionDefault.
AbstractActionDefault(ClackFramework graphpad, java.lang.String name)
          Constructor for AbstractActionDefault.
AbstractActionDefault(ClackFramework graphpad, java.lang.String name, javax.swing.Icon icon)
          Constructor for AbstractActionDefault.
AbstractActionDefault(java.lang.String name)
          Constructor for AbstractActionDefault.
AbstractActionDefault(java.lang.String name, javax.swing.Icon icon)
          Constructor for AbstractActionDefault.
 
Method Summary
 ClackDocument getCurrentDocument()
           
 RouterGraph getCurrentGraph()
           
 GraphLayoutCache getCurrentGraphLayoutCache()
           
 ClackFramework getGraphpad()
          Returns the graphpad.
protected  java.awt.Component getMenuComponent(java.lang.String actionCommand)
          Returns a JMenuItem with a link to this action.
 java.awt.Component[] getMenuComponents()
          Creates by default an arry with one entry.
 java.lang.String getName()
          Returns the name of the action
 java.lang.String getPresentationText(java.lang.String actionCommand)
          Should return presentation Text for the action command or null for the default
protected  java.awt.Component getToolComponent(java.lang.String actionCommand)
          Returns a clean JButton which has a link to this action.
 java.awt.Component[] getToolComponents()
          Returns by default a list with one JButton.
 void setGraphpad(ClackFramework graphpad)
          Sets the graphpad.
 void setSelectionAttributes(java.util.Map map)
           
 void update()
          empty implementation for this typ of 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
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

graphpad

protected ClackFramework graphpad
A reference back to the graphpad. If an action was performed the Actions applies the changes to the current Document at the graphpad.

Constructor Detail

AbstractActionDefault

public AbstractActionDefault()
Constructor for AbstractActionDefault. The Abstract action uses the class name without package prefix as action name.

See Also:
Action.NAME

AbstractActionDefault

public AbstractActionDefault(ClackFramework graphpad)
Constructor for AbstractActionDefault. The Abstract action uses the class name without package prefix as action name.

Parameters:
graphpad - The reference to the graphpad for this action
See Also:
Action.NAME

AbstractActionDefault

public AbstractActionDefault(java.lang.String name)
Constructor for AbstractActionDefault.

Parameters:
name - Key for the name of this action

AbstractActionDefault

public AbstractActionDefault(ClackFramework graphpad,
                             java.lang.String name)
Constructor for AbstractActionDefault.

Parameters:
graphpad - The reference to the graphpad for this action
name - Key for the name of this action

AbstractActionDefault

public AbstractActionDefault(ClackFramework graphpad,
                             java.lang.String name,
                             javax.swing.Icon icon)
Constructor for AbstractActionDefault.

Parameters:
graphpad - The reference to the graphpad for this action
name - Key for the name of the action
icon - The icon for this action

AbstractActionDefault

public AbstractActionDefault(java.lang.String name,
                             javax.swing.Icon icon)
Constructor for AbstractActionDefault.

Parameters:
name - Key for the name of this action
icon - The icon for this action
Method Detail

getName

public java.lang.String getName()
Returns the name of the action


getCurrentGraph

public RouterGraph getCurrentGraph()

getCurrentGraphLayoutCache

public GraphLayoutCache getCurrentGraphLayoutCache()

setSelectionAttributes

public void setSelectionAttributes(java.util.Map map)

getCurrentDocument

public ClackDocument getCurrentDocument()

getMenuComponents

public java.awt.Component[] getMenuComponents()
Creates by default an arry with one entry. The entry contains a JMenuItem which joins the instance of this Action.


getToolComponents

public java.awt.Component[] getToolComponents()
Returns by default a list with one JButton. The button joints this action.


getMenuComponent

protected java.awt.Component getMenuComponent(java.lang.String actionCommand)
Returns a JMenuItem with a link to this action.


getToolComponent

protected java.awt.Component getToolComponent(java.lang.String actionCommand)
Returns a clean JButton which has a link to this action.


update

public void update()
empty implementation for this typ of action


getPresentationText

public java.lang.String getPresentationText(java.lang.String actionCommand)
Should return presentation Text for the action command or null for the default


setGraphpad

public void setGraphpad(ClackFramework graphpad)
Sets the graphpad.

Parameters:
graphpad - The graphpad to set

getGraphpad

public ClackFramework getGraphpad()
Returns the graphpad.

Returns:
GPGraphpad