Class DefaultGraphNodeRenderer
java.lang.Object
com.codename1.ui.graph.DefaultGraphNodeRenderer
- All Implemented Interfaces:
GraphNodeRenderer
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe colour of a style key, orfallbackwhen none was set.voidpaintNode(Graphics g, NodeGraph graph, GraphNode node, int x, int y, int w, int h, boolean selected) Paintsnodeinto the rectangle.voidMaps a node style key to the colour of its strip and its ports.
-
Constructor Details
-
DefaultGraphNodeRenderer
public DefaultGraphNodeRenderer()
-
-
Method Details
-
setAccent
Maps a node style key to the colour of its strip and its ports. -
getAccent
The colour of a style key, orfallbackwhen none was set. -
paintNode
public void paintNode(Graphics g, NodeGraph graph, GraphNode node, int x, int y, int w, int h, boolean selected) Description copied from interface:GraphNodeRendererPaints
nodeinto the rectangle.Parameters
g: the graphics, with the colour and alpha the renderer may changegraph: the component, for its zoom and its port geometrynode: the nodex,y,w,h: the node on screenselected: true when the node is in the selection
- Specified by:
paintNodein interfaceGraphNodeRenderer
-