public interface INode extends IPortOwner, ILabelOwner
IGraph
.
This interface provides read-only access to the properties of a node. In order to modify the state of an instance use
the various methods provided by the IGraph
this instance belongs to. Nodes and edges
are the main
entities that make up an IGraph
. Nodes have zero or more Ports
to which zero or
more edges can connect. IGraph
provides the IGraph.edgesAt(IPortOwner, AdjacencyTypes)
method for
querying the edges that connect to nodes. Also it is possible to query the adjacent edges for each port
that is owned by nodes. This interface combines the functionality of IPortOwner
to get access to the ports, ILabelOwner
to get access to the labels, and, like all items in an IGraph
, nodes support the ILookup.lookup(java.lang.Class)
method inherited from the IModelItem
interface can be used to query additional aspects of each instance.
The graph model with all relevant types and their relationships is presented in detail in the section The Graph Model.
Using the look-up mechanism is explained in the section Service Locator Pattern: Lookup.
Modifier and Type | Method and Description |
---|---|
IRectangle |
getLayout()
Returns a live view of the layout of the node.
|
INodeStyle |
getStyle()
Returns the style that is responsible for the visual representation of this node in a
CanvasControl . |
getPorts
getLabels
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, lookup, safeLookup
IRectangle getLayout()
The layout of a node is a rectangle in the world coordinate system that describes the bounding box of the representation
of a node. Since this method will yield a live view, it is up to the client to copy the values of the instance if a
snapshot of the state is needed. In order to modify the layout of a node, use the various methods
in IGraph
.
INodeStyle getStyle()
CanvasControl
.
In order to set the style on an instance, use the IGraph.setStyle(INode, INodeStyle)
method. Note that the style instance associated with a node instance may be shared between multiple node instances and
that the modification of this style will result in a change of the appearance of all nodes that are associated with the
same style instance.