Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class DefaultGraphNodeRenderer
- Object
- 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
gGraphics- the graphics, with the colour and alpha the renderer may change
graphNodeGraph- the component, for its zoom and its port geometry
nodeGraphNode- the node
xint- ,
y,w,h: the node on screen yint- Not documented.
wint- Not documented.
hint- Not documented.
selectedboolean- true when the node is in the selection