Class GraphConstants

java.lang.Object
org.jgraph.graph.GraphConstants

public class GraphConstants extends Object
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=770111&forum_id=140880)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Key for the absoluteX attribute.
    static final String
    Key for the absoluteY 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 the autosize attribute.
    static final String
    Key for the background attribute.
    static final String
    Key for the beginFill attribute.
    static final String
    Key for the beginSize attribute.
    static final String
    Key for the bendable attribute.
    static final String
    Key for the border attribute.
    static final String
    Key for the bordercolor attribute.
    static final String
    Key for the bounds attribute.
    static final String
    Key for the childrenSelectable attribute.
    static final String
    Key for the connectable attribute.
    static final String
    Key for the constrained attribute.
    protected static float[]
    Global Stroke To Highlight Selection
    static final String
    Key for the dashOffset attribute.
    static final String
    Key for the dashPattern 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 the disconnectable attribute.
    static final String
    Key for the editable attribute.
    static final String
    Key for the endFill attribute.
    static final String
    Key for the endSize attribute.
    static final String
    Key for the labelEnabled attribute.
    static final String
    Key for the extraLabelPositions attribute.
    static final String
    Key for the extraLabels attribute.
    static final String
    Key for the font attribute.
    static final String
    Key for the foreground attribute.
    static final String
    Key for the gradient attribute.
    static final String
    Key for the groupOpaque attribute.
    static final String
    Key for the horizontalAlignment attribute.
    static final String
    Key for the horizontalTextPosition attribute.
    static final String
    Key for the icon attribute.
    static final String
    Key for the inset attribute.
    static final String
    Key for the labelAlongEdge attribute.
    static final String
    Key for the labelEnabled attribute.
    static final String
    Key for the labelposition attribute.
    static final String
    Key for the lineBegin attribute.
    static final String
    Key for the linecolor attribute.
    static final String
    Key for the lineEnd attribute.
    static final String
    Key for the lineStyle attribute.
    static final String
    Key for the linewidth attribute.
    static final String
    Key for the link attribute.
    static final String
    Key for the moveable attribute.
    static final String
    Key for the moveableAxis attribute.
    static final String
    Key for the childrenSelectable attribute.
    static final String
    Key for the offset attribute.
    static final String
    Key for the opaque attribute.
    static final int
    100 percent unit for relative positioning.
    static final String
    Key for the points attribute.
    static final String
    Key for the removeAll attribute.
    static final String
    Key for the removeAttributes attribute.
    static final String
    Key for the replaceAttributes attribute.
    static final String
    Key for the resize attribute.
    static final String
    Key for the routing attribute.
    The default routing that deals with loops.
    static final Edge.Routing
    A simple routing.
    static final String
    Key for the selectable attribute.
    static Stroke
     
    static final String
    Key for the size attribute.
    static final String
    Key for the sizeable attribute.
    static final String
    Key for the sizeableAxis attribute.
    static final int
    Represents a bezier line style
    static final int
    Represents an orthogonal line style
    static final int
    Represents an spline line style
    static final String
    Key for the value attribute.
    static final String
    Key for the verticalAlignment attribute.
    static final String
    Key for the verticalTextPosition attribute.
    static final int
    Represents an bezier line style
    static final int
    Represents an bezier line style
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 arrays
    static Map
    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 arrays
    static Map
     
    static final Color
    Returns the background attribute from the specified map.
    static final int
    Returns the beginsize attribute from the specified map.
    static final Border
    Returns the border attribute from the specified map.
    static final Color
    Returns the bordercolor attribute from the specified map.
    static final Rectangle2D
    Returns the bounds attribute from the specified map.
    static final float
    Returns the dashoffset attribute from the specified map.
    static final float[]
    Returns the dashpattern attribute from the specified map.
    static final int
    Returns the endsize attribute from the specified map.
    static final Point2D[]
    Returns the extralabelpositions attribute from the specified map.
    static final Object[]
    Returns the additional label objects from the specified map.Extra labels only work with edges currently.
    static Font
    getFont(Map map)
    Returns the font for the specified attribute map.
    static final Color
    Returns the foreground attribute from the specified map.
    static final Color
    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
    getIcon(Map map)
    Returns the icon attribute from the specified map.
    static final int
    Returns the inset attribute from the specified map.
    static final Point2D
    Returns the label position attribute from the specified map.
    static final int
    Returns the LINEBEGIN attribute from the specified map.
    static final Color
    Returns the linecolor attribute from the specified map.
    static final int
    Returns the LINEEND attribute from the specified map.
    static final int
    Returns the linestyle attribute from the specified map.
    static final float
    Returns the linewidth attribute from the specified map.
    static String
    getLink(Map map)
    Returns the link for the specified attribute map.
    static final int
    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[]
    Returns the attribute marked as for removal in the specified map.
    static final Edge.Routing
    Returns the routing attribute from the specified map.
     
     
    static final Dimension
    getSize(Map map)
    Returns the size attribute from the specified map.
    static final int
    Returns the sizeableAxis attribute from the specified map.
    static final Object
    Returns the value attribute from the specified map.
    static final int
    Returns the verticalalignment attribute from the specified map.
    static final int
    Returns the verticaltextposition attribute from the specified map.
    static final boolean
    Returns the absolutex attribute from the specified map.
    static final boolean
    Returns the absolutey attribute from the specified map.
    static final boolean
    Returns the autosize attribute from the specified map.
    static final boolean
    Returns the beginfill attribute from the specified map.
    static final boolean
    Returns the bendable attribute from the specified map.
    static final boolean
    Returns the childrenselectable attribute from the specified map.
    static final boolean
    Returns the connectable attribute from the specified map.
    static final boolean
    Returns the constrained attribute from the specified map.
    static final boolean
    Returns the disconnectable attribute from the specified map.
    static final boolean
    Returns the editable attribute from the specified map.
    static final boolean
    Returns the endfill attribute from the specified map.
    static boolean
    Returns whether the exact segment is worked out for placement of labels along edges for the specified cell.
    static final boolean
    Returns the opaque attribute from the specified map.
    static final boolean
    Returns the true if the label should be painted along the edge.
    static boolean
    Returns whether the label is enabled for the specified cell.
    static final boolean
    Returns the moveable attribute from the specified map.
    static final boolean
    Returns the opaque attribute from the specified map.
    static final boolean
    Returns the removeall attribute from the specified map.
    static final boolean
    Returns the resize attribute from the specified map.
    static final boolean
    Returns the selectable attribute from the specified map.
    static final boolean
    Returns the sizeable attribute from the specified map.
    static Map
    merge(Map change, Map target)
    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 in map using keyMap</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
    setBorder(Map map, Border value)
    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
    setFont(Map map, Font font)
    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
    setIcon(Map map, Icon value)
    Sets the icon attribute in the specified map to the specified value.
    static final void
    setInset(Map map, int width)
    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
    setLink(Map map, String link)
    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
    setOffset(Map map, Point2D offset)
    Sets the offset attribute in the specified map to the specified value.
    static final void
    setOpaque(Map map, boolean flag)
    Sets the opaque attribute in the specified map to the specified value.
    static final void
    setPoints(Map map, List list)
    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
    Sets specific attributes are being marked for removal @ param map The transport map indicating the attribute removal @ param value The attributes to be removed
    static final void
    setResize(Map map, boolean flag)
    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
    setSize(Map map, Dimension size)
    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
    setValue(Map map, Object value)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULTFONT

      public static Font DEFAULTFONT
      Default font is derived from UIManager.getDefaults().getFont("Label.font")
    • DEFAULTDECORATIONSIZE

      public static int DEFAULTDECORATIONSIZE
      Default decoration size. Value is 0.
    • DEFAULTINSET

      public static int DEFAULTINSET
      Default inset size. Value is 0.
    • PERMILLE

      public static final int PERMILLE
      100 percent unit for relative positioning. Current value is 1000.
      See Also:
    • dash

      protected static float[] dash
      Global Stroke To Highlight Selection
    • SELECTION_STROKE

      public static Stroke SELECTION_STROKE
    • ARROW_NONE

      public static final int ARROW_NONE
      Represents no decoration for the beginning or ending of edges.
      See Also:
    • ARROW_CLASSIC

      public static final int ARROW_CLASSIC
      Represents a classic arrow decoration for the beginning or ending of edges.
      See Also:
    • ARROW_TECHNICAL

      public static final int ARROW_TECHNICAL
      Represents a technical arrow decoration for the beginning or ending of edges.
      See Also:
    • ARROW_SIMPLE

      public static final int ARROW_SIMPLE
      Represents a simple arrow decoration for the beginning or ending of edges.
      See Also:
    • ARROW_CIRCLE

      public static final int ARROW_CIRCLE
      Represents a circle decoration for the beginning or ending of edges.
      See Also:
    • ARROW_LINE

      public static final int ARROW_LINE
      Represents a line decoration for the beginning or ending of edges.
      See Also:
    • ARROW_DOUBLELINE

      public static final int ARROW_DOUBLELINE
      Represents a double line decoration for the beginning or ending of edges.
      See Also:
    • ARROW_DIAMOND

      public static final int ARROW_DIAMOND
      Represents a diamond decoration for the beginning or ending of edges.
      See Also:
    • STYLE_ORTHOGONAL

      public static final int STYLE_ORTHOGONAL
      Represents an orthogonal line style
      See Also:
    • STYLE_BEZIER

      public static final int STYLE_BEZIER
      Represents a bezier line style
      See Also:
    • STYLE_SPLINE

      public static final int STYLE_SPLINE
      Represents an spline line style
      See Also:
    • X_AXIS

      public static final int X_AXIS
      Represents an bezier line style
      See Also:
    • Y_AXIS

      public static final int Y_AXIS
      Represents an bezier line style
      See Also:
    • ROUTING_DEFAULT

      public static Edge.Routing ROUTING_DEFAULT
      The default routing that deals with loops. This is returned by getRouting(Map) if there is no routing assigned.
    • ROUTING_SIMPLE

      public static final Edge.Routing ROUTING_SIMPLE
      A simple routing.
    • SIZEABLEAXIS

      public static final String SIZEABLEAXIS
      Key for the sizeableAxis 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

      public static final String MOVEABLEAXIS
      Key for the moveableAxis attribute. This attribute contains an Integer value indicating along which axis a cell may be moved. Constants defined in this class.
      See Also:
    • REPLACEATTRIBUTES

      public static final String REPLACEATTRIBUTES
      Key for the replaceAttributes 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

      public static final String REMOVEATTRIBUTES
      Key for the removeAttributes attribute. This special attribute contains a list of attribute-keys which should be removed at the receiving views.
      See Also:
    • REMOVEALL

      public static final String REMOVEALL
      Key for the removeAll attribute. This causes the receivers attributes to be replaced by the the map that contains this attribute.
      See Also:
    • ICON

      public static final String ICON
      Key for the icon attribute. Use instances of Icon as values for this key.
      See Also:
    • FONT

      public static final String FONT
      Key for the font attribute. Use instances of Font as values for this key.
      See Also:
    • OPAQUE

      public static final String OPAQUE
      Key for the opaque attribute. Use instances of Boolean as values for this key.
      See Also:
    • GROUPOPAQUE

      public static final String GROUPOPAQUE
      Key for the groupOpaque attribute. Use instances of Boolean as values for this key.
      See Also:
    • BORDER

      public static final String BORDER
      Key for the border attribute. Use instances of Border as values for this key. Optionally, you can set the global instance of LineBorder.
      See Also:
    • LINECOLOR

      public static final String LINECOLOR
      Key for the linecolor attribute. Use instances of Color as values for this key.
      See Also:
    • BORDERCOLOR

      public static final String BORDERCOLOR
      Key for the bordercolor attribute. Use instances of Color as values for this key.
      See Also:
    • LINEWIDTH

      public static final String LINEWIDTH
      Key for the linewidth attribute. Use instances of Float as values for this key.
      See Also:
    • FOREGROUND

      public static final String FOREGROUND
      Key for the foreground attribute. Use instances of Color as values for this key.
      See Also:
    • BACKGROUND

      public static final String BACKGROUND
      Key for the background attribute. Use instances of Color as values for this key.
      See Also:
    • GRADIENTCOLOR

      public static final String GRADIENTCOLOR
      Key for the gradient attribute. Use instances of Color as values for this key.
      See Also:
    • VERTICAL_ALIGNMENT

      public static final String VERTICAL_ALIGNMENT
      Key for the verticalAlignment 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

      public static final String HORIZONTAL_ALIGNMENT
      Key for the horizontalAlignment 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

      public static final String VERTICAL_TEXT_POSITION
      Key for the verticalTextPosition 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

      public static final String HORIZONTAL_TEXT_POSITION
      Key for the horizontalTextPosition 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

      public static final String DASHPATTERN
      Key for the dashPattern attribute. Use instances of float[] as values for this key.
      See Also:
    • DASHOFFSET

      public static final String DASHOFFSET
      Key for the dashOffset attribute. Use instances of float as values for this key.
      See Also:
    • LINESTYLE

      public static final String LINESTYLE
      Key for the lineStyle attribute. Use instances of Integer as values for this key. Constants defined in this class.
      See Also:
    • LINEBEGIN

      public static final String LINEBEGIN
      Key for the lineBegin attribute. Use instances of Integer as values for this key. Constants defined in this class.
      See Also:
    • LINEEND

      public static final String LINEEND
      Key for the lineEnd attribute. Use instances of Integer as values for this key. Constants defined in this class.
      See Also:
    • BEGINSIZE

      public static final String BEGINSIZE
      Key for the beginSize attribute. Use instances of Integer as values for this key.
      See Also:
    • ENDSIZE

      public static final String ENDSIZE
      Key for the endSize attribute. Use instances of Integer as values for this key.
      See Also:
    • BEGINFILL

      public static final String BEGINFILL
      Key for the beginFill attribute. Use instances of Integer as values for this key.
      See Also:
    • ENDFILL

      public static final String ENDFILL
      Key for the endFill attribute. Use instances of Integer as values for this key.
      See Also:
    • VALUE

      public static final String VALUE
      Key for the value attribute. You can use any Object as a value for this key.
      See Also:
    • EDITABLE

      public static final String EDITABLE
      Key for the editable attribute. Use instances of Boolean as values for this key.
      See Also:
    • MOVEABLE

      public static final String MOVEABLE
      Key for the moveable attribute. Use instances of Boolean as values for this key.
      See Also:
    • SIZEABLE

      public static final String SIZEABLE
      Key for the sizeable attribute. Use instances of Boolean as values for this key.
      See Also:
    • AUTOSIZE

      public static final String AUTOSIZE
      Key for the autosize attribute. Use instances of Boolean as values for this key.
      See Also:
    • RESIZE

      public static final String RESIZE
      Key for the resize attribute. Use instances of Boolean as values for this key.
      See Also:
    • INSET

      public static final String INSET
      Key for the inset attribute. Use instances of Integer as values for this key.
      See Also:
    • CONSTRAINED

      public static final String CONSTRAINED
      Key for the constrained attribute. Use instances of Boolean as values for this key.
      See Also:
    • SELECTABLE

      public static final String SELECTABLE
      Key for the selectable attribute. Use instances of Boolean as values for this key.
      See Also:
    • CHILDRENSELECTABLE

      public static final String CHILDRENSELECTABLE
      Key for the childrenSelectable attribute. Use instances of Boolean as values for this key.
      See Also:
    • MOVEHIDDENCHILDREN

      public static final String MOVEHIDDENCHILDREN
      Key for the childrenSelectable attribute. Use instances of Boolean as values for this key.
      See Also:
    • BENDABLE

      public static final String BENDABLE
      Key for the bendable attribute. Use instances of Boolean as values for this key.
      See Also:
    • CONNECTABLE

      public static final String CONNECTABLE
      Key for the connectable attribute. Use instances of Boolean as values for this key.
      See Also:
    • DISCONNECTABLE

      public static final String DISCONNECTABLE
      Key for the disconnectable attribute. Use instances of Boolean as values for this key.
      See Also:
    • BOUNDS

      public static final String BOUNDS
      Key for the bounds attribute. Use instances of Rectangle as values for this key.
      See Also:
    • POINTS

      public static final String POINTS
      Key for the points attribute. Use instances of List as values for this key. The list should contain Point instances.
      See Also:
    • ROUTING

      public static final String ROUTING
      Key for the routing attribute. Use instances of EdgeView.EdgeRouter as values for this key.
      See Also:
    • LABELPOSITION

      public static final String LABELPOSITION
      Key for the labelposition 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

      public static final String EXTRALABELS
      Key for the extraLabels 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

      public static final String EXTRALABELPOSITIONS
      Key for the extraLabelPositions attribute. Use arrays of Points as values for this key.
      See Also:
    • LABELALONGEDGE

      public static final String LABELALONGEDGE
      Key for the labelAlongEdge attribute. Use instances of Boolean as values for this key.
      See Also:
    • ABSOLUTEX

      public static final String ABSOLUTEX
      Key for the absoluteX attribute. Use instances of Boolean as values for this key.
      See Also:
    • ABSOLUTEY

      public static final String ABSOLUTEY
      Key for the absoluteY attribute. Use instances of Boolean as values for this key.
      See Also:
    • OFFSET

      public static final String OFFSET
      Key for the offset attribute. Use instances of Point as values for this key.
      See Also:
    • SIZE

      public static final String SIZE
      Key for the size attribute. Use instances of Dimension as values for this key.
      See Also:
    • LABELENABLED

      public static final String LABELENABLED
      Key for the labelEnabled attribute. Use instances of Boolean as values for this key.
      See Also:
    • EXACTSEGMENTRELATIVE

      public static final String EXACTSEGMENTRELATIVE
      Key for the labelEnabled attribute. Use instances of Boolean as values for this key.
      See Also:
  • Constructor Details

    • GraphConstants

      public GraphConstants()
  • Method Details

    • createAttributes

      public static Map createAttributes(Object cell, Object key, Object value)
      Overloaded method that passes arguments on as arrays
    • createAttributes

      public static Map createAttributes(Object[] cells, Object key, Object value)
      Overloaded method that passes arguments on as arrays
    • createAttributes

      public static Map createAttributes(Object[] cells, Object[] keys, Object[] values)
      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. The keys and values parameters must match in size.
    • createAttributes

      public static Map createAttributes(Object[] elements, CellMapper cm)
      Returns a new map, from cells to property maps. The elements may be instances of CellView, 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, the element 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

      public static Map createAttributesFromModel(Object[] elements, GraphModel model)
    • replaceKeys

      public static Map replaceKeys(Map keyMap, Map map)
      Replace the keys in map using keyMap</code, which maps from old to new keys. The value in map must itself be a map, and is cloned using cloneMap.
    • merge

      public static Map merge(Map change, Map target)
      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 from change and adds entries to target in-place!
      Returns:
      a map including all attributes from change merged with target
    • setFont

      public static void setFont(Map map, Font font)
      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

      public static Font getFont(Map map)
      Returns the font for the specified attribute map. Uses default font if no font is specified in the attribute map.
    • setRemoveAttributes

      public 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 removed
    • getRemoveAttributes

      public static final Object[] getRemoveAttributes(Map map)
      Returns the attribute marked as for removal in the specified map.
    • setMoveableAxis

      public static final void setMoveableAxis(Map map, int axis)
      Sets the moveableaxis attribute in the specified map to the specified value.
    • getMoveableAxis

      public static final int getMoveableAxis(Map map)
      Returns the moveableaxis attribute from the specified map.
    • setSizeableAxis

      public static final void setSizeableAxis(Map map, int axis)
      Sets the sizeableAxis attribute in the specified map to the specified value.
    • getSizeableAxis

      public static final int getSizeableAxis(Map map)
      Returns the sizeableAxis attribute from the specified map.
    • setIcon

      public static final void setIcon(Map map, Icon value)
      Sets the icon attribute in the specified map to the specified value.
    • getIcon

      public static final Icon getIcon(Map map)
      Returns the icon attribute from the specified map.
    • setOpaque

      public static final void setOpaque(Map map, boolean flag)
      Sets the opaque attribute in the specified map to the specified value.
    • isOpaque

      public static final boolean isOpaque(Map map)
      Returns the opaque attribute from the specified map.
    • setGroupOpaque

      public static final void setGroupOpaque(Map map, boolean flag)
      Sets the opaque attribute in the specified map to the specified value.
    • isGroupOpaque

      public static final boolean isGroupOpaque(Map map)
      Returns the opaque attribute from the specified map.
    • setBorder

      public static final void setBorder(Map map, Border value)
      Sets the border attribute in the specified map to the specified value.
    • getBorder

      public static final Border getBorder(Map map)
      Returns the border attribute from the specified map.
    • setLineColor

      public static final void setLineColor(Map map, Color value)
      Sets the linecolor attribute in the specified map to the specified value.
    • getLineColor

      public static final Color getLineColor(Map map)
      Returns the linecolor attribute from the specified map.
    • setBorderColor

      public static final void setBorderColor(Map map, Color value)
      Sets the bordercolor attribute in the specified map to the specified value.
    • getBorderColor

      public static final Color getBorderColor(Map map)
      Returns the bordercolor attribute from the specified map.
    • setLineWidth

      public static final void setLineWidth(Map map, float width)
      Sets the linewidth attribute in the specified map to the specified value.
    • getLineWidth

      public static final float getLineWidth(Map map)
      Returns the linewidth attribute from the specified map.
    • setForeground

      public static final void setForeground(Map map, Color value)
      Sets the foregrund attribute in the specified map to the specified value.
    • getForeground

      public static final Color getForeground(Map map)
      Returns the foreground attribute from the specified map.
    • setBackground

      public static final void setBackground(Map map, Color value)
      Sets the background attribute in the specified map to the specified value.
    • getBackground

      public static final Color getBackground(Map map)
      Returns the background attribute from the specified map.
    • setGradientColor

      public static final void setGradientColor(Map map, Color value)
      Sets the gradientcolor attribute in the specified map to the specified value.
    • getGradientColor

      public static final Color getGradientColor(Map map)
      Returns the gradientcolor attribute from the specified map.
    • setVerticalAlignment

      public 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. JLabel.TOP etc. Default value is JLabel.CENTER. This method has no effect on edge cells.
    • getVerticalAlignment

      public static final int getVerticalAlignment(Map map)
      Returns the verticalalignment attribute from the specified map.
    • setHorizontalAlignment

      public 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. JLabel.LEFT etc. Default is JLabel.CENTER. This method has no effect on edge cells.
    • getHorizontalAlignment

      public static final int getHorizontalAlignment(Map map)
      Returns the horizontalalignment attribute from the specified map.
    • setVerticalTextPosition

      public static final void setVerticalTextPosition(Map map, int textPosition)
      This method set the text of a label on vertext cell relative to image. See JLabel api. Default value is JLabel.BOTTOM.
    • getVerticalTextPosition

      public static final int getVerticalTextPosition(Map map)
      Returns the verticaltextposition attribute from the specified map.
    • setHorizontalTextPosition

      public static final void setHorizontalTextPosition(Map map, int textPosition)
      This method set the text of a label on vertext cell relative to image. See JLabel api. Default value is JLabel.CENTER.
    • getHorizontalTextPosition

      public static final int getHorizontalTextPosition(Map map)
      Returns the horizontaltextposition attribute from the specified map.
    • setDashPattern

      public static final void setDashPattern(Map map, float[] value)
      Sets the dashpattern attribute in the specified map to the specified value.
    • getDashPattern

      public static final float[] getDashPattern(Map map)
      Returns the dashpattern attribute from the specified map.
    • setDashOffset

      public static final void setDashOffset(Map map, float value)
      Sets the dashoffset attribute in the specified map to the specified value.
    • getDashOffset

      public static final float getDashOffset(Map map)
      Returns the dashoffset attribute from the specified map.
    • setLineStyle

      public static final void setLineStyle(Map map, int style)
      Sets the linestyle attribute in the specified map to the specified value.
    • getLineStyle

      public static final int getLineStyle(Map map)
      Returns the linestyle attribute from the specified map.
    • setBeginSize

      public static final void setBeginSize(Map map, int style)
      Sets the beginsize attribute in the specified map to the specified value.
    • getBeginSize

      public static final int getBeginSize(Map map)
      Returns the beginsize attribute from the specified map.
    • setEndSize

      public static final void setEndSize(Map map, int style)
      Sets the endsize attribute in the specified map to the specified value.
    • getEndSize

      public static final int getEndSize(Map map)
      Returns the endsize attribute from the specified map.
    • setLineBegin

      public static final void setLineBegin(Map map, int style)
      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

      public static final int getLineBegin(Map map)
      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

      public static final void setLineEnd(Map map, int style)
      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

      public static final int getLineEnd(Map map)
      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

      public static final void setValue(Map map, Object value)
      Sets the value attribute in the specified map to the specified value.
    • getValue

      public static final Object getValue(Map map)
      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

      public static final void setLabelPosition(Map map, Point2D position)
      Sets the label position attribute in the specified map to the specified value.
    • getLabelPosition

      public static final Point2D getLabelPosition(Map map)
      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

      public static final void setExtraLabels(Map map, Object[] definitions)
      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

      public static final Object[] getExtraLabels(Map map)
      Returns the additional label objects from the specified map.Extra labels only work with edges currently.
    • setExtraLabelPositions

      public static final void setExtraLabelPositions(Map map, Point2D[] positions)
      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

      public static final Point2D[] getExtraLabelPositions(Map map)
      Returns the extralabelpositions attribute from the specified map. Extra labels only work with edges currently.
    • setLabelAlongEdge

      public static final void setLabelAlongEdge(Map map, boolean flag)
      Sets if the label should be painted along the edge.
    • isLabelAlongEdge

      public static final boolean isLabelAlongEdge(Map map)
      Returns the true if the label should be painted along the edge. Defaults to false.
    • setEditable

      public static final void setEditable(Map map, boolean flag)
      Sets the editable attribute in the specified map to the specified value.
    • isEditable

      public static final boolean isEditable(Map map)
      Returns the editable attribute from the specified map.
    • setMoveable

      public static final void setMoveable(Map map, boolean flag)
      Sets the moveable attribute in the specified map to the specified value.
    • isMoveable

      public static final boolean isMoveable(Map map)
      Returns the moveable attribute from the specified map.
    • setSizeable

      public static final void setSizeable(Map map, boolean flag)
      Sets the sizeable attribute in the specified map to the specified value.
    • isSizeable

      public static final boolean isSizeable(Map map)
      Returns the sizeable attribute from the specified map.
    • setAutoSize

      public static final void setAutoSize(Map map, boolean flag)
      Sets the autosize attribute in the specified map to the specified value.
    • isAutoSize

      public static final boolean isAutoSize(Map map)
      Returns the autosize attribute from the specified map.
    • setResize

      public static final void setResize(Map map, boolean flag)
      Sets the resize attribute in the specified map to the specified value.
    • isResize

      public static final boolean isResize(Map map)
      Returns the resize attribute from the specified map.
    • setConstrained

      public static final void setConstrained(Map map, boolean flag)
      Sets the constrained attribute in the specified map to the specified value.
    • isConstrained

      public static final boolean isConstrained(Map map)
      Returns the constrained attribute from the specified map.
    • setSelectable

      public static final void setSelectable(Map map, boolean flag)
      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

      public static final boolean isSelectable(Map map)
      Returns the selectable attribute from the specified map.
      See Also:
    • setChildrenSelectable

      public static final void setChildrenSelectable(Map map, boolean flag)
      Sets the childrenselectable attribute in the specified map to the specified value.
    • isChildrenSelectable

      public static final boolean isChildrenSelectable(Map map)
      Returns the childrenselectable attribute from the specified map.
    • setBendable

      public static final void setBendable(Map map, boolean flag)
      Sets the bendable attribute in the specified map to the specified value.
    • isBendable

      public static final boolean isBendable(Map map)
      Returns the bendable attribute from the specified map.
    • setConnectable

      public static final void setConnectable(Map map, boolean flag)
      Sets the connectable attribute in the specified map to the specified value.
    • isConnectable

      public static final boolean isConnectable(Map map)
      Returns the connectable attribute from the specified map.
    • setDisconnectable

      public static final void setDisconnectable(Map map, boolean flag)
      Sets the disconnectable attribute in the specified map to the specified value.
    • isDisconnectable

      public static final boolean isDisconnectable(Map map)
      Returns the disconnectable attribute from the specified map.
    • setPoints

      public static final void setPoints(Map map, List list)
      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

      public static final List getPoints(Map map)
      Returns the points attribute from the specified map.
      See Also:
    • setRouting

      public static final void setRouting(Map map, Edge.Routing routing)
      Sets the routing attribute in the specified map to the specified value.
    • getRouting

      public static final Edge.Routing getRouting(Map map)
      Returns the routing attribute from the specified map.
    • setBounds

      public static final void setBounds(Map map, Rectangle2D bounds)
      Sets the bounds attribute in the specified map to the specified value.
    • getBounds

      public static final Rectangle2D getBounds(Map map)
      Returns the bounds attribute from the specified map. Note: The CellView interface offers a getBounds method!
    • setInset

      public static final void setInset(Map map, int width)
      Sets the inset attribute in the specified map to the specified value.
    • getInset

      public static final int getInset(Map map)
      Returns the inset attribute from the specified map. Note: The CellView interface offers a getBounds method!
    • setSize

      public static final void setSize(Map map, Dimension size)
      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

      public static final Dimension getSize(Map map)
      Returns the size attribute from the specified map. Not currently used in JGraph. Use getBounds to set vertex bounds instead.
    • setOffset

      public static final void setOffset(Map map, Point2D offset)
      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

      public static final Point2D getOffset(Map map)
      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

      public static final void setBeginFill(Map map, boolean flag)
      Sets the beginfill attribute in the specified map to the specified value.
    • isBeginFill

      public static final boolean isBeginFill(Map map)
      Returns the beginfill attribute from the specified map.
    • setEndFill

      public static final void setEndFill(Map map, boolean flag)
      Sets the endfill attribute in the specified map to the specified value.
    • isEndFill

      public static final boolean isEndFill(Map map)
      Returns the endfill attribute from the specified map.
    • setAbsolute

      public static final void setAbsolute(Map map, boolean flag)
      Sets the absolute attributes in the specified map to the specified value.
    • setAbsoluteY

      public static final void setAbsoluteY(Map map, boolean flag)
      Sets the absolutey attribute in the specified map to the specified value.
    • isAbsoluteY

      public static final boolean isAbsoluteY(Map map)
      Returns the absolutey attribute from the specified map.
    • setAbsoluteX

      public static final void setAbsoluteX(Map map, boolean flag)
      Sets the absolutex attribute in the specified map to the specified value.
    • isAbsoluteX

      public static final boolean isAbsoluteX(Map map)
      Returns the absolutex attribute from the specified map.
    • setRemoveAll

      public static final void setRemoveAll(Map map, boolean flag)
      Sets the removeall attribute in the specified map to the specified value.
    • isRemoveAll

      public static final boolean isRemoveAll(Map map)
      Returns the removeall attribute from the specified map.
    • getROUTING_SIMPLE

      public static Edge.Routing getROUTING_SIMPLE()
      Returns:
      Returns the ROUTING_SIMPLE.
    • getROUTING_DEFAULT

      public static Edge.Routing getROUTING_DEFAULT()
      Returns:
      Returns the ROUTING_SIMPLE.
    • setLink

      public static void setLink(Map map, String link)
      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

      public static String getLink(Map map)
      Returns the link for the specified attribute map.
    • setLabelEnabled

      public static void setLabelEnabled(Map map, boolean flag)
      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

      public static boolean isLabelEnabled(Map map)
      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

      public static void setExactSegmentLabel(Map map, boolean flag)
      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

      public static boolean isExactSegmentLabel(Map map)
      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