JGraphpad Pro
v6.0.5.0


com.jgraph.pad.action
Class JGraphpadViewAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended bycom.jgraph.editor.JGraphEditorAction
          extended bycom.jgraph.pad.action.JGraphpadViewAction
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable

public class JGraphpadViewAction
extends JGraphEditorAction

Implements all actions of the view menu. The layout item is added by a the layout plugin.

See Also:
Serialized Form

Nested Class Summary
static class JGraphpadViewAction.AllActions
          Bundle of all actions in this class.
 
Nested classes inherited from class com.jgraph.editor.JGraphEditorAction
JGraphEditorAction.Bundle
 
Field Summary
protected  File lastDirectory
          Holds the last directory for file operations.
static String NAME_BACKGROUND
          Specifies the name for the background action.
static String NAME_BACKGROUNDIMAGE
          Specifies the name for the backgroundImage action.
static String NAME_BACKGROUNDIMAGEURL
          Specifies the name for the backgroundImageURL action.
static String NAME_CLEARBACKGROUND
          Specifies the name for the clearBackground action.
static String NAME_EDITCLICKCOUNT
          Specifies the name for the editClickCount action.
static String NAME_FITNONE
          Specifies the name for the fitNone action.
static String NAME_FITPAGE
          Specifies the name for the fitPage action.
static String NAME_FITWIDTH
          Specifies the name for the fitWidth action.
static String NAME_FITWINDOW
          Specifies the name for the fitWindow action.
static String NAME_GRIDCOLOR
          Specifies the name for the gridColor action.
static String NAME_GRIDSIZE
          Specifies the name for the gridSize action.
static String NAME_HANDLECOLOR
          Specifies the name for the handleColor action.
static String NAME_HANDLESIZE
          Specifies the name for the handleSize action.
static String NAME_LIBRARYLARGER
          Specifies the name for the libraryLarger action.
static String NAME_LIBRARYSMALLER
          Specifies the name for the librarySmaller action.
static String NAME_LOCKEDHANDLECOLOR
          Specifies the name for the handleSize action.
static String NAME_MARQUEECOLOR
          Specifies the name for the handleColor action.
static String NAME_PORTSIZE
          Specifies the name for the portSize action.
static String NAME_SWITCHCROSSGRID
          Specifies the name for the switchDotGrid action.
static String NAME_SWITCHDOTGRID
          Specifies the name for the switchDotGrid action.
static String NAME_SWITCHLINEGRID
          Specifies the name for the switchDotGrid action.
static String NAME_TOGGLEANTIALIAS
          Specifies the name for the toggleAntiAlias action.
static String NAME_TOGGLEDISCONNECTONMOVE
          Specifies the name for the toggleDisconnectOnMove action.
static String NAME_TOGGLEDOUBLEBUFFERED
          Specifies the name for the toggleDoubleBuffered action.
static String NAME_TOGGLEDRAGENABLED
          Specifies the name for the toggleDragEnabled action.
static String NAME_TOGGLEEDITABLE
          Specifies the name for the toggleEditable action.
static String NAME_TOGGLEGRAPHBENDABLE
          Specifies the name for the toggleGraphBendable action.
static String NAME_TOGGLEGRAPHCLONEABLE
          Specifies the name for the toggleGraphCloneable action.
static String NAME_TOGGLEGRAPHCONNECTABLE
          Specifies the name for the toggleGraphConnectable action.
static String NAME_TOGGLEGRAPHDISCONNECTABLE
          Specifies the name for the toggleGraphDisconnectable action.
static String NAME_TOGGLEGRAPHMOVEABLE
          Specifies the name for the toggleGraphMoveable action.
static String NAME_TOGGLEGRAPHSIZEABLE
          Specifies the name for the toggleGraphSizeable action.
static String NAME_TOGGLEGRID
          Specifies the name for the toggleGrid action.
static String NAME_TOGGLEHIDESDANGLINGCONNECTIONS
          Specifies the name for the toggleHidesDanglingConnections action.
static String NAME_TOGGLEHIDESEXISTINGCONNECTIONS
          Specifies the name for the toggleHidesExistingConnections action.
