org.jgraph.pad.actions
Class AbstractActionDefault

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.jgraph.pad.actions.AbstractActionDefault
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable, TranslatorConstants
Direct Known Subclasses:
AbstractActionFile, AbstractActionList, AbstractActionToggle, AbstractDefaultVertexnPortsCreator, EditCell, EditCopy, EditCut, EditDelete, EditFindAgain, EditInsertIntoLibrary, EditPaste, EditRedo, EditUndo, FileClose, FileExit, FileExportGXL, FileImportGEO, FileImportGXL, FileImportSimple, FileLibraryClose, FileLibraryNew, FileLibraryRename, FileNew, FilePageFormat, FilePrint, FormatAlignBottom, FormatAlignCenter, FormatAlignLeft, FormatAlignMiddle, FormatAlignRight, FormatAlignTop, FormatBorderColor, FormatBorderNo, FormatFillColor, FormatFillNo, FormatGradientColor, FormatLineBezier, FormatLineColor, FormatLineLabelEdge, FormatLineLabelNormal, FormatLineOrthogonal, FormatLinePattern, FormatLineSpline, FormatLineWidth, FormatLockNotBendable, FormatLockNotConnectable, FormatLockNotDisconnectable, FormatLockPosition, FormatLockSize, FormatLockValue, FormatReverse, FormatRoutingNo, FormatRoutingParallel, FormatRoutingSimple, FormatShapeNoImage, FormatSizeAuto, FormatSizeManual, FormatStyleEndSize, FormatStyleNoStartEnd, FormatStyleStartSize, FormatTextFontColor, FormatTextFontSize, FormatTextFontStyleBold, FormatTextFontStyleItalic, FormatTextFontStyleNormal, FormatTextFontStyleUnderline, FormatTextPositionBottom, FormatTextPositionCenter, FormatTextPositionLeft, FormatTextPositionMiddle, FormatTextPositionRight, FormatTextPositionTop, FormatUnlockBendable, FormatUnlockConnectable, FormatUnlockConnections, FormatUnlockDisconnectable, FormatUnlockPosition, FormatUnlockSize, FormatUnlockValue, GraphApplyLayoutAlgorithm, GraphArrange, GraphBackgroundColor, GraphBackgroundNoImage, GraphTilt, HelpAbout, HelpHomepage, HelpSubmitABug, SelectAll, SelectAllClear, SelectEdges, SelectEdgesClear, SelectInverse, SelectMinimalSpanTree, SelectShortestPath, SelectVertices, SelectVerticesClear, ShapeAlignBottom, ShapeAlignCenter, ShapeAlignLeft, ShapeAlignMiddle, ShapeAlignRight, ShapeAlignTop, ShapeBestPorts, ShapeCloneAttributes, ShapeCloneLabel, ShapeCloneSize, ShapeConnect, ShapeDefaultPorts, ShapeDisconnect, ShapeGroup, ShapeToBack, ShapeToFront, ShapeUngroup, ToolBoxEdge, ToolBoxLine, ToolBoxSelect, ToolBoxZoomArea, ToolsGridSize, ToolsPortSize, ToolsShowExplorer, ToolsShowOverview, ToolsSnapSize, ViewActualSize, ViewScaleCustom, ViewScaleZoomIn, ViewScaleZoomOut, WindowCascade, WindowLogConsole, 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  GPGraphpad graphpad
          A reference back to the graphpad.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface org.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(GPGraphpad graphpad)
          Constructor for AbstractActionDefault.
AbstractActionDefault(GPGraphpad graphpad, java.lang.String name)
          Constructor for AbstractActionDefault.
AbstractActionDefault(GPGraphpad 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
 GPDocument getCurrentDocument()
           
 GPGraph getCurrentGraph()
           
 GraphLayoutCache getCurrentGraphLayoutCache()
           
 GPGraphpad 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 setFontNameForSelection(java.lang.String fontName)
           
 void setFontSizeForSelection(float size)
           
 void setFontStyleForSelection(int style)
           
 void setGraphpad(GPGraphpad 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 GPGraphpad 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(GPGraphpad 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(GPGraphpad 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(GPGraphpad 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 GPGraph getCurrentGraph()

getCurrentGraphLayoutCache

public GraphLayoutCache getCurrentGraphLayoutCache()

setSelectionAttributes

public void setSelectionAttributes(java.util.Map map)

setFontSizeForSelection

public void setFontSizeForSelection(float size)

setFontStyleForSelection

public void setFontStyleForSelection(int style)

setFontNameForSelection

public void setFontNameForSelection(java.lang.String fontName)

getCurrentDocument

public GPDocument 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(GPGraphpad graphpad)
Sets the graphpad.

Parameters:
graphpad - The graphpad to set

getGraphpad

public GPGraphpad getGraphpad()
Returns the graphpad.

Returns:
GPGraphpad