Class GraphNodeTemplate
java.lang.Object
com.codename1.graph.GraphNodeTemplate
A kind of node a user can add: what a com.codename1.ui.graph.GraphPalette
lists, and what a node editor calls a node type.
GraphNodeTemplate decision = new GraphNodeTemplate("Decision")
.setShape(GraphShapes.DECISION).setSize(140, 90);
GraphNodeTemplate add = new GraphNodeTemplate("Add")
.addInput("a", "A", "number").addInput("b", "B", "number")
.addOutput("sum", "Sum", "number");
Override create to make nodes that carry data of your own.
-
Constructor Summary
ConstructorsConstructorDescriptionGraphNodeTemplate(String name) A template whose nodes are labeled with its name. -
Method Summary
Modifier and TypeMethodDescriptionGives new nodes an input port.Gives new nodes an output port.Makes a node at the origin; the view places it.The description new nodes get, or null.doubleThe height of new nodes in world units.getLabel()The label new nodes get.getName()The name a palette shows.getShape()The outline of new nodes, one of theGraphShapesnames, or null.The style key of new nodes, or null.doublegetWidth()The width of new nodes in world units.booleanhasPorts()True when new nodes have ports.setDescription(String description) Sets the description new nodes get.Sets the label new nodes get.Sets the outline of new nodes.setSize(double width, double height) Sets the size of new nodes in world units.setStyleKey(String styleKey) Sets the style key of new nodes.
-
Constructor Details
-
GraphNodeTemplate
A template whose nodes are labeled with its name.
-
-
Method Details
-
getName
The name a palette shows. -
getLabel
The label new nodes get. -
setLabel
Sets the label new nodes get. -
getDescription
The description new nodes get, or null. -
setDescription
Sets the description new nodes get. -
getShape
The outline of new nodes, one of theGraphShapesnames, or null. -
setShape
Sets the outline of new nodes. -
getStyleKey
The style key of new nodes, or null. -
setStyleKey
Sets the style key of new nodes. -
getWidth
public double getWidth()The width of new nodes in world units. -
getHeight
public double getHeight()The height of new nodes in world units. -
setSize
Sets the size of new nodes in world units. -
addInput
Gives new nodes an input port. -
addOutput
Gives new nodes an output port. -
hasPorts
public boolean hasPorts()True when new nodes have ports. -
create
-