Class GraphGroup
java.lang.Object
com.codename1.graph.GraphGroup
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
FieldsModifier and TypeFieldDescriptionstatic final intA box drawn around its members wherever they are, the default.static final intA swimlane: a band with bounds of its own and a title along one side. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double px, double py) True when this is a lane and the world point lies inside it.doubleA lane's height.getId()The id members name inGraphNode.setGroupId.intgetKind()KIND_GROUPorKIND_LANE.getLabel()The title painted on the group.A key a renderer may map to a colour, or null.doublegetWidth()A lane's width.doublegetX()A lane's left edge.doublegetY()A lane's top edge.booleanTrue when the group is drawn as one node.booleanTrue, the default, when a lane runs left to right.booleanisLane()True when this is a swimlane.static GraphGroupMakes a swimlane with these bounds in world units.voidsetBounds(double x, double y, double width, double height) Sets a lane's bounds in world units.voidsetCollapsed(boolean collapsed) Collapses or expands the group.voidsetHorizontal(boolean horizontal) Sets the direction a lane runs in.voidsetKind(int kind) Sets the kind.voidSets the title.voidsetStyleKey(String styleKey) Sets the style key.
-
Field Details
-
KIND_GROUP
public static final int KIND_GROUPA box drawn around its members wherever they are, the default.- See Also:
-
KIND_LANE
public static final int KIND_LANEA 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
-
-
Method Details
-
getId
The id members name inGraphNode.setGroupId. -
getLabel
The title painted on the group. -
setLabel
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 throughGraphModel.setCollapsed. A lane does not collapse: its band is where its members are placed, and the flag is ignored for it. -
getStyleKey
A key a renderer may map to a colour, or null. -
setStyleKey
Sets the style key. -
getKind
public int getKind()KIND_GROUPorKIND_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 inGraphNode.setGroupIdlabel: the titlehorizontal: 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 throughGraphModel.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.
-