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

public class GraphEdge

  1. Object
  2. GraphEdge
A connection from one node to another, optionally from a port to a port.

Constructors

public GraphEdge(String id, String sourceId, String targetId)An edge between two nodes.
public GraphEdge(String id, String sourceId, String sourcePortId, String targetId, String targetPortId)An edge between two ports.

Methods

public String getId()The id, unique within the model.
public String getSourceId()The id of the node the edge leaves.
public String getSourcePortId()The id of the output port the edge leaves, or null.
public String getTargetId()The id of the node the edge enters.
public String getTargetPortId()The id of the input port the edge enters, or null.
public String getLabel()The text painted at the middle of the edge, or null.
public void setLabel(String label)Sets the label.
public boolean isDirected()True, the default, when the edge is painted with an arrowhead.
public void setDirected(boolean directed)Paints the edge with or without an arrowhead.
public String getStyleKey()A key a renderer may map to a colour or a dash, or null.
public void setStyleKey(String styleKey)Sets the style key.
public Object getUserData()Anything the application keeps with the edge.
public void setUserData(Object userData)Sets the application’s data.
public double[] getRoute()The bend points an arrangement routed the edge through, as x, y pairs in world units, or null for a direct line between its ends.
public void setRoute(double[] route)Sets the bend points; null removes them.
public boolean touches(String nodeId)True when the edge touches the node with this id.

Inherited methods

Constructor details

GraphEdge

public GraphEdge(String id, String sourceId, String targetId)
An edge between two nodes.

GraphEdge

public GraphEdge(String id, String sourceId, String sourcePortId, String targetId, String targetPortId)
An edge between two ports. Either port id may be null to attach to the node itself.

Method details

getId

public String getId()
The id, unique within the model.

getSourceId

public String getSourceId()
The id of the node the edge leaves.

getSourcePortId

public String getSourcePortId()
The id of the output port the edge leaves, or null.

getTargetId

public String getTargetId()
The id of the node the edge enters.

getTargetPortId

public String getTargetPortId()
The id of the input port the edge enters, or null.

getLabel

public String getLabel()
The text painted at the middle of the edge, or null.

setLabel

public void setLabel(String label)
Sets the label.

isDirected

public boolean isDirected()
True, the default, when the edge is painted with an arrowhead.

setDirected

public void setDirected(boolean directed)
Paints the edge with or without an arrowhead.

getStyleKey

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

setStyleKey

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

getUserData

public Object getUserData()
Anything the application keeps with the edge.

setUserData

public void setUserData(Object userData)
Sets the application’s data.

getRoute

public double[] getRoute()
The bend points an arrangement routed the edge through, as x, y pairs in world units, or null for a direct line between its ends.

setRoute

public void setRoute(double[] route)
Sets the bend points; null removes them.

touches

public boolean touches(String nodeId)
True when the edge touches the node with this id.