static String NAME_TOGGLEJUMPSTODEFAULTPORT
          Specifies the name for the toggleJumpsToDefaultPort action.
static String NAME_TOGGLEMETRIC
          Specifies the name for the toggleMetric action.
static String NAME_TOGGLEMOVEBELOWZERO
          Specifies the name for the toggleMoveBelowZero action.
static String NAME_TOGGLEMOVESINTOGROUPS
          Specifies the name for the toggleMovesIntoGroups action.
static String NAME_TOGGLEMOVESOUTOFGROUPS
          Specifies the name for the toggleMovesOutOfGroups action.
static String NAME_TOGGLEPAGE
          Specifies the name for the togglePage action.
static String NAME_TOGGLEPORTS
          Specifies the name for the togglePorts action.
static String NAME_TOGGLEPORTSSCALED
          Specifies the name for the togglePortsScaled action.
static String NAME_TOGGLEREMEMBERSCELLVIEWS
          Specifies the name for the toggleRemembersCellViews action.
static String NAME_TOGGLEROOTHANDLES
          Specifies the name for the toggleRootHandles action.
static String NAME_TOGGLERULERS
          Specifies the name for the togglerRulers action.
static String NAME_TOGGLESELECTSALLINSERTEDCELLS
          Specifies the name for the toggleSelectsAllInsertedCells action.
static String NAME_TOGGLESELECTSLOCALINSERTEDCELLS
          Specifies the name for the toggleSelectsLocalInsertedCells action.
static String NAME_TOGGLESHOWSCHANGEDCONNECTIONS
          Specifies the name for the toggleShowsChangedConnections action.
static String NAME_TOGGLESHOWSEXISTINGCONNECTIONS
          Specifies the name for the toggleShowsExistingConnections action.
static String NAME_TOGGLESHOWSINSERTEDCONNECTIONS
          Specifies the name for the toggleShowsInsertedConnections action.
static String NAME_TOLERANCE
          Specifies the name for the tolerance action.
static String NAME_ZOOMACTUAL
          Specifies the name for the zoomActual action.
static String NAME_ZOOMCUSTOM
          Specifies the name for the zoomCustom action.
static String NAME_ZOOMIN
          Specifies the name for the zoomIn action.
static String NAME_ZOOMOUT
          Specifies the name for the zoomOut action.
 
Fields inherited from class com.jgraph.editor.JGraphEditorAction
isToggleAction, PROPERTY_ISSELECTED, PROPERTY_ISVISIBLE
 
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
JGraphpadViewAction(String name)
          Constructs a new view action for the specified name.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Executes the action based on the action name.
protected  void doBackground(JGraphEditorDiagramPane diagramPane)
          Displays a color dialog and sets the background color on the specified diagram pane.
protected  void doBackgroundImage(JGraphEditorDiagramPane diagramPane, String filename)
          Displays a file- or URL-dialog and uses the filename to set the background image on the specified diagram pane.
protected  void doScaleLibraryEntries(JGraphpadLibraryPane pane, boolean larger)
          Doubles or halves the current size of the entries in the specified library pane based on larger.
protected  void doZoom(org.jgraph.JGraph graph, boolean in, boolean out, boolean custom)
          Sets the zoom on the specified graph depending on the paramters, which are interpreted to be exlusive.
 
Methods inherited from class com.jgraph.editor.JGraphEditorAction
getActiveFrame, getFrame, getJGraphpadPane, getJGraphpadPane, getName, getParentGraph, getPermanentFocusOwner, getPermanentFocusOwnerDiagram, getPermanentFocusOwnerDiagramPane, getPermanentFocusOwnerGraph, getPermanentFocusOwnerOrParent, getString, isSelected, isToggleAction, isVisible, setEnabled, setSelected, setToggleAction, setVisible
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_TOGGLERULERS

public static final String NAME_TOGGLERULERS
Specifies the name for the togglerRulers action.

See Also:
Constant Field Values

NAME_TOGGLEPORTS

public static final String NAME_TOGGLEPORTS
Specifies the name for the togglePorts action.

See Also:
Constant Field Values

NAME_HANDLECOLOR

public static final String NAME_HANDLECOLOR
Specifies the name for the handleColor action.

See Also:
Constant Field Values

NAME_LOCKEDHANDLECOLOR

public static final String NAME_LOCKEDHANDLECOLOR
Specifies the name for the handleSize action.

See Also:
Constant Field Values

NAME_MARQUEECOLOR

public static final String NAME_MARQUEECOLOR
Specifies the name for the handleColor action.

See Also:
Constant Field Values

NAME_HANDLESIZE

public static final String NAME_HANDLESIZE
Specifies the name for the handleSize action.

See Also:
Constant Field Values

NAME_TOGGLEGRID

public static final String NAME_TOGGLEGRID
Specifies the name for the toggleGrid action.

See Also:
Constant Field Values

NAME_GRIDCOLOR

public static final String NAME_GRIDCOLOR
Specifies the name for the gridColor action.

See Also:
Constant Field Values

NAME_SWITCHDOTGRID

public static final String NAME_SWITCHDOTGRID
Specifies the name for the switchDotGrid action.

See Also:
Constant Field Values

NAME_SWITCHLINEGRID

public static final String NAME_SWITCHLINEGRID
Specifies the name for the switchDotGrid action.

See Also:
Constant Field Values

NAME_SWITCHCROSSGRID

public static final String NAME_SWITCHCROSSGRID
Specifies the name for the switchDotGrid action.

See Also:
Constant Field Values

NAME_TOGGLEANTIALIAS

public static final String NAME_TOGGLEANTIALIAS
Specifies the name for the toggleAntiAlias action.

See Also:
Constant Field Values

NAME_TOGGLEROOTHANDLES

public static final String NAME_TOGGLEROOTHANDLES
Specifies the name for the toggleRootHandles action.

See Also:
Constant Field Values

NAME_TOGGLEDRAGENABLED

public static final String NAME_TOGGLEDRAGENABLED
Specifies the name for the toggleDragEnabled action.

See Also:
Constant Field Values

NAME_FITNONE

public static final String NAME_FITNONE
Specifies the name for the fitNone action.

See Also:
Constant Field Values

NAME_FITPAGE

public static final String NAME_FITPAGE
Specifies the name for the fitPage action.

See Also:
Constant Field Values

NAME_FITWINDOW

public static final String NAME_FITWINDOW
Specifies the name for the fitWindow action.

See Also:
Constant Field Values

NAME_FITWIDTH

public static final String NAME_FITWIDTH
Specifies the name for the fitWidth action.

See Also:
Constant Field Values

NAME_TOGGLEPAGE

public static final String NAME_TOGGLEPAGE
Specifies the name for the togglePage action.

See Also:
Constant Field Values

NAME_BACKGROUND

public static final String NAME_BACKGROUND
Specifies the name for the background action.

See Also:
Constant Field Values

NAME_BACKGROUNDIMAGE

public static final String NAME_BACKGROUNDIMAGE
Specifies the name for the backgroundImage action.

See Also:
Constant Field Values

NAME_BACKGROUNDIMAGEURL

public static final String NAME_BACKGROUNDIMAGEURL
Specifies the name for the backgroundImageURL action.

See Also:
Constant Field Values

NAME_CLEARBACKGROUND

public static final String NAME_CLEARBACKGROUND
Specifies the name for the clearBackground action.

See Also:
Constant Field Values

NAME_ZOOMACTUAL

public static final String NAME_ZOOMACTUAL
Specifies the name for the zoomActual action.

See Also:
Constant Field Values

NAME_ZOOMCUSTOM

public static final String NAME_ZOOMCUSTOM
Specifies the name for the zoomCustom action.

See Also:
Constant Field Values

NAME_ZOOMIN

public static final String NAME_ZOOMIN
Specifies the name for the zoomIn action.

See Also:
Constant Field Values

NAME_ZOOMOUT

public static final String NAME_ZOOMOUT
Specifies the name for the zoomOut action.

See Also:
Constant Field Values

NAME_TOLERANCE

public static final String NAME_TOLERANCE
Specifies the name for the tolerance action.

See Also:
Constant Field Values

NAME_PORTSIZE

public static final String NAME_PORTSIZE
Specifies the name for the portSize action.

See Also:
Constant Field Values

NAME_GRIDSIZE

public static final String NAME_GRIDSIZE
Specifies the name for the gridSize action.

See Also:
Constant Field Values

NAME_TOGGLEMETRIC

public static final String NAME_TOGGLEMETRIC
Specifies the name for the toggleMetric action.

See Also:
Constant Field Values

NAME_TOGGLEEDITABLE

public static final String NAME_TOGGLEEDITABLE
Specifies the name for the toggleEditable action.

See Also:
Constant Field Values

NAME_EDITCLICKCOUNT

public static final String NAME_EDITCLICKCOUNT
Specifies the name for the editClickCount action.

See Also:
Constant Field Values

NAME_TOGGLEDISCONNECTONMOVE

public static final String NAME_TOGGLEDISCONNECTONMOVE
Specifies the name for the toggleDisconnectOnMove action.

See Also:
Constant Field Values

NAME_TOGGLEMOVEBELOWZERO

public static final String NAME_TOGGLEMOVEBELOWZERO
Specifies the name for the toggleMoveBelowZero action.

See Also:
Constant Field Values

NAME_TOGGLEGRAPHCLONEABLE

public static final String NAME_TOGGLEGRAPHCLONEABLE
Specifies the name for the toggleGraphCloneable action.

See Also:
Constant Field Values

NAME_TOGGLEGRAPHMOVEABLE

public static final String NAME_TOGGLEGRAPHMOVEABLE
Specifies the name for the toggleGraphMoveable action.

See Also:
Constant Field Values

NAME_TOGGLEGRAPHSIZEABLE

public static final String NAME_TOGGLEGRAPHSIZEABLE
Specifies the name for the toggleGraphSizeable action.

See Also:
Constant Field Values

NAME_TOGGLEGRAPHBENDABLE

public static final String NAME_TOGGLEGRAPHBENDABLE
Specifies the name for the toggleGraphBendable action.

See Also:
Constant Field Values

NAME_TOGGLEGRAPHCONNECTABLE

public static final String NAME_TOGGLEGRAPHCONNECTABLE
Specifies the name for the toggleGraphConnectable action.

See Also:
Constant Field Values

NAME_TOGGLEGRAPHDISCONNECTABLE

public static final String NAME_TOGGLEGRAPHDISCONNECTABLE
Specifies the name for the toggleGraphDisconnectable action.

See Also:
Constant Field Values

NAME_TOGGLESELECTSLOCALINSERTEDCELLS

public static final String NAME_TOGGLESELECTSLOCALINSERTEDCELLS
Specifies the name for the toggleSelectsLocalInsertedCells action.

See Also:
Constant Field Values

NAME_TOGGLESELECTSALLINSERTEDCELLS

public static final String NAME_TOGGLESELECTSALLINSERTEDCELLS
Specifies the name for the toggleSelectsAllInsertedCells action.

See Also:
Constant Field Values

NAME_TOGGLESHOWSEXISTINGCONNECTIONS

public static final String NAME_TOGGLESHOWSEXISTINGCONNECTIONS
Specifies the name for the toggleShowsExistingConnections action.

See Also:
Constant Field Values

NAME_TOGGLESHOWSINSERTEDCONNECTIONS

public static final String NAME_TOGGLESHOWSINSERTEDCONNECTIONS
Specifies the name for the toggleShowsInsertedConnections action.

See Also:
Constant Field Values

NAME_TOGGLESHOWSCHANGEDCONNECTIONS

public static final String NAME_TOGGLESHOWSCHANGEDCONNECTIONS
Specifies the name for the toggleShowsChangedConnections action.

See Also:
Constant Field Values

NAME_TOGGLEHIDESEXISTINGCONNECTIONS

public static final String NAME_TOGGLEHIDESEXISTINGCONNECTIONS
Specifies the name for the toggleHidesExistingConnections action.

See Also:
Constant Field Values

NAME_TOGGLEHIDESDANGLINGCONNECTIONS

public static final String NAME_TOGGLEHIDESDANGLINGCONNECTIONS
Specifies the name for the toggleHidesDanglingConnections action.

See Also:
Constant Field Values

NAME_TOGGLEREMEMBERSCELLVIEWS

public static final String NAME_TOGGLEREMEMBERSCELLVIEWS
Specifies the name for the toggleRemembersCellViews action.

See Also:
Constant Field Values

NAME_TOGGLEDOUBLEBUFFERED

public static final String NAME_TOGGLEDOUBLEBUFFERED
Specifies the name for the toggleDoubleBuffered action.

See Also:
Constant Field Values

NAME_TOGGLEPORTSSCALED

public static final String NAME_TOGGLEPORTSSCALED
Specifies the name for the togglePortsScaled action.

See Also:
Constant Field Values

NAME_TOGGLEJUMPSTODEFAULTPORT

public static final String NAME_TOGGLEJUMPSTODEFAULTPORT
Specifies the name for the toggleJumpsToDefaultPort action.

See Also:
Constant Field Values

NAME_TOGGLEMOVESINTOGROUPS

public static final String NAME_TOGGLEMOVESINTOGROUPS
Specifies the name for the toggleMovesIntoGroups action.

See Also:
Constant Field Values

NAME_TOGGLEMOVESOUTOFGROUPS

public static final String NAME_TOGGLEMOVESOUTOFGROUPS
Specifies the name for the toggleMovesOutOfGroups action.

See Also:
Constant Field Values

NAME_LIBRARYLARGER

public static final String NAME_LIBRARYLARGER
Specifies the name for the libraryLarger action.

See Also:
Constant Field Values

NAME_LIBRARYSMALLER

public static final String NAME_LIBRARYSMALLER
Specifies the name for the librarySmaller action.

See Also:
Constant Field Values

lastDirectory

protected File lastDirectory
Holds the last directory for file operations.

Constructor Detail

JGraphpadViewAction

public JGraphpadViewAction(String name)
Constructs a new view action for the specified name. If the action name starts with toggle, fit or switch then the action is configured to be a toggle action.

Parameters:
name - The name of the action to be created.
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Executes the action based on the action name.

Parameters:
event - The object that describes the event.

doScaleLibraryEntries

protected void doScaleLibraryEntries(JGraphpadLibraryPane pane,
                                     boolean larger)
Doubles or halves the current size of the entries in the specified library pane based on larger.

Parameters:
pane - The layout pane to change the entries of.
larger - Whether to make the entries larger.

doZoom

protected void doZoom(org.jgraph.JGraph graph,
                      boolean in,
                      boolean out,
                      boolean custom)
Sets the zoom on the specified graph depending on the paramters, which are interpreted to be exlusive. If custom is true this method displays a dialog to enter the custom zoom and sets the zoom to the specified value. If custom is false then the method will double or half the current zoom of graph depending on the value of in and out. If all values are false then the zoom is reset to 1.
This implementation makes sure the zoom is between 0.01 and 300 and scrolls to the selection cell if the selection is not empty.

Parameters:
graph - The graph to perform the operation in.
in - Whether to zoom in if no custom dialog is used.
out - Whether to zoom out if no custom dialog is used.
custom - Whether to display a dialog to ask for a custom zoom.

doBackground

protected void doBackground(JGraphEditorDiagramPane diagramPane)
Displays a color dialog and sets the background color on the specified diagram pane.

Parameters:
diagramPane - The diagramPane to perform the operation in.

doBackgroundImage

protected void doBackgroundImage(JGraphEditorDiagramPane diagramPane,
                                 String filename)
                          throws MalformedURLException,
                                 FileNotFoundException,
                                 IOException
Displays a file- or URL-dialog and uses the filename to set the background image on the specified diagram pane.

Parameters:
diagramPane - The diagramPane to perform the operation in.
filename - The filename or URL to load the image from.
Throws:
MalformedURLException
FileNotFoundException
IOException

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.