Class GraphPort
java.lang.Object
com.codename1.graph.GraphPort
A place on a GraphNode where edges attach, as in a node editor.
A node with no ports is connected node to node, as in a system diagram. Ports are ordered on their side of the node in the order they were added.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintINPUTorOUTPUT.getId()The id, unique within the node.getLabel()The label, or null.intHow many edges may attach, or -1 for any number.getNode()The node the port belongs to, or null before it is added to one.getType()The data type edges must agree on, or null for any.booleanisInput()True for anINPUTport.voidSets the label.voidsetMaxConnections(int maxConnections) Limits the edges that may attach; -1 for any number.voidSets the data type.
-
Field Details
-
INPUT
public static final int INPUTThe port takes incoming edges and sits on the leading side of the node.- See Also:
-
OUTPUT
public static final int OUTPUTThe port starts outgoing edges and sits on the trailing side.- See Also:
-
-
Constructor Details
-
GraphPort
-
-
Method Details
-
getId
The id, unique within the node. -
getDirection
public int getDirection()INPUTorOUTPUT. -
isInput
public boolean isInput()True for anINPUTport. -
getLabel
The label, or null. -
setLabel
Sets the label. -
getType
The data type edges must agree on, or null for any. -
setType
Sets the data type. -
getMaxConnections
public int getMaxConnections()How many edges may attach, or -1 for any number. -
setMaxConnections
public void setMaxConnections(int maxConnections) Limits the edges that may attach; -1 for any number. -
getNode
The node the port belongs to, or null before it is added to one.
-