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

public class DefaultGraphEdgeRenderer

  1. Object
  2. DefaultGraphEdgeRenderer

ImplementsGraphEdgeRenderer

Paints an edge as a line with an arrowhead on a directed edge and its label in a pill at the middle.

Colours come from NodeGraphEdge (the line) and NodeGraphEdgeLabel (the pill and its text); a selected edge takes the colour of NodeGraphNodeSelected. An edge’s style key picks a colour from setColor.

Constructors

public DefaultGraphEdgeRenderer()

Methods

public boolean isColorByPortType()True when an edge takes the colour of the port it leaves.
public void setColorByPortType(boolean colorByPortType)Draws an edge that has no colour of its own in the colour its source port’s type has in the graph’s DefaultGraphNodeRenderer, so the wires of a node editor read by type.
public void setColor(String styleKey, int rgb)Maps an edge style key to a line colour.
public void paintEdge(Graphics g, NodeGraph graph, GraphEdge edge, double[] xs, double[] ys, int count, boolean selected)Paints edge through the points.

Inherited methods

Constructor details

DefaultGraphEdgeRenderer

public DefaultGraphEdgeRenderer()

Method details

isColorByPortType

public boolean isColorByPortType()
True when an edge takes the colour of the port it leaves.

setColorByPortType

public void setColorByPortType(boolean colorByPortType)
Draws an edge that has no colour of its own in the colour its source port’s type has in the graph’s DefaultGraphNodeRenderer, so the wires of a node editor read by type. Off by default.

setColor

public void setColor(String styleKey, int rgb)
Maps an edge style key to a line colour.

paintEdge

public void paintEdge(Graphics g, NodeGraph graph, GraphEdge edge, double[] xs, double[] ys, int count, boolean selected)
Paints edge through the points.

Parameters

g Graphics
the graphics
graph NodeGraph
the component
edge GraphEdge
the edge
xs double[]
, ys: the path on screen, from the source to the target; curves are already flattened into points
ys double[]
Not documented.
count int
how many points of the arrays are used
selected boolean
true when the edge is selected