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

public interface GraphNodeRenderer

Known subtypesDefaultGraphNodeRenderer

Paints a node. DefaultGraphNodeRenderer paints a card with a title, a description and the ports; implement this, or extend that, for nodes of your own design.

A renderer draws in screen pixels; the rectangle is the node’s world rectangle at the current zoom. Below NodeGraph.getDetailZoom a renderer should draw no text, which would be unreadable and costs most of a frame in a large graph.

Methods

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

Method details

paintNode

public abstract 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