|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.swing.AbstractAction
com.jgraph.editor.JGraphEditorAction
com.jgraph.pad.action.JGraphpadFormatAction
Implements all actions of the format menu.
| 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 |
protected static int FONT_UNDERLINE
public static final String NAME_TOGGLECELLMOVEABLE
toggleCellMoveable action.
public static final String NAME_TOGGLEGROUPREPOSITION
toggleCellMoveable action.
public static final String NAME_SWITCHLOCKX
switchLockX action.
public static final String NAME_SWITCHLOCKY
switchLockX action.
public static final String NAME_RESIZE
resize action.
public static final String NAME_TOGGLEAUTOSIZE
toggleAutoSize action.
public static final String NAME_TOGGLECELLSIZEABLE
toggleCellSizeable action.
public static final String NAME_TOGGLECONSTRAINED
toggleConstrained action.
public static final String NAME_SWITCHLOCKWIDTH
switchLockWidth action.
public static final String NAME_SWITCHLOCKHEIGHT
switchLockHeight action.
public static final String NAME_SWITCHSHAPERECTANGLE
switchShapeRectangle action.
public static final String NAME_SWITCHSHAPEROUNDED
switchShapeRounded action.
public static final String NAME_SWITCHSHAPECIRCLE
switchShapeCircle action.
public static final String NAME_SWITCHSHAPEDIAMOND
switchShapeDiamond action.
public static final String NAME_SWITCHSHAPETRIANGLE
switchShapeTriangle action.
public static final String NAME_SWITCHSHAPECYLINDER
switchShapeCylinder action.
public static final String NAME_CELLIMAGE
cellImage action.
public static final String NAME_CELLIMAGEURL
cellImageURL action.
public static final String NAME_CLEARCELLIMAGE
clearCellImage action.
public static final String NAME_TOGGLESTRETCHCELLIMAGE
toggleStretchCellImage action.
public static final String NAME_CELLBACKGROUNDCOLOR
cellBackgroundColor action.
public static final String NAME_CELLGRADIENTCOLOR
cellGradientColor action.
public static final String NAME_TOGGLECELLOPAQUE
toggleCellOpaque action.
public static final String NAME_TOGGLEGROUPOPAQUE
toggleGroupOpaque action.
public static final String NAME_CELLINSET
cellInset action.
public static final String NAME_CELLBORDERCOLOR
cellBorderColor action.
public static final String NAME_CELLBORDERWIDTH
cellBorderWidth action.
public static final String NAME_CLEARCELLBORDER
clearCellBorder action.
public static final String NAME_FONT
font action.
public static final String NAME_FONTCOLOR
fontColor action.
public static final String NAME_FONTSIZE
fontSize action.
public static final String NAME_FONTPLAIN
fontPlain action.
public static final String NAME_FONTBOLD
fontBold action.
public static final String NAME_FONTITALIC
fontItalic action.
public static final String NAME_FONTUNDERLINE
fontUnderline action.
public static final String NAME_TOGGLECELLEDITABLE
toggleCellEditable action.
public static final String NAME_SWITCHLABELTOP
switchLabelTop action.
public static final String NAME_SWITCHLABELMIDDLE
switchLabelMiddle action.
public static final String NAME_SWITCHLABELBOTTOM
switchLabelBottom action.
public static final String NAME_SWITCHLABELLEFT
switchLabelLeft action.
public static final String NAME_SWITCHLABELCENTER
switchLabelCenter action.
public static final String NAME_SWITCHLABELRIGHT
switchLabelRight action.
public static final String NAME_SWITCHALIGNTOP
switchAlignTop action.
public static final String NAME_SWITCHALIGNMIDDLE
switchAlignMiddle action.
public static final String NAME_SWITCHALIGNBOTTOM
switchAlignBottom action.
public static final String NAME_SWITCHALIGNLEFT
switchAlignLeft action.
public static final String NAME_SWITCHALIGNCENTER
switchAlignCenter action.
public static final String NAME_SWITCHALIGNRIGHT
switchAlignRight action.
public static final String NAME_LINEWIDTH
lineWidth action.
public static final String NAME_LINECOLOR
lineColor action.
public static final String NAME_DASHPATTERN
dashPattern action.
public static final String NAME_DASHOFFSET
dashOffset action.
public static final String NAME_SWITCHSTYLEORTHOGONAL
switchStyleOrthogonal action.
public static final String NAME_SWITCHSTYLESPLINE
switchStyleSpline action.
public static final String NAME_SWITCHSTYLEBEZIER
switchStyleBezier action.
public static final String NAME_TOGGLEEDGEBENDABLE
toggleEdgeBendable action.
public static final String NAME_TOGGLELABELALONGEDGE
toggleLabelAlongEdge action.
public static final String NAME_SWITCHROUTINGNONE
switchRoutingNone action.
public static final String NAME_SWITCHROUTINGSIMPLE
switchRoutingSimple action.
public static final String NAME_SWITCHROUTINGPARALLEL
switchRoutingParallel action.
public static final String NAME_SWITCHROUTINGPARALLELSPLINE
switchRoutingParallelSpline
action.
public static final String NAME_BEGINSIZE
beginSize action.
public static final String NAME_CLEARBEGIN
clearBegin action.
public static final String NAME_ENDSIZE
endSize action.
public static final String NAME_CLEAREND
clearEnd action.
public static final String NAME_TOGGLECONNECTABLE
toggleConnectable action.
public static final String NAME_TOGGLEDISCONNECTABLE
toggleDisconnectable action.
protected File lastDirectory
| Constructor Detail |
public JGraphpadFormatAction(String name)
toggle or switch then the
action is configured to be a toggle action.
name - The name of the action to be created.| Method Detail |
public void actionPerformed(ActionEvent event)
event - The object that describes the event.
public Font fontDialog(Component component,
String title,
Font font)
JGraphpadDialogs.fontDialog(Component, String). This hook is
overridden in the l2f plugin to provide a better dialog.
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.
protected void setRouting(org.jgraph.JGraph graph,
org.jgraph.graph.Edge.Routing routing)
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.
graph - The graph to change the font in.routing - The routing to use.protected void doSetDashPattern(org.jgraph.JGraph graph)
[n[,n[,n]*]] where n is a number.
graph - The graph to change the dash pattern in.
protected void doSetFont(Component component,
Object change,
boolean plain,
int style,
float size)
throws BadLocationException
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.
component - The component to change the font in.change - The value to change the font to.
BadLocationException
protected void doSetHorizontalAlignment(Component component,
int align)
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).
component - The component to change the font in.align - The horizontal alignment to use.
protected void doAskIntAttribute(org.jgraph.JGraph graph,
String key,
int defaultValue)
key for the selected cells in
graph. The default value is used in the dialog.
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.
protected void doAskFloatAttribute(org.jgraph.JGraph graph,
String key,
float defaultValue)
key for the selected cells in
graph. The default value is used in the dialog.
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.
protected void doAskColorAttribute(org.jgraph.JGraph graph,
String key)
doAskColorAttribute(JGraph, String, boolean) with setOpaque =
false.
graph - The graph to perform the operation in.key - The key of the attribute to be changed.
protected void doAskColorAttribute(org.jgraph.JGraph graph,
String key,
boolean setOpaque)
key for the selected cells in
graph. If setOpaque is true
then the opaque attribute will be set to true.
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.
protected void doAskImageAttribute(org.jgraph.JGraph graph,
String key,
boolean urlDialog)
throws MalformedURLException,
FileNotFoundException,
IOException
urlDialog and uses the filename to set the image attribute
under key for the selected cells in graph.
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.
MalformedURLException
FileNotFoundException
IOException
protected void doToggleAttribute(org.jgraph.JGraph graph,
String key,
boolean defaultValue)
urlDialog and uses the filename to set the image attribute
under key for the selected cells in graph.
graph - The graph to perform the operation in.key - The key of the attribute to be changed.defaultValue - The default value to use.
protected void setAttribute(org.jgraph.JGraph graph,
String key,
Object value)
key to
value for the selection cells in graph.
graph - The graph to perform the operation in.key - The name of the attribute to set.value - The value of the attribute to set.
protected void setAttributes(org.jgraph.JGraph graph,
String[] keys,
Object[] values,
boolean all)
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.
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.
public static boolean getBooleanAttribute(org.jgraph.JGraph graph,
String key,
boolean defaultValue)
key for the first
selected cell in the specified graph as a boolean or
defaultValue if no such attribute can be found.
graph - The graph to perform the operation in.key - The name of the attribute to look for.defaultValue - The default value to use.
key attribute.
public static int getIntAttribute(org.jgraph.JGraph graph,
String key,
int defaultValue)
key for the first
selected cell in the specified graph as an int or
defaultValue if no such attribute can be found.
graph - The graph to perform the operation in.key - The name of the attribute to look for.defaultValue - The default value to use.
key attribute.
public static Object getAttribute(org.jgraph.JGraph graph,
String key)
key for the first
selected cell in the specified graph as an Object or null if no such
attribute exists.
graph - The graph to perform the operation in.key - The name of the attribute to look for.
key attribute.
|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||