Class GraphGroup

java.lang.Object
com.codename1.graph.GraphGroup

public class GraphGroup extends Object
A labeled box drawn around the nodes whose group id names it, such as the services of one subsystem. A collapsed group is drawn as a single node and the edges of its members end on it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    A box drawn around its members wherever they are, the default.
    static final int
    A swimlane: a band with bounds of its own and a title along one side.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphGroup(String id, String label)
    A group.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(double px, double py)
    True when this is a lane and the world point lies inside it.
    double
    A lane's height.
    The id members name in GraphNode.setGroupId.
    int
    KIND_GROUP or KIND_LANE.
    The title painted on the group.
    A key a renderer may map to a colour, or null.
    double
    A lane's width.
    double
    A lane's left edge.
    double
    A lane's top edge.
    boolean
    True when the group is drawn as one node.
    boolean
    True, the default, when a lane runs left to right.
    boolean
    True when this is a swimlane.
    static GraphGroup
    lane(String id, String label, boolean horizontal, double x, double y, double width, double height)
    Makes a swimlane with these bounds in world units.
    void
    setBounds(double x, double y, double width, double height)
    Sets a lane's bounds in world units.
    void
    setCollapsed(boolean collapsed)
    Collapses or expands the group.
    void
    setHorizontal(boolean horizontal)
    Sets the direction a lane runs in.
    void
    setKind(int kind)
    Sets the kind.
    void
    Sets the title.
    void
    setStyleKey(String styleKey)
    Sets the style key.

    Methods inherited from class Object

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

    • KIND_GROUP

      public static final int KIND_GROUP
      A box drawn around its members wherever they are, the default.
      See Also:
    • KIND_LANE

      public static final int KIND_LANE
      A swimlane: a band with bounds of its own and a title along one side. Nodes are in the lane they were dropped in.
      See Also:
  • Constructor Details

    • GraphGroup

      public GraphGroup(String id, String label)
      A group.
  • Method Details

    • getId

      public String getId()
      The id members name in GraphNode.setGroupId.
    • getLabel

      public String getLabel()
      The title painted on the group.
    • setLabel

      public void setLabel(String label)
      Sets the title.
    • isCollapsed

      public boolean isCollapsed()
      True when the group is drawn as one node.
    • setCollapsed

      public void setCollapsed(boolean collapsed)
      Collapses or expands the group. A model shown by a component is told through GraphModel.setCollapsed. A lane does not collapse: its band is where its members are placed, and the flag is ignored for it.
    • getStyleKey

      public String getStyleKey()
      A key a renderer may map to a colour, or null.
    • setStyleKey

      public void setStyleKey(String styleKey)
      Sets the style key.
    • getKind

      public int getKind()
      KIND_GROUP or KIND_LANE.
    • setKind

      public void setKind(int kind)
      Sets the kind.
    • isLane

      public boolean isLane()
      True when this is a swimlane.
    • lane

      public static GraphGroup lane(String id, String label, boolean horizontal, double x, double y, double width, double height)

      Makes a swimlane with these bounds in world units.

      Parameters
      • id: the id members name in GraphNode.setGroupId
      • label: the title
      • horizontal: true for a band that runs left to right with its title on the leading side, false for a column with its title on top
    • isHorizontal

      public boolean isHorizontal()
      True, the default, when a lane runs left to right.
    • setHorizontal

      public void setHorizontal(boolean horizontal)
      Sets the direction a lane runs in.
    • setBounds

      public void setBounds(double x, double y, double width, double height)
      Sets a lane's bounds in world units. A model shown by a component is told through GraphModel.resizeGroup. An ordinary group has no bounds of its own and ignores them.
    • getX

      public double getX()
      A lane's left edge.
    • getY

      public double getY()
      A lane's top edge.
    • getWidth

      public double getWidth()
      A lane's width.
    • getHeight

      public double getHeight()
      A lane's height.
    • contains

      public boolean contains(double px, double py)
      True when this is a lane and the world point lies inside it.