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

public class DefaultGraphNodeRenderer

  1. Object
  2. DefaultGraphNodeRenderer

ImplementsGraphNodeRenderer

Paints a node as a rounded card: a coloured strip on the leading edge, the label, the description under it, and the ports on the sides with their labels inside the card.

Colours come from the NodeGraphNode UIID (background, text) and NodeGraphNodeSelected (the outline of a selected node), ports from NodeGraphPort. A node’s style key picks its strip colour from setAccent; a node without one uses the selection colour.

Constructors

public DefaultGraphNodeRenderer()

Methods

public void setAccent(String styleKey, int rgb)Maps a node style key to the colour of its strip and its ports.
public int getAccent(String styleKey, int fallback)The colour of a style key, or fallback when none was set.
public void paintNode(Graphics g, NodeGraph graph, GraphNode node, int x, int y, int w, int h, boolean selected)Paints node into the rectangle.

Inherited methods

Constructor details

DefaultGraphNodeRenderer

public DefaultGraphNodeRenderer()

Method details

setAccent

public void setAccent(String styleKey, int rgb)
Maps a node style key to the colour of its strip and its ports.

getAccent

public int getAccent(String styleKey, int fallback)
The colour of a style key, or fallback when none was set.

paintNode

public void paintNode(Graphics g, NodeGraph graph, GraphNode node, int x, int y, int w, int h, boolean selected)
Paints node into the rectangle.

Parameters

g Graphics
the graphics, with the colour and alpha the renderer may change
graph NodeGraph
the component, for its zoom and its port geometry
node GraphNode
the node
x int
, y, w, h: the node on screen
y int
Not documented.
w int
Not documented.
h int
Not documented.
selected boolean
true when the node is in the selection