Package org.jgraph.graph
Class GraphConstants
java.lang.Object
org.jgraph.graph.GraphConstants
A collection of well known or common attribute keys and methods to apply to
an Map to get/set the properties in a typesafe manner. The following
attributes and methods need special attention: removeAttributes, removeAll
and value. RemoveAttributes and RemoveAll are not stored in a map, but remove
the specified entries. The value entry of a propertyMap is always in sync
with the userObject of a GraphCell. The isMoveable, isAutoSize and isSizeable
are used indepedently (see
http://sourceforge.net/forum/forum.php?thread_id=770111invalid input: '&forum_id'=140880)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Key for theabsoluteX
attribute.static final String
Key for theabsoluteY
attribute.static final int
Represents a circle decoration for the beginning or ending of edges.static final int
Represents a classic arrow decoration for the beginning or ending of edges.static final int
Represents a diamond decoration for the beginning or ending of edges.static final int
Represents a double line decoration for the beginning or ending of edges.static final int
Represents a line decoration for the beginning or ending of edges.static final int
Represents no decoration for the beginning or ending of edges.static final int
Represents a simple arrow decoration for the beginning or ending of edges.static final int
Represents a technical arrow decoration for the beginning or ending of edges.static final String
Key for theautosize
attribute.static final String
Key for thebackground
attribute.static final String
Key for thebeginFill
attribute.static final String
Key for thebeginSize
attribute.static final String
Key for thebendable
attribute.static final String
Key for theborder
attribute.static final String
Key for thebordercolor
attribute.static final String
Key for thebounds
attribute.static final String
Key for thechildrenSelectable
attribute.static final String
Key for theconnectable
attribute.static final String
Key for theconstrained
attribute.protected static float[]
Global Stroke To Highlight Selectionstatic final String
Key for thedashOffset
attribute.static final String
Key for thedashPattern
attribute.static int
Default decoration size.static Font
Default font is derived from UIManager.getDefaults().getFont("Label.font")static int
Default inset size.static final String
Key for thedisconnectable
attribute.static final String
Key for theeditable
attribute.static final String
Key for theendFill
attribute.static final String
Key for theendSize
attribute.static final String
Key for thelabelEnabled
attribute.static final String
Key for theextraLabelPositions
attribute.static final String
Key for theextraLabels
attribute.static final String
Key for thefont
attribute.static final String
Key for theforeground
attribute.static final String
Key for thegradient
attribute.static final String
Key for thegroupOpaque
attribute.static final String
Key for thehorizontalAlignment
attribute.static final String
Key for thehorizontalTextPosition
attribute.static final String
Key for theicon
attribute.static final String
Key for theinset
attribute.static final String
Key for thelabelAlongEdge
attribute.static final String
Key for thelabelEnabled
attribute.static final String
Key for thelabelposition
attribute.static final String
Key for thelineBegin
attribute.static final String
Key for thelinecolor
attribute.static final String
Key for thelineEnd
attribute.static final String
Key for thelineStyle
attribute.static final String
Key for thelinewidth
attribute.static final String
Key for thelink
attribute.static final String
Key for themoveable
attribute.static final String
Key for themoveableAxis
attribute.static final String
Key for thechildrenSelectable
attribute.static final String
Key for theoffset
attribute.static final String
Key for theopaque
attribute.static final int
100 percent unit for relative positioning.static final String
Key for thepoints
attribute.static final String
Key for theremoveAll
attribute.static final String
Key for theremoveAttributes
attribute.static final String
Key for thereplaceAttributes
attribute.static final String
Key for theresize
attribute.static final String
Key for therouting
attribute.static Edge.Routing
The default routing that deals with loops.static final Edge.Routing
A simple routing.static final String
Key for theselectable
attribute.static Stroke
static final String
Key for thesize
attribute.static final String
Key for thesizeable
attribute.static final String
Key for thesizeableAxis
attribute.static final int
Represents a bezier line stylestatic final int
Represents an orthogonal line stylestatic final int
Represents an spline line stylestatic final String
Key for thevalue
attribute.static final String
Key for theverticalAlignment
attribute.static final String
Key for theverticalTextPosition
attribute.static final int
Represents an bezier line stylestatic final int
Represents an bezier line style -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map
createAttributes
(Object[] cells, Object[] keys, Object[] values) Returns a new (nested) map, from cells to attribute maps.static Map
createAttributes
(Object[] cells, Object key, Object value) Overloaded method that passes arguments on as arraysstatic Map
createAttributes
(Object[] elements, CellMapper cm) Returns a new map, from cells to property maps.static Map
createAttributes
(Object cell, Object key, Object value) Overloaded method that passes arguments on as arraysstatic Map
createAttributesFromModel
(Object[] elements, GraphModel model) static final Color
getBackground
(Map map) Returns the background attribute from the specified map.static final int
getBeginSize
(Map map) Returns the beginsize attribute from the specified map.static final Border
Returns the border attribute from the specified map.static final Color
getBorderColor
(Map map) Returns the bordercolor attribute from the specified map.static final Rectangle2D
Returns the bounds attribute from the specified map.static final float
getDashOffset
(Map map) Returns the dashoffset attribute from the specified map.static final float[]
getDashPattern
(Map map) Returns the dashpattern attribute from the specified map.static final int
getEndSize
(Map map) Returns the endsize attribute from the specified map.static final Point2D[]
Returns the extralabelpositions attribute from the specified map.static final Object[]
getExtraLabels
(Map map) Returns the additional label objects from the specified map.Extra labels only work with edges currently.static Font
Returns the font for the specified attribute map.static final Color
getForeground
(Map map) Returns the foreground attribute from the specified map.static final Color
getGradientColor
(Map map) Returns the gradientcolor attribute from the specified map.static final int
Returns the horizontalalignment attribute from the specified map.static final int
Returns the horizontaltextposition attribute from the specified map.static final Icon
Returns the icon attribute from the specified map.static final int
Returns the inset attribute from the specified map.static final Point2D
getLabelPosition
(Map map) Returns the label position attribute from the specified map.static final int
getLineBegin
(Map map) Returns the LINEBEGIN attribute from the specified map.static final Color
getLineColor
(Map map) Returns the linecolor attribute from the specified map.static final int
getLineEnd
(Map map) Returns the LINEEND attribute from the specified map.static final int
getLineStyle
(Map map) Returns the linestyle attribute from the specified map.static final float
getLineWidth
(Map map) Returns the linewidth attribute from the specified map.static String
Returns the link for the specified attribute map.static final int
getMoveableAxis
(Map map) Returns the moveableaxis attribute from the specified map.static final Point2D
Returns the offset attribute from the specified map.static final List
Returns the points attribute from the specified map.static final Object[]
getRemoveAttributes
(Map map) Returns the attribute marked as for removal in the specified map.static final Edge.Routing
getRouting
(Map map) Returns the routing attribute from the specified map.static Edge.Routing
static Edge.Routing
static final Dimension
Returns the size attribute from the specified map.static final int
getSizeableAxis
(Map map) Returns the sizeableAxis attribute from the specified map.static final Object
Returns the value attribute from the specified map.static final int
getVerticalAlignment
(Map map) Returns the verticalalignment attribute from the specified map.static final int
Returns the verticaltextposition attribute from the specified map.static final boolean
isAbsoluteX
(Map map) Returns the absolutex attribute from the specified map.static final boolean
isAbsoluteY
(Map map) Returns the absolutey attribute from the specified map.static final boolean
isAutoSize
(Map map) Returns the autosize attribute from the specified map.static final boolean
isBeginFill
(Map map) Returns the beginfill attribute from the specified map.static final boolean
isBendable
(Map map) Returns the bendable attribute from the specified map.static final boolean
isChildrenSelectable
(Map map) Returns the childrenselectable attribute from the specified map.static final boolean
isConnectable
(Map map) Returns the connectable attribute from the specified map.static final boolean
isConstrained
(Map map) Returns the constrained attribute from the specified map.static final boolean
isDisconnectable
(Map map) Returns the disconnectable attribute from the specified map.static final boolean
isEditable
(Map map) Returns the editable attribute from the specified map.static final boolean
Returns the endfill attribute from the specified map.static boolean
isExactSegmentLabel
(Map map) Returns whether the exact segment is worked out for placement of labels along edges for the specified cell.static final boolean
isGroupOpaque
(Map map) Returns the opaque attribute from the specified map.static final boolean
isLabelAlongEdge
(Map map) Returns the true if the label should be painted along the edge.static boolean
isLabelEnabled
(Map map) Returns whether the label is enabled for the specified cell.static final boolean
isMoveable
(Map map) Returns the moveable attribute from the specified map.static final boolean
Returns the opaque attribute from the specified map.static final boolean
isRemoveAll
(Map map) Returns the removeall attribute from the specified map.static final boolean
Returns the resize attribute from the specified map.static final boolean
isSelectable
(Map map) Returns the selectable attribute from the specified map.static final boolean
isSizeable
(Map map) Returns the sizeable attribute from the specified map.static Map
Merges the specified nested maps by adding all attributes in the change to the attributes for the cell in target, if the cell does not exist in target, then a new entry is added with all attributes from change.static Map
replaceKeys
(Map keyMap, Map map) Replace the keys inmap
usingkeyMapinvalid input: '<'/code, which maps from old to new keys.
static final void
setAbsolute
(Map map, boolean flag) Sets the absolute attributes in the specified map to the specified value.static final void
setAbsoluteX
(Map map, boolean flag) Sets the absolutex attribute in the specified map to the specified value.static final void
setAbsoluteY
(Map map, boolean flag) Sets the absolutey attribute in the specified map to the specified value.static final void
setAutoSize
(Map map, boolean flag) Sets the autosize attribute in the specified map to the specified value.static final void
setBackground
(Map map, Color value) Sets the background attribute in the specified map to the specified value.static final void
setBeginFill
(Map map, boolean flag) Sets the beginfill attribute in the specified map to the specified value.static final void
setBeginSize
(Map map, int style) Sets the beginsize attribute in the specified map to the specified value.static final void
setBendable
(Map map, boolean flag) Sets the bendable attribute in the specified map to the specified value.static final void
Sets the border attribute in the specified map to the specified value.static final void
setBorderColor
(Map map, Color value) Sets the bordercolor attribute in the specified map to the specified value.static final void
setBounds
(Map map, Rectangle2D bounds) Sets the bounds attribute in the specified map to the specified value.static final void
setChildrenSelectable
(Map map, boolean flag) Sets the childrenselectable attribute in the specified map to the specified value.static final void
setConnectable
(Map map, boolean flag) Sets the connectable attribute in the specified map to the specified value.static final void
setConstrained
(Map map, boolean flag) Sets the constrained attribute in the specified map to the specified value.static final void
setDashOffset
(Map map, float value) Sets the dashoffset attribute in the specified map to the specified value.static final void
setDashPattern
(Map map, float[] value) Sets the dashpattern attribute in the specified map to the specified value.static final void
setDisconnectable
(Map map, boolean flag) Sets the disconnectable attribute in the specified map to the specified value.static final void
setEditable
(Map map, boolean flag) Sets the editable attribute in the specified map to the specified value.static final void
setEndFill
(Map map, boolean flag) Sets the endfill attribute in the specified map to the specified value.static final void
setEndSize
(Map map, int style) Sets the endsize attribute in the specified map to the specified value.static void
setExactSegmentLabel
(Map map, boolean flag) Sets the exact segment attribute in the specified map to the specified value.static final void
setExtraLabelPositions
(Map map, Point2D[] positions) Sets the labelpositions attribute in the specified map to the specified value.static final void
setExtraLabels
(Map map, Object[] definitions) Sets the array of additional labels.static void
Sets the value attribute in the specified map to the specified font value.static final void
setForeground
(Map map, Color value) Sets the foregrund attribute in the specified map to the specified value.static final void
setGradientColor
(Map map, Color value) Sets the gradientcolor attribute in the specified map to the specified value.static final void
setGroupOpaque
(Map map, boolean flag) Sets the opaque attribute in the specified map to the specified value.static final void
setHorizontalAlignment
(Map map, int alignment) This method set the position of the label in vertex cells, and takes aruguments of type SwingConstants (for JLabel) i.e.static final void
setHorizontalTextPosition
(Map map, int textPosition) This method set the text of a label on vertext cell relative to image.static final void
Sets the icon attribute in the specified map to the specified value.static final void
Sets the inset attribute in the specified map to the specified value.static final void
setLabelAlongEdge
(Map map, boolean flag) Sets if the label should be painted along the edge.static void
setLabelEnabled
(Map map, boolean flag) Sets the label enabled attribute in the specified map to the specified value.static final void
setLabelPosition
(Map map, Point2D position) Sets the label position attribute in the specified map to the specified value.static final void
setLineBegin
(Map map, int style) Sets the LINEBEGIN attribute in the specified map to the specified value.static final void
setLineColor
(Map map, Color value) Sets the linecolor attribute in the specified map to the specified value.static final void
setLineEnd
(Map map, int style) Sets the LINEEND attribute in the specified map to the specified value.static final void
setLineStyle
(Map map, int style) Sets the linestyle attribute in the specified map to the specified value.static final void
setLineWidth
(Map map, float width) Sets the linewidth attribute in the specified map to the specified value.static void
Sets the link attribute in the specified map to the specified value.static final void
setMoveable
(Map map, boolean flag) Sets the moveable attribute in the specified map to the specified value.static final void
setMoveableAxis
(Map map, int axis) Sets the moveableaxis attribute in the specified map to the specified value.static final void
Sets the offset attribute in the specified map to the specified value.static final void
Sets the opaque attribute in the specified map to the specified value.static final void
Sets the points attribute in the specified map to the specified value.static final void
setRemoveAll
(Map map, boolean flag) Sets the removeall attribute in the specified map to the specified value.static final void
setRemoveAttributes
(Map map, Object[] value) Sets specific attributes are being marked for removal @ param map The transport map indicating the attribute removal @ param value The attributes to be removedstatic final void
Sets the resize attribute in the specified map to the specified value.static final void
setRouting
(Map map, Edge.Routing routing) Sets the routing attribute in the specified map to the specified value.static final void
setSelectable
(Map map, boolean flag) Sets the selectable attribute in the specified map to the specified value.static final void
Sets the size attribute in the specified map to the specified value.static final void
setSizeable
(Map map, boolean flag) Sets the sizeable attribute in the specified map to the specified value.static final void
setSizeableAxis
(Map map, int axis) Sets the sizeableAxis attribute in the specified map to the specified value.static final void
Sets the value attribute in the specified map to the specified value.static final void
setVerticalAlignment
(Map map, int alignment) This method set the position of the label in vertex cells, and takes aruguments of type SwingConstants (for JLabel) i.e.static final void
setVerticalTextPosition
(Map map, int textPosition) This method set the text of a label on vertext cell relative to image.
-
Field Details
-
DEFAULTFONT
Default font is derived from UIManager.getDefaults().getFont("Label.font") -
DEFAULTDECORATIONSIZE
public static int DEFAULTDECORATIONSIZEDefault decoration size. Value is 0. -
DEFAULTINSET
public static int DEFAULTINSETDefault inset size. Value is 0. -
PERMILLE
public static final int PERMILLE100 percent unit for relative positioning. Current value is 1000.- See Also:
-
dash
protected static float[] dashGlobal Stroke To Highlight Selection -
SELECTION_STROKE
-
ARROW_NONE
public static final int ARROW_NONERepresents no decoration for the beginning or ending of edges.- See Also:
-
ARROW_CLASSIC
public static final int ARROW_CLASSICRepresents a classic arrow decoration for the beginning or ending of edges.- See Also:
-
ARROW_TECHNICAL
public static final int ARROW_TECHNICALRepresents a technical arrow decoration for the beginning or ending of edges.- See Also:
-
ARROW_SIMPLE
public static final int ARROW_SIMPLERepresents a simple arrow decoration for the beginning or ending of edges.- See Also:
-
ARROW_CIRCLE
public static final int ARROW_CIRCLERepresents a circle decoration for the beginning or ending of edges.- See Also:
-
ARROW_LINE
public static final int ARROW_LINERepresents a line decoration for the beginning or ending of edges.- See Also:
-
ARROW_DOUBLELINE
public static final int ARROW_DOUBLELINERepresents a double line decoration for the beginning or ending of edges.- See Also:
-
ARROW_DIAMOND
public static final int ARROW_DIAMONDRepresents a diamond decoration for the beginning or ending of edges.- See Also:
-
STYLE_ORTHOGONAL
public static final int STYLE_ORTHOGONALRepresents an orthogonal line style- See Also:
-
STYLE_BEZIER
public static final int STYLE_BEZIERRepresents a bezier line style- See Also:
-
STYLE_SPLINE
public static final int STYLE_SPLINERepresents an spline line style- See Also:
-
X_AXIS
public static final int X_AXISRepresents an bezier line style- See Also:
-
Y_AXIS
public static final int Y_AXISRepresents an bezier line style- See Also:
-
ROUTING_DEFAULT
The default routing that deals with loops. This is returned bygetRouting(Map)
if there is no routing assigned. -
ROUTING_SIMPLE
A simple routing. -
SIZEABLEAXIS
Key for thesizeableAxis
attribute. This attribute contains an Integer value representing which axis of a cell may be resized/scaled Constants defined in this class.- See Also:
-
MOVEABLEAXIS
Key for themoveableAxis
attribute. This attribute contains an Integer value indicating along which axis a cell may be moved. Constants defined in this class.- See Also:
-
REPLACEATTRIBUTES
Key for thereplaceAttributes
attribute. This special attribute contains a Boolean instance indicating whether a map of attributes should replace the attributes of the receiving view.- See Also:
-
REMOVEATTRIBUTES
Key for theremoveAttributes
attribute. This special attribute contains a list of attribute-keys which should be removed at the receiving views.- See Also:
-
REMOVEALL
Key for theremoveAll
attribute. This causes the receivers attributes to be replaced by the the map that contains this attribute.- See Also:
-
ICON
Key for theicon
attribute. Use instances of Icon as values for this key.- See Also:
-
FONT
Key for thefont
attribute. Use instances of Font as values for this key.- See Also:
-
OPAQUE
Key for theopaque
attribute. Use instances of Boolean as values for this key.- See Also:
-
GROUPOPAQUE
Key for thegroupOpaque
attribute. Use instances of Boolean as values for this key.- See Also:
-
BORDER
Key for theborder
attribute. Use instances of Border as values for this key. Optionally, you can set the global instance of LineBorder.- See Also:
-
LINECOLOR
Key for thelinecolor
attribute. Use instances of Color as values for this key.- See Also:
-
BORDERCOLOR
Key for thebordercolor
attribute. Use instances of Color as values for this key.- See Also:
-
LINEWIDTH
Key for thelinewidth
attribute. Use instances of Float as values for this key.- See Also:
-
FOREGROUND
Key for theforeground
attribute. Use instances of Color as values for this key.- See Also:
-
BACKGROUND
Key for thebackground
attribute. Use instances of Color as values for this key.- See Also:
-
GRADIENTCOLOR
Key for thegradient
attribute. Use instances of Color as values for this key.- See Also:
-
VERTICAL_ALIGNMENT
Key for theverticalAlignment
attribute. Use instances of Integer as values for this key. Constants defined in JLabel class. This key value pair is for placment of label on vertex cell. Valid values would be JLabel.TOP, JLabel.CENTER, JLABEL.BOTTOM- See Also:
-
HORIZONTAL_ALIGNMENT
Key for thehorizontalAlignment
attribute. Use instances of Integer as values for this key. Constants defined in JLabel class. This Key/Value pair is for placment of label on vertex cell. Valid values would be JLabel.LEFT, JLabel.CENTER, JLabel.RIGHT- See Also:
-
VERTICAL_TEXT_POSITION
Key for theverticalTextPosition
attribute. Use instances of Integer as values for this key. Constants defined in JLabel class. This Key/Value pair affects text postion of label on vertex cell relative to image, the value is of type SwingConstant.- See Also:
-
HORIZONTAL_TEXT_POSITION
Key for thehorizontalTextPosition
attribute. Use instances of Integer as values for this key. Constants defined in JLabel class. This Key/Value pair affects text postion of label on vertex cell relative to image, the value is of type SwingConstant.- See Also:
-
DASHPATTERN
Key for thedashPattern
attribute. Use instances of float[] as values for this key.- See Also:
-
DASHOFFSET
Key for thedashOffset
attribute. Use instances of float as values for this key.- See Also:
-
LINESTYLE
Key for thelineStyle
attribute. Use instances of Integer as values for this key. Constants defined in this class.- See Also:
-
LINEBEGIN
Key for thelineBegin
attribute. Use instances of Integer as values for this key. Constants defined in this class.- See Also:
-
LINEEND
Key for thelineEnd
attribute. Use instances of Integer as values for this key. Constants defined in this class.- See Also:
-
BEGINSIZE
Key for thebeginSize
attribute. Use instances of Integer as values for this key.- See Also:
-
ENDSIZE
Key for theendSize
attribute. Use instances of Integer as values for this key.- See Also:
-
BEGINFILL
Key for thebeginFill
attribute. Use instances of Integer as values for this key.- See Also:
-
ENDFILL
Key for theendFill
attribute. Use instances of Integer as values for this key.- See Also:
-
VALUE
Key for thevalue
attribute. You can use any Object as a value for this key.- See Also:
-
EDITABLE
Key for theeditable
attribute. Use instances of Boolean as values for this key.- See Also:
-
MOVEABLE
Key for themoveable
attribute. Use instances of Boolean as values for this key.- See Also:
-
SIZEABLE
Key for thesizeable
attribute. Use instances of Boolean as values for this key.- See Also:
-
AUTOSIZE
Key for theautosize
attribute. Use instances of Boolean as values for this key.- See Also:
-
RESIZE
Key for theresize
attribute. Use instances of Boolean as values for this key.- See Also:
-
INSET
Key for theinset
attribute. Use instances of Integer as values for this key.- See Also:
-
CONSTRAINED
Key for theconstrained
attribute. Use instances of Boolean as values for this key.- See Also:
-
SELECTABLE
Key for theselectable
attribute. Use instances of Boolean as values for this key.- See Also:
-
CHILDRENSELECTABLE
Key for thechildrenSelectable
attribute. Use instances of Boolean as values for this key.- See Also:
-
MOVEHIDDENCHILDREN
Key for thechildrenSelectable
attribute. Use instances of Boolean as values for this key.- See Also:
-
BENDABLE
Key for thebendable
attribute. Use instances of Boolean as values for this key.- See Also:
-
CONNECTABLE
Key for theconnectable
attribute. Use instances of Boolean as values for this key.- See Also:
-
DISCONNECTABLE
Key for thedisconnectable
attribute. Use instances of Boolean as values for this key.- See Also:
-
BOUNDS
Key for thebounds
attribute. Use instances of Rectangle as values for this key.- See Also:
-
POINTS
Key for thepoints
attribute. Use instances of List as values for this key. The list should contain Point instances.- See Also:
-
ROUTING
Key for therouting
attribute. Use instances of EdgeView.EdgeRouter as values for this key.- See Also:
-
LABELPOSITION
Key for thelabelposition
attribute. Use instances of Point as values for this key. This Key/Value pair is for position of text relative to edge cell, and has no effect on label in vertex cell.- See Also:
-
EXTRALABELS
Key for theextraLabels
attribute. Use arrays of Objects as values for this key, where the toString() methods of the objects provide the label text value.- See Also:
-
EXTRALABELPOSITIONS
Key for theextraLabelPositions
attribute. Use arrays of Points as values for this key.- See Also:
-
LABELALONGEDGE
Key for thelabelAlongEdge
attribute. Use instances of Boolean as values for this key.- See Also:
-
ABSOLUTEX
Key for theabsoluteX
attribute. Use instances of Boolean as values for this key.- See Also:
-
ABSOLUTEY
Key for theabsoluteY
attribute. Use instances of Boolean as values for this key.- See Also:
-
OFFSET
Key for theoffset
attribute. Use instances of Point as values for this key.- See Also:
-
SIZE
Key for thesize
attribute. Use instances of Dimension as values for this key.- See Also:
-
LINK
Key for thelink
attribute. Use instances of String as values for this key.- See Also:
-
LABELENABLED
Key for thelabelEnabled
attribute. Use instances of Boolean as values for this key.- See Also:
-
EXACTSEGMENTRELATIVE
Key for thelabelEnabled
attribute. Use instances of Boolean as values for this key.- See Also:
-
-
Constructor Details
-
GraphConstants
public GraphConstants()
-
-
Method Details
-
createAttributes
Overloaded method that passes arguments on as arrays -
createAttributes
Overloaded method that passes arguments on as arrays -
createAttributes
Returns a new (nested) map, from cells to attribute maps. The attributes are populated with the (key, value)-pairs specified by the two given arrays. Thekeys
andvalues
parameters must match in size. -
createAttributes
Returns a new map, from cells to property maps. Theelements
may be instances ofCellView
, in which case the cell view's corresponding cell is used as a key, and its attributes are used as a property map. In any other case, theelement
is considered as a cell and looked-up in the cell mapper to find the corresponding view. If a view is found, its attributes are cloned and used as a property map, along with the cell as a key.Note: This method returns a map of maps! This is different from the createMap method, which creates a map, from keys to values. This method returns a map, from cells to maps, which in turn map from keys to values.
-
createAttributesFromModel
-
replaceKeys
Replace the keys inmap
usingkeyMapinvalid input: '<'/code, which maps from old to new keys. The value in
map
must itself be a map, and is cloned usingcloneMap
. -
merge
Merges the specified nested maps by adding all attributes in the change to the attributes for the cell in target, if the cell does not exist in target, then a new entry is added with all attributes from change. Returns the modified target map. Note: This method removes entries fromchange
and adds entries totarget
in-place!- Returns:
- a map including all attributes from change merged with target
-
setFont
Sets the value attribute in the specified map to the specified font value.- Parameters:
map
- The map to store the font attribute in.font
- The value to set the font attribute to.
-
getFont
Returns the font for the specified attribute map. Uses default font if no font is specified in the attribute map. -
setRemoveAttributes
Sets specific attributes are being marked for removal @ param map The transport map indicating the attribute removal @ param value The attributes to be removed -
getRemoveAttributes
Returns the attribute marked as for removal in the specified map. -
setMoveableAxis
Sets the moveableaxis attribute in the specified map to the specified value. -
getMoveableAxis
Returns the moveableaxis attribute from the specified map. -
setSizeableAxis
Sets the sizeableAxis attribute in the specified map to the specified value. -
getSizeableAxis
Returns the sizeableAxis attribute from the specified map. -
setIcon
Sets the icon attribute in the specified map to the specified value. -
getIcon
Returns the icon attribute from the specified map. -
setOpaque
Sets the opaque attribute in the specified map to the specified value. -
isOpaque
Returns the opaque attribute from the specified map. -
setGroupOpaque
Sets the opaque attribute in the specified map to the specified value. -
isGroupOpaque
Returns the opaque attribute from the specified map. -
setBorder
Sets the border attribute in the specified map to the specified value. -
getBorder
Returns the border attribute from the specified map. -
setLineColor
Sets the linecolor attribute in the specified map to the specified value. -
getLineColor
Returns the linecolor attribute from the specified map. -
setBorderColor
Sets the bordercolor attribute in the specified map to the specified value. -
getBorderColor
Returns the bordercolor attribute from the specified map. -
setLineWidth
Sets the linewidth attribute in the specified map to the specified value. -
getLineWidth
Returns the linewidth attribute from the specified map. -
setForeground
Sets the foregrund attribute in the specified map to the specified value. -
getForeground
Returns the foreground attribute from the specified map. -
setBackground
Sets the background attribute in the specified map to the specified value. -
getBackground
Returns the background attribute from the specified map. -
setGradientColor
Sets the gradientcolor attribute in the specified map to the specified value. -
getGradientColor
Returns the gradientcolor attribute from the specified map. -
setVerticalAlignment
This method set the position of the label in vertex cells, and takes aruguments of type SwingConstants (for JLabel) i.e. JLabel.TOP etc. Default value is JLabel.CENTER. This method has no effect on edge cells. -
getVerticalAlignment
Returns the verticalalignment attribute from the specified map. -
setHorizontalAlignment
This method set the position of the label in vertex cells, and takes aruguments of type SwingConstants (for JLabel) i.e. JLabel.LEFT etc. Default is JLabel.CENTER. This method has no effect on edge cells. -
getHorizontalAlignment
Returns the horizontalalignment attribute from the specified map. -
setVerticalTextPosition
This method set the text of a label on vertext cell relative to image. See JLabel api. Default value is JLabel.BOTTOM. -
getVerticalTextPosition
Returns the verticaltextposition attribute from the specified map. -
setHorizontalTextPosition
This method set the text of a label on vertext cell relative to image. See JLabel api. Default value is JLabel.CENTER. -
getHorizontalTextPosition
Returns the horizontaltextposition attribute from the specified map. -
setDashPattern
Sets the dashpattern attribute in the specified map to the specified value. -
getDashPattern
Returns the dashpattern attribute from the specified map. -
setDashOffset
Sets the dashoffset attribute in the specified map to the specified value. -
getDashOffset
Returns the dashoffset attribute from the specified map. -
setLineStyle
Sets the linestyle attribute in the specified map to the specified value. -
getLineStyle
Returns the linestyle attribute from the specified map. -
setBeginSize
Sets the beginsize attribute in the specified map to the specified value. -
getBeginSize
Returns the beginsize attribute from the specified map. -
setEndSize
Sets the endsize attribute in the specified map to the specified value. -
getEndSize
Returns the endsize attribute from the specified map. -
setLineBegin
Sets the LINEBEGIN attribute in the specified map to the specified value. This attribute indicates what sort of decoration should be applied to the beginning of edges when they are rendered.- See Also:
-
getLineBegin
Returns the LINEBEGIN attribute from the specified map. This attribute indicates what sort of decoration should be applied to the beginning of edges when they are rendered.- See Also:
-
setLineEnd
Sets the LINEEND attribute in the specified map to the specified value. This attribute indicates what sort of decoration should be applied to the ends of edges when they are rendered.- See Also:
-
getLineEnd
Returns the LINEEND attribute from the specified map. This attribute indicates what sort of decoration should be applied to the ends of edges when they are rendered.- See Also:
-
setValue
Sets the value attribute in the specified map to the specified value. -
getValue
Returns the value attribute from the specified map. Only use for transport maps, not storage map since the value is removed from the final storage map- See Also:
-
setLabelPosition
Sets the label position attribute in the specified map to the specified value. -
getLabelPosition
Returns the label position attribute from the specified map. The point is interpreted by the EdgeRenderer as follows:
x coordinate: the percentual position on the length of the edge in direction of the edge
y coordinate: the absolute offset, orthogonally to the edge -
setExtraLabels
Sets the array of additional labels. The objects's toString methods are used to determine the actual label string. Extra labels only work with edges currently. -
getExtraLabels
Returns the additional label objects from the specified map.Extra labels only work with edges currently. -
setExtraLabelPositions
Sets the labelpositions attribute in the specified map to the specified value. The Point instance at a particular index corresponds to the object at the same index in the extralabels array attribute. Extra labels only work with edges currently.- See Also:
-
getExtraLabelPositions
Returns the extralabelpositions attribute from the specified map. Extra labels only work with edges currently. -
setLabelAlongEdge
Sets if the label should be painted along the edge. -
isLabelAlongEdge
Returns the true if the label should be painted along the edge. Defaults to false. -
setEditable
Sets the editable attribute in the specified map to the specified value. -
isEditable
Returns the editable attribute from the specified map. -
setMoveable
Sets the moveable attribute in the specified map to the specified value. -
isMoveable
Returns the moveable attribute from the specified map. -
setSizeable
Sets the sizeable attribute in the specified map to the specified value. -
isSizeable
Returns the sizeable attribute from the specified map. -
setAutoSize
Sets the autosize attribute in the specified map to the specified value. -
isAutoSize
Returns the autosize attribute from the specified map. -
setResize
Sets the resize attribute in the specified map to the specified value. -
isResize
Returns the resize attribute from the specified map. -
setConstrained
Sets the constrained attribute in the specified map to the specified value. -
isConstrained
Returns the constrained attribute from the specified map. -
setSelectable
Sets the selectable attribute in the specified map to the specified value. This detemines whether or not a cell may be selected. Vertices and edges may be selectable, not ports. -
isSelectable
Returns the selectable attribute from the specified map.- See Also:
-
setChildrenSelectable
Sets the childrenselectable attribute in the specified map to the specified value. -
isChildrenSelectable
Returns the childrenselectable attribute from the specified map. -
setBendable
Sets the bendable attribute in the specified map to the specified value. -
isBendable
Returns the bendable attribute from the specified map. -
setConnectable
Sets the connectable attribute in the specified map to the specified value. -
isConnectable
Returns the connectable attribute from the specified map. -
setDisconnectable
Sets the disconnectable attribute in the specified map to the specified value. -
isDisconnectable
Returns the disconnectable attribute from the specified map. -
setPoints
Sets the points attribute in the specified map to the specified value. Points are literally the points where an edge is connected by two lines. The two defaults points are the start and end of the edge. For example, for an simple orthogonal edge there will be two extra points indicating where the two right-angled bends are. This attribute can only be applied to an edge. -
getPoints
Returns the points attribute from the specified map.- See Also:
-
setRouting
Sets the routing attribute in the specified map to the specified value. -
getRouting
Returns the routing attribute from the specified map. -
setBounds
Sets the bounds attribute in the specified map to the specified value. -
getBounds
Returns the bounds attribute from the specified map. Note: The CellView interface offers a getBounds method! -
setInset
Sets the inset attribute in the specified map to the specified value. -
getInset
Returns the inset attribute from the specified map. Note: The CellView interface offers a getBounds method! -
setSize
Sets the size attribute in the specified map to the specified value. Not currently used in JGraph. Use setBounds to set vertex bounds instead. -
getSize
Returns the size attribute from the specified map. Not currently used in JGraph. Use getBounds to set vertex bounds instead. -
setOffset
Sets the offset attribute in the specified map to the specified value. The offset is the position of a port relative to its origin, note this attribute is only for ports. -
getOffset
Returns the offset attribute from the specified map. The offset is the position of a port relative to its origin, note this attribute is only for ports. -
setBeginFill
Sets the beginfill attribute in the specified map to the specified value. -
isBeginFill
Returns the beginfill attribute from the specified map. -
setEndFill
Sets the endfill attribute in the specified map to the specified value. -
isEndFill
Returns the endfill attribute from the specified map. -
setAbsolute
Sets the absolute attributes in the specified map to the specified value. -
setAbsoluteY
Sets the absolutey attribute in the specified map to the specified value. -
isAbsoluteY
Returns the absolutey attribute from the specified map. -
setAbsoluteX
Sets the absolutex attribute in the specified map to the specified value. -
isAbsoluteX
Returns the absolutex attribute from the specified map. -
setRemoveAll
Sets the removeall attribute in the specified map to the specified value. -
isRemoveAll
Returns the removeall attribute from the specified map. -
getROUTING_SIMPLE
- Returns:
- Returns the ROUTING_SIMPLE.
-
getROUTING_DEFAULT
- Returns:
- Returns the ROUTING_SIMPLE.
-
setLink
Sets the link attribute in the specified map to the specified value.- Parameters:
map
- The map to store the link attribute in.link
- The value to set the link attribute to.
-
getLink
Returns the link for the specified attribute map. -
setLabelEnabled
Sets the label enabled attribute in the specified map to the specified value.- Parameters:
map
- The map to store the label enabled attribute in.flag
- The value to set the label enabled attribute to.
-
isLabelEnabled
Returns whether the label is enabled for the specified cell.- Parameters:
map
- the attribute map for the cell being tested for this condition.- Returns:
- whether or not labels should be displayed on this cell
-
setExactSegmentLabel
Sets the exact segment attribute in the specified map to the specified value.- Parameters:
map
- The map to store the exact segment attribute in.flag
- The value to set the exact segment attribute to.
-
isExactSegmentLabel
Returns whether the exact segment is worked out for placement of labels along edges for the specified cell.- Parameters:
map
- the attribute map for the cell being tested for this condition.- Returns:
- whether or not exact segments should be calculated on this cell
-