Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class GraphGroup

  1. Object
  2. 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.

Fields

public static final int KIND_GROUP = 0A box drawn around its members wherever they are, the default.
public static final int KIND_LANE = 1A swimlane: a band with bounds of its own and a title along one side.

Constructors

public GraphGroup(String id, String label)A group.

Methods

public String getId()The id members name in GraphNode.setGroupId.
public String getLabel()The title painted on the group.
public void setLabel(String label)Sets the title.
public boolean isCollapsed()True when the group is drawn as one node.
public void setCollapsed(boolean collapsed)Collapses or expands the group.
public String getStyleKey()A key a renderer may map to a colour, or null.
public void setStyleKey(String styleKey)Sets the style key.
public int getKind()KIND_GROUP or KIND_LANE.
public void setKind(int kind)Sets the kind.
public boolean isLane()True when this is a swimlane.
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.
public boolean isHorizontal()True, the default, when a lane runs left to right.
public void setHorizontal(boolean horizontal)Sets the direction a lane runs in.
public void setBounds(double x, double y, double width, double height)Sets a lane’s bounds in world units.
public double getX()A lane’s left edge.
public double getY()A lane’s top edge.
public double getWidth()A lane’s width.
public double getHeight()A lane’s height.
public boolean contains(double px, double py)True when this is a lane and the world point lies inside it.

Inherited methods

Field details

KIND_GROUP

public static final int KIND_GROUP = 0
A box drawn around its members wherever they are, the default.

KIND_LANE

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

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 String
the id members name in GraphNode.setGroupId
label String
the title
horizontal boolean
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
x double
Not documented.
y double
Not documented.
width double
Not documented.
height double
Not documented.

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.