When you want to create a new node or
link, use the default implementations:
To create a linkset, create several links
with the same end nodes.
To set the end nodes of a link, apply the methods
setFromNode
(for the start node) and
setToNode
(for the end node).
A link cannot be displayed unless it has
end nodes, but you can create the link before you create the end
nodes.
The following examples show how to use the
classes for creating nodes and links.
How to create a node
IlpDefaultNetworkNode node = new IlpDefaultNetworkNode(MyAttributes,null);
network.setPosition(node,new IlpPoint(100,200), IlpPositionSource.BACKEND);
model.addRootObject(node);
How to create a link
IlpDefaultNetworkLink link = new IlpDefaultNetworkLink(MyAttributes,null);
link.setFromNode(node1);
link.setToNode(node2);
model.addRootObject(link);
network.getModel().addRootObject(node);
and
network.addRootObject(node);