JGraphpad Pro
v6.0.5.0


com.jgraph.pad.action
Class JGraphpadFormatAction

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

public class JGraphpadFormatAction
extends JGraphEditorAction

Implements all actions of the format menu.

See Also:
Serialized Form

Nested Class Summary
static class JGraphpadFormatAction.AllActions
          Bundle of all actions in this class.
 
Nested classes inherited from class com.jgraph.editor.JGraphEditorAction
JGraphEditorAction.Bundle
 
Field Summary
protected static int FONT_UNDERLINE
          Defines the underline font style.
protected  File lastDirectory
          Holds the last directory for file operations.
static String NAME_BEGINSIZE
          Specifies the name for the beginSize action.
static String NAME_CELLBACKGROUNDCOLOR
          Specifies the name for the cellBackgroundColor action.
static String NAME_CELLBORDERCOLOR
          Specifies the name for the cellBorderColor action.
static String NAME_CELLBORDERWIDTH
          Specifies the name for the cellBorderWidth action.
static String NAME_CELLGRADIENTCOLOR
          Specifies the name for the cellGradientColor action.
static String NAME_CELLIMAGE
          Specifies the name for the cellImage action.
static String NAME_CELLIMAGEURL
          Specifies the name for the cellImageURL action.
static String NAME_CELLINSET
          Specifies the name for the cellInset action.
static String NAME_CLEARBEGIN
          Specifies the name for the clearBegin action.
static String NAME_CLEARCELLBORDER
          Specifies the name for the clearCellBorder action.
static String NAME_CLEARCELLIMAGE
          Specifies the name for the clearCellImage action.
static String NAME_CLEAREND
          Specifies the name for the clearEnd action.
static String NAME_DASHOFFSET
          Specifies the name for the dashOffset action.
static String NAME_DASHPATTERN
          Specifies the name for the dashPattern action.
static String NAME_ENDSIZE
          Specifies the name for the endSize action.
static String NAME_FONT
          Specifies the name for the font action.
static String NAME_FONTBOLD
          Specifies the name for the fontBold action.
static String NAME_FONTCOLOR
          Specifies the name for the fontColor action.
static String NAME_FONTITALIC
          Specifies the name for the fontItalic action.
static String NAME_FONTPLAIN
          Specifies the name for the fontPlain action.
static String NAME_FONTSIZE
          Specifies the name for the fontSize action.
static String NAME_FONTUNDERLINE
          Specifies the name for the fontUnderline action.
static String NAME_LINECOLOR
          Specifies the name for the lineColor action.
static String NAME_LINEWIDTH
          Specifies the name for the lineWidth action.
static String NAME_RESIZE
          Specifies the name for the resize action.
static String NAME_SWITCHALIGNBOTTOM
          Specifies the name for the switchAlignBottom action.
static String NAME_SWITCHALIGNCENTER
          Specifies the name for the switchAlignCenter action.
static String NAME_SWITCHALIGNLEFT
          Specifies the name for the switchAlignLeft action.
static String NAME_SWITCHALIGNMIDDLE
          Specifies the name for the switchAlignMiddle action.
static String NAME_SWITCHALIGNRIGHT
          Specifies the name for the switchAlignRight action.
static String NAME_SWITCHALIGNTOP
          Specifies the name for the switchAlignTop action.
static String NAME_SWITCHLABELBOTTOM
          Specifies the name for the switchLabelBottom action.
static String NAME_SWITCHLABELCENTER
          Specifies the name for the switchLabelCenter action.
static String NAME_SWITCHLABELLEFT
          Specifies the name for the switchLabelLeft action.
static String NAME_SWITCHLABELMIDDLE
          Specifies the name for the switchLabelMiddle action.
static String NAME_SWITCHLABELRIGHT
          Specifies the name for the switchLabelRight action.
static String NAME_SWITCHLABELTOP
          Specifies the name for the switchLabelTop action.
static String NAME_SWITCHLOCKHEIGHT
          Specifies the name for the switchLockHeight action.
static String NAME_SWITCHLOCKWIDTH
          Specifies the name for the switchLockWidth action.
static String NAME_SWITCHLOCKX
          Specifies the name for the switchLockX action.
static String NAME_SWITCHLOCKY
          Specifies the name for the switchLockX action.
static String NAME_SWITCHROUTINGNONE
          Specifies the name for the switchRoutingNone action.
static String NAME_SWITCHROUTINGPARALLEL
          Specifies the name for the switchRoutingParallel action.
static String NAME_SWITCHROUTINGPARALLELSPLINE
          Specifies the name for the switchRoutingParallelSpline action.
static String NAME_SWITCHROUTINGSIMPLE
          Specifies the name for the switchRoutingSimple action.
static String NAME_SWITCHSHAPECIRCLE
          Specifies the name for the switchShapeCircle action.
static String NAME_SWITCHSHAPECYLINDER
          Specifies the name for the switchShapeCylinder action.
static String NAME_SWITCHSHAPEDIAMOND
          Specifies the name for the switchShapeDiamond action.
static String NAME_SWITCHSHAPERECTANGLE
          Specifies the name for the switchShapeRectangle action.
static String NAME_SWITCHSHAPEROUNDED
          Specifies the name for the switchShapeRounded action.
static String NAME_SWITCHSHAPETRIANGLE
          Specifies the name for the switchShapeTriangle action.
static String NAME_SWITCHSTYLEBEZIER
          Specifies the name for the switchStyleBezier action.
static String NAME_SWITCHSTYLEORTHOGONAL
          Specifies the name for the switchStyleOrthogonal action.
static String NAME_SWITCHSTYLESPLINE
          Specifies the name for the switchStyleSpline action.
static String NAME_TOGGLEAUTOSIZE
          Specifies the name for the toggleAutoSize action.
static String NAME_TOGGLECELLEDITABLE
          Specifies the name for the toggleCellEditable action.
static String NAME_TOGGLECELLMOVEABLE
          Specifies the name for the toggleCellMoveable action.
static String NAME_TOGGLECELLOPAQUE
          Specifies the name for the toggleCellOpaque action.
static String NAME_TOGGLECELLSIZEABLE
          Specifies the name for the toggleCellSizeable action.
static String NAME_TOGGLECONNECTABLE
          Specifies the name for the toggleConnectable action.
static String NAME_TOGGLECONSTRAINED
          Specifies the name for the toggleConstrained action.
static String NAME_TOGGLEDISCONNECTABLE
          Specifies the name for the toggleDisconnectable action.
static String NAME_TOGGLEEDGEBENDABLE
          Specifies the name for the toggleEdgeBendable action.
static String NAME_TOGGLEGROUPOPAQUE
          Specifies the name for the toggleGroupOpaque action.
static String NAME_TOGGLEGROUPREPOSITION
          Specifies the name for the toggleCellMoveable action.
static String NAME_TOGGLELABELALONGEDGE
          Specifies the name for the toggleLabelAlongEdge action.
static String NAME_TOGGLESTRETCHCELLIMAGE
          Specifies the name for the toggleStretchCellImage 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
JGraphpadFormatAction(String name)
          Constructs a new format action for the specified name.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Executes the action based on the action name.
protected  void doAskColorAttribute(org.jgraph.JGraph graph, String key)
          Shortcut method that invokes doAskColorAttribute(JGraph, String, boolean) with setOpaque = false.
protected  void doAskColorAttribute(org.jgraph.JGraph graph, String key, boolean setOpaque)
          Displays a dialog to ask for a color and uses the color to set the attribute under key for the selected cells in graph.
protected  void doAskFloatAttribute(org.jgraph.JGraph graph, String key, float defaultValue)
          Displays a dialog to ask for a number and uses the number to set the attribute under key for the selected cells in graph.
protected  void doAskImageAttribute(org.jgraph.JGraph graph, String key, boolean urlDialog)
          Displays a dialog to ask for a file or URL depending on urlDialog and uses the filename to set the image attribute under key for the selected cells in graph.
protected  void doAskIntAttribute(org.jgraph.JGraph graph, String key, int defaultValue)
          Displays a dialog to ask for a number and uses the number to set the attribute under key for the selected cells in graph.
protected  void doSetDashPattern(org.jgraph.JGraph graph)
          Changes the dash pattern in the selection edges of the specified graph by displaying a dialog to enter a dash sequence of the form [n[,n[,n]*]] where n is a number.
protected  void doSetFont(Component component, Object change, boolean plain, int style, float size)
          Changes the font on the specified component to change, which may be either a Font or Color object, changing the respective font property of either the selection cells in JGraph or the selection text in JTextPane.
protected  void doSetHorizontalAlignment(Component component, int align)
          Changes the horizontal alignment on the specified component to align, which may be one of SwingConstants.LEFT, SwingConstants.CENTER or SwingConstants.RIGHT.
protected  void doToggleAttribute(org.jgraph.JGraph graph, String key, boolean defaultValue)
          Displays a dialog to ask for a file or URL depending on urlDialog and uses the filename to set the image attribute under key for the selected cells in graph.
 Font fontDialog(Component component, String title, Font font)
          Displays a font dialog using JGraphpadDialogs.fontDialog(Component, String).
static Object getAttribute(org.jgraph.JGraph graph, String key)
          Returns the value of the attribute under key for the first selected cell in the specified graph as an Object or null if no such attribute exists.
static boolean getBooleanAttribute(org.jgraph.JGraph graph, String key, boolean defaultValue)
          Returns the value of the attribute under key for the first selected cell in the specified graph as a boolean or defaultValue if no such attribute can be found.
static int getIntAttribute(org.jgraph.JGraph graph, String key, int defaultValue)
          Returns the value of the attribute under key for the first selected cell in the specified graph as an int or defaultValue if no such attribute can be found.
protected  void setAttribute(org.jgraph.JGraph graph, String key, Object value)
          Sets the value of the attribute under key to value for the selection cells in graph.
protected  void setAttributes(org.jgraph.JGraph graph, String[] keys, Object[] values, boolean all)
          Sets the value of the attributes under keys to values for the selection or all cells in graph depending on all.
protected  void setRouting(org.jgraph.JGraph graph, org.jgraph.graph.Edge.Routing routing)
          Changes the font style on the specified component to style, which may be one of Font.BOLD, Font.ITALIC or FONT_UNDERLINE.
 
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

FONT_UNDERLINE

protected static int FONT_UNDERLINE
Defines the underline font style. This font style is only available for rich text values.


NAME_TOGGLECELLMOVEABLE

public static final String NAME_TOGGLECELLMOVEABLE
Specifies the name for the toggleCellMoveable action.

See Also:
Constant Field Values

NAME_TOGGLEGROUPREPOSITION

public static final String NAME_TOGGLEGROUPREPOSITION
Specifies the name for the toggleCellMoveable action.

See Also:
Constant Field Values

NAME_SWITCHLOCKX

public static final String NAME_SWITCHLOCKX
Specifies the name for the switchLockX action.

See Also:
Constant Field Values

NAME_SWITCHLOCKY

public static final String NAME_SWITCHLOCKY
Specifies the name for the switchLockX action.

See Also:
Constant Field Values

NAME_RESIZE

public static final String NAME_RESIZE
Specifies the name for the resize action.

See Also:
Constant Field Values

NAME_TOGGLEAUTOSIZE

public static final String NAME_TOGGLEAUTOSIZE
Specifies the name for the toggleAutoSize action.

See Also:
Constant Field Values

NAME_TOGGLECELLSIZEABLE

public static final String NAME_TOGGLECELLSIZEABLE
Specifies the name for the toggleCellSizeable action.

See Also:
Constant Field Values

NAME_TOGGLECONSTRAINED

public static final String NAME_TOGGLECONSTRAINED
Specifies the name for the toggleConstrained action.

See Also:
Constant Field Values

NAME_SWITCHLOCKWIDTH

public static final String NAME_SWITCHLOCKWIDTH
Specifies the name for the switchLockWidth action.

See Also:
Constant Field Values

NAME_SWITCHLOCKHEIGHT

public static final String NAME_SWITCHLOCKHEIGHT
Specifies the name for the switchLockHeight action.

See Also:
Constant Field Values

NAME_SWITCHSHAPERECTANGLE

public static final String NAME_SWITCHSHAPERECTANGLE
Specifies the name for the switchShapeRectangle action.

See Also:
Constant Field Values

NAME_SWITCHSHAPEROUNDED

public static final String NAME_SWITCHSHAPEROUNDED
Specifies the name for the switchShapeRounded action.

See Also:
Constant Field Values

NAME_SWITCHSHAPECIRCLE

public static final String NAME_SWITCHSHAPECIRCLE
Specifies the name for the switchShapeCircle action.

See Also:
Constant Field Values

NAME_SWITCHSHAPEDIAMOND

public static final String NAME_SWITCHSHAPEDIAMOND
Specifies the name for the switchShapeDiamond action.

See Also:
Constant Field Values

NAME_SWITCHSHAPETRIANGLE

public static final String NAME_SWITCHSHAPETRIANGLE
Specifies the name for the switchShapeTriangle action.

See Also:
Constant Field Values

NAME_SWITCHSHAPECYLINDER

public static final String NAME_SWITCHSHAPECYLINDER
Specifies the name for the switchShapeCylinder action.

See Also:
Constant Field Values

NAME_CELLIMAGE

public static final String NAME_CELLIMAGE
Specifies the name for the cellImage action.

See Also:
Constant Field Values

NAME_CELLIMAGEURL

public static final String NAME_CELLIMAGEURL
Specifies the name for the cellImageURL action.

See Also:
Constant Field Values

NAME_CLEARCELLIMAGE

public static final String NAME_CLEARCELLIMAGE
Specifies the name for the clearCellImage action.

See Also:
Constant Field Values

NAME_TOGGLESTRETCHCELLIMAGE

public static final String NAME_TOGGLESTRETCHCELLIMAGE
Specifies the name for the toggleStretchCellImage action.

See Also:
Constant Field Values

NAME_CELLBACKGROUNDCOLOR

public static final String NAME_CELLBACKGROUNDCOLOR
Specifies the name for the cellBackgroundColor action.

See Also:
Constant Field Values

NAME_CELLGRADIENTCOLOR

public static final String NAME_CELLGRADIENTCOLOR
Specifies the name for the cellGradientColor action.

See Also:
Constant Field Values

NAME_TOGGLECELLOPAQUE

public static final String NAME_TOGGLECELLOPAQUE
Specifies the name for the toggleCellOpaque action.

See Also:
Constant Field Values

NAME_TOGGLEGROUPOPAQUE

public static final String NAME_TOGGLEGROUPOPAQUE
Specifies the name for the toggleGroupOpaque action.

See Also:
Constant Field Values

NAME_CELLINSET

public static final String NAME_CELLINSET
Specifies the name for the cellInset action.

See Also:
Constant Field Values

NAME_CELLBORDERCOLOR

public static final String NAME_CELLBORDERCOLOR
Specifies the name for the cellBorderColor action.

See Also:
Constant Field Values

NAME_CELLBORDERWIDTH

public static final String NAME_CELLBORDERWIDTH
Specifies the name for the cellBorderWidth action.

See Also:
Constant Field Values

NAME_CLEARCELLBORDER

public static final String NAME_CLEARCELLBORDER
Specifies the name for the clearCellBorder action.

See Also:
Constant Field Values

NAME_FONT

public static final String NAME_FONT
Specifies the name for the font action.

See Also:
Constant Field Values

NAME_FONTCOLOR

public static final String NAME_FONTCOLOR
Specifies the name for the fontColor action.

See Also:
Constant Field Values

NAME_FONTSIZE

public static final String NAME_FONTSIZE
Specifies the name for the fontSize action.

See Also:
Constant Field Values

NAME_FONTPLAIN

public static final String NAME_FONTPLAIN
Specifies the name for the fontPlain action.

See Also:
Constant Field Values

NAME_FONTBOLD

public static final String NAME_FONTBOLD
Specifies the name for the fontBold action.

See Also:
Constant Field Values

NAME_FONTITALIC

public static final String NAME_FONTITALIC
Specifies the name for the fontItalic action.

See Also:
Constant Field Values

NAME_FONTUNDERLINE

public static final String NAME_FONTUNDERLINE
Specifies the name for the fontUnderline action.

See Also:
Constant Field Values

NAME_TOGGLECELLEDITABLE

public static final String NAME_TOGGLECELLEDITABLE
Specifies the name for the toggleCellEditable action.

See Also:
Constant Field Values

NAME_SWITCHLABELTOP

public static final String NAME_SWITCHLABELTOP
Specifies the name for the switchLabelTop action.

See Also:
Constant Field Values

NAME_SWITCHLABELMIDDLE

public static final String NAME_SWITCHLABELMIDDLE
Specifies the name for the switchLabelMiddle action.

See Also:
Constant Field Values

NAME_SWITCHLABELBOTTOM

public static final String NAME_SWITCHLABELBOTTOM
Specifies the name for the switchLabelBottom action.

See Also:
Constant Field Values

NAME_SWITCHLABELLEFT

public static final String NAME_SWITCHLABELLEFT
Specifies the name for the switchLabelLeft action.

See Also:
Constant Field Values

NAME_SWITCHLABELCENTER

public static final String NAME_SWITCHLABELCENTER
Specifies the name for the switchLabelCenter action.

See Also:
Constant Field Values

NAME_SWITCHLABELRIGHT

public static final String NAME_SWITCHLABELRIGHT
Specifies the name for the switchLabelRight action.

See Also:
Constant Field Values

NAME_SWITCHALIGNTOP

public static final String NAME_SWITCHALIGNTOP
Specifies the name for the switchAlignTop action.

See Also:
Constant Field Values

NAME_SWITCHALIGNMIDDLE

public static final String NAME_SWITCHALIGNMIDDLE
Specifies the name for the switchAlignMiddle action.

See Also:
Constant Field Values

NAME_SWITCHALIGNBOTTOM

public static final String NAME_SWITCHALIGNBOTTOM
Specifies the name for the switchAlignBottom action.

See Also:
Constant Field Values

NAME_SWITCHALIGNLEFT

public static final String NAME_SWITCHALIGNLEFT
Specifies the name for the switchAlignLeft action.

See Also:
Constant Field Values

NAME_SWITCHALIGNCENTER

public static final String NAME_SWITCHALIGNCENTER
Specifies the name for the switchAlignCenter action.

See Also:
Constant Field Values

NAME_SWITCHALIGNRIGHT

public static final String NAME_SWITCHALIGNRIGHT
Specifies the name for the switchAlignRight action.

See Also:
Constant Field Values

NAME_LINEWIDTH

public static final String NAME_LINEWIDTH
Specifies the name for the lineWidth action.

See Also:
Constant Field Values

NAME_LINECOLOR

public static final String NAME_LINECOLOR
Specifies the name for the lineColor action.

See Also:
Constant Field Values

NAME_DASHPATTERN

public static final String NAME_DASHPATTERN
Specifies the name for the dashPattern action.

See Also:
Constant Field Values

NAME_DASHOFFSET

public static final String NAME_DASHOFFSET
Specifies the name for the dashOffset action.

See Also:
Constant Field Values

NAME_SWITCHSTYLEORTHOGONAL

public static final String NAME_SWITCHSTYLEORTHOGONAL
Specifies the name for the switchStyleOrthogonal action.

See Also:
Constant Field Values

NAME_SWITCHSTYLESPLINE

public static final String NAME_SWITCHSTYLESPLINE
Specifies the name for the switchStyleSpline action.

See Also:
Constant Field Values

NAME_SWITCHSTYLEBEZIER

public static final String NAME_SWITCHSTYLEBEZIER
Specifies the name for the switchStyleBezier action.

See Also:
Constant Field Values

NAME_TOGGLEEDGEBENDABLE

public static final String NAME_TOGGLEEDGEBENDABLE
Specifies the name for the toggleEdgeBendable action.

See Also:
Constant Field Values

NAME_TOGGLELABELALONGEDGE

public static final String NAME_TOGGLELABELALONGEDGE
Specifies the name for the toggleLabelAlongEdge action.

See Also:
Constant Field Values

NAME_SWITCHROUTINGNONE

public static final String NAME_SWITCHROUTINGNONE
Specifies the name for the switchRoutingNone action.

See Also:
Constant Field Values

NAME_SWITCHROUTINGSIMPLE

public static final String NAME_SWITCHROUTINGSIMPLE
Specifies the name for the switchRoutingSimple action.

See Also:
Constant Field Values

NAME_SWITCHROUTINGPARALLEL

public static final String NAME_SWITCHROUTINGPARALLEL
Specifies the name for the switchRoutingParallel action.

See Also:
Constant Field Values

NAME_SWITCHROUTINGPARALLELSPLINE

public static final String NAME_SWITCHROUTINGPARALLELSPLINE
Specifies the name for the switchRoutingParallelSpline action.

See Also:
Constant Field Values

NAME_BEGINSIZE

public static final String NAME_BEGINSIZE
Specifies the name for the beginSize action.

See Also:
Constant Field Values

NAME_CLEARBEGIN

public static final String NAME_CLEARBEGIN
Specifies the name for the clearBegin action.

See Also:
Constant Field Values

NAME_ENDSIZE

public static final String NAME_ENDSIZE
Specifies the name for the endSize action.

See Also:
Constant Field Values

NAME_CLEAREND

public static final String NAME_CLEAREND
Specifies the name for the clearEnd action.

See Also:
Constant Field Values

NAME_TOGGLECONNECTABLE

public static final String NAME_TOGGLECONNECTABLE
Specifies the name for the toggleConnectable action.

See Also:
Constant Field Values

NAME_TOGGLEDISCONNECTABLE

public static final String NAME_TOGGLEDISCONNECTABLE
Specifies the name for the toggleDisconnectable action.

See Also:
Constant Field Values

lastDirectory

protected File lastDirectory
Holds the last directory for file operations.

Constructor Detail

JGraphpadFormatAction

public JGraphpadFormatAction(String name)
Constructs a new format action for the specified name. If the action name starts with toggle 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.

fontDialog

public Font fontDialog(Component component,
                       String title,
                       Font font)
Displays a font dialog using JGraphpadDialogs.fontDialog(Component, String). This hook is overridden in the l2f plugin to provide a better dialog.

Parameters:
component - The parent component for the dialog to be displayed.
title - The title of the dialog to be displayed.
font - The default font to use in the dialog.
Returns:
Returns the selected font.

setRouting

protected void setRouting(org.jgraph.JGraph graph,
                          org.jgraph.graph.Edge.Routing routing)
Changes the font style on the specified component to style, which may be one of Font.BOLD, Font.ITALIC or FONT_UNDERLINE. This implementation changes the style of either the selection cells in JGraph or the selection text in JTextPane.

Parameters:
graph - The graph to change the font in.
routing - The routing to use.

doSetDashPattern

protected void doSetDashPattern(org.jgraph.JGraph graph)
Changes the dash pattern in the selection edges of the specified graph by displaying a dialog to enter a dash sequence of the form [n[,n[,n]*]] where n is a number.

Parameters:
graph - The graph to change the dash pattern in.

doSetFont

protected void doSetFont(Component component,
                         Object change,
                         boolean plain,
                         int style,
                         float size)
                  throws BadLocationException
Changes the font on the specified component to change, which may be either a Font or Color object, changing the respective font property of either the selection cells in JGraph or the selection text in JTextPane.

Parameters:
component - The component to change the font in.
change - The value to change the font to.
Throws:
BadLocationException

doSetHorizontalAlignment

protected void doSetHorizontalAlignment(Component component,
                                        int align)
Changes the horizontal alignment on the specified component to align, which may be one of SwingConstants.LEFT, SwingConstants.CENTER or SwingConstants.RIGHT. This implementation changes the horizontal aligment of either the selection cells in JGraph or the selection text in JTextPane, however, the alignment in textpanes is not persisted due to a bug in Swing (so end users should align cells, not selection rich text).

Parameters:
component - The component to change the font in.
align - The horizontal alignment to use.

doAskIntAttribute

protected void doAskIntAttribute(org.jgraph.JGraph graph,
                                 String key,
                                 int defaultValue)
Displays a dialog to ask for a number and uses the number to set the attribute under key for the selected cells in graph. The default value is used in the dialog.

Parameters:
graph - The graph to perform the operation in.
key - The key of the attribute to be changed.
defaultValue - The default value for the number dialog.

doAskFloatAttribute

protected void doAskFloatAttribute(org.jgraph.JGraph graph,
                                   String key,
                                   float defaultValue)
Displays a dialog to ask for a number and uses the number to set the attribute under key for the selected cells in graph. The default value is used in the dialog.

Parameters:
graph - The graph to perform the operation in.
key - The key of the attribute to be changed.
defaultValue - The default value for the number dialog.

doAskColorAttribute

protected void doAskColorAttribute(org.jgraph.JGraph graph,
                                   String key)
Shortcut method that invokes doAskColorAttribute(JGraph, String, boolean) with setOpaque = false.

Parameters:
graph - The graph to perform the operation in.
key - The key of the attribute to be changed.

doAskColorAttribute

protected void doAskColorAttribute(org.jgraph.JGraph graph,
                                   String key,
                                   boolean setOpaque)
Displays a dialog to ask for a color and uses the color to set the attribute under key for the selected cells in graph. If setOpaque is true then the opaque attribute will be set to true.

Parameters:
graph - The graph to perform the operation in.
key - The key of the attribute to be changed.
setOpaque - Whether to make the affected cells opaque.

doAskImageAttribute

protected void doAskImageAttribute(org.jgraph.JGraph graph,
                                   String key,
                                   boolean urlDialog)
                            throws MalformedURLException,
                                   FileNotFoundException,
                                   IOException
Displays a dialog to ask for a file or URL depending on urlDialog and uses the filename to set the image attribute under key for the selected cells in graph.

Parameters:
graph - The graph to perform the operation in.
key - The key of the attribute to be changed.
urlDialog - Whether to ask for an URL instead of a filename.
Throws:
MalformedURLException
FileNotFoundException
IOException

doToggleAttribute

protected void doToggleAttribute(org.jgraph.JGraph graph,
                                 String key,
                                 boolean defaultValue)
Displays a dialog to ask for a file or URL depending on urlDialog and uses the filename to set the image attribute under key for the selected cells in graph.

Parameters:
graph - The graph to perform the operation in.
key - The key of the attribute to be changed.
defaultValue - The default value to use.

setAttribute

protected void setAttribute(org.jgraph.JGraph graph,
                            String key,
                            Object value)
Sets the value of the attribute under key to value for the selection cells in graph.

Parameters:
graph - The graph to perform the operation in.
key - The name of the attribute to set.
value - The value of the attribute to set.

setAttributes

protected void setAttributes(org.jgraph.JGraph graph,
                             String[] keys,
                             Object[] values,
                             boolean all)
Sets the value of the attributes under keys to values for the selection or all cells in graph depending on all. For each key[i] the corresponding value[i] is assigned. If value[i] is null then this will add a GraphConstants.REMOVEATTRIBUTES entry to the nested map and remove the corresponding key. Note: Use only one value of null per array of values, as previous GraphConstants.REMOVEATTRIBUTES will be overwritten by later ones.

Parameters:
graph - The graph to perform the operation in.
keys - The names of the attributes to set.
values - The values of the attributes to set.
all - Whether to apply the change to all or only the selection cells.

getBooleanAttribute

public static boolean getBooleanAttribute(org.jgraph.JGraph graph,
                                          String key,
                                          boolean defaultValue)
Returns the value of the attribute under key for the first selected cell in the specified graph as a boolean or defaultValue if no such attribute can be found.

Parameters:
graph - The graph to perform the operation in.
key - The name of the attribute to look for.
defaultValue - The default value to use.
Returns:
Returns the value of the key attribute.

getIntAttribute

public static int getIntAttribute(org.jgraph.JGraph graph,
                                  String key,
                                  int defaultValue)
Returns the value of the attribute under key for the first selected cell in the specified graph as an int or defaultValue if no such attribute can be found.

Parameters:
graph - The graph to perform the operation in.
key - The name of the attribute to look for.
defaultValue - The default value to use.
Returns:
Returns the value of the key attribute.

getAttribute

public static Object getAttribute(org.jgraph.JGraph graph,
                                  String key)
Returns the value of the attribute under key for the first selected cell in the specified graph as an Object or null if no such attribute exists.

Parameters:
graph - The graph to perform the operation in.
key - The name of the attribute to look for.
Returns:
Returns the value of the key attribute.

JGraphpad Pro
v6.0.5.0


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