public class IlpDefaultNetworkModel extends IlpAbstractNetworkModel implements IlpMutableNetworkModel
IlpNetworkModel
interface. It contains a number of nodes (instances of
IlpNetworkNode
), links (instances of IlpNetworkLink
)
and possibly other representation objects.
This class attaches RepresentationNodeListener
s to the
objects in the model. It is automatically notified when the list of
children of an object changes.
Note: If a link is added to the model before its end nodes have been added, the view will not display it until both end nodes have also been added to the model.
Constructor and Description |
---|
IlpDefaultNetworkModel()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addNetworkModelListener(NetworkModelListener listener)
Adds a listener that is notified each time a change to this model occurs.
|
boolean |
isLink(IlpRepresentationObject object)
Returns
true if a network object is a link in this model. |
boolean |
isNode(IlpRepresentationObject object)
Returns
true if a network object is a node in this model. |
protected void |
noteChildrenAdded(IlpRepresentationNode node,
int[] indices,
IlpRepresentationNode[] children) |
protected void |
noteChildrenRemoved(IlpRepresentationNode node,
int[] indices,
IlpRepresentationNode[] children) |
protected void |
noteEndChanged(IlpRepresentationLink link,
boolean origin,
IlpRepresentationNode oldEnd,
IlpRepresentationNode newEnd) |
protected void |
noteRootAdded(IlpRepresentationNode root) |
protected void |
noteRootRemoved(IlpRepresentationNode root) |
protected void |
noteRootsAdded(Collection roots) |
protected void |
noteRootsRemoved(Collection roots) |
void |
removeNetworkModelListener(NetworkModelListener listener)
Removes a listener previously added with
addModelListener . |
endChangingNetworkModel, fireAttributeValueEvent, fireNetworkModelEvent, startChangingNetworkModel
addModelListener, addRootObject, addRootObjects, addToObservationScope, clear, endBatch, fireModelEvent, getChildren, getFrom, getObservationScope, getParent, getRootObjects, getTo, isInObservationScope, isLeaf, removeFromObservationScope, removeModelListener, removeRootObject, removeRootObjects, startBatch
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endChangingNetworkModel, startChangingNetworkModel
addRootObject, addRootObjects, clear, removeRootObject, removeRootObjects
getChildren, getFrom, getParent, getRootObjects, getTo, isLeaf
public boolean isNode(IlpRepresentationObject object)
true
if a network object is a node in this model.isNode
in interface IlpGraphModel
isNode
in class IlpAbstractGraphModel
object
- The object to be checked.true
if the object is an instance of
IlpNetworkNode
and not an instance of
IlpNetworkLink
.IlpGraphModel.isLink(ilog.cpl.model.IlpRepresentationObject)
public boolean isLink(IlpRepresentationObject object)
true
if a network object is a link in this model.
In this implementation, true
is returned if the object is an instance of
IlpNetworkLink
.
isLink
in interface IlpGraphModel
isLink
in class IlpAbstractGraphModel
object
- The object to be checked.true
if the object is a link in this model;
false
otherwise.IlpGraphModel.isNode(ilog.cpl.model.IlpRepresentationObject)
protected void noteChildrenAdded(IlpRepresentationNode node, int[] indices, IlpRepresentationNode[] children)
noteChildrenAdded
in class IlpAbstractGraphModel
protected void noteChildrenRemoved(IlpRepresentationNode node, int[] indices, IlpRepresentationNode[] children)
noteChildrenRemoved
in class IlpAbstractGraphModel
protected void noteEndChanged(IlpRepresentationLink link, boolean origin, IlpRepresentationNode oldEnd, IlpRepresentationNode newEnd)
noteEndChanged
in class IlpAbstractGraphModel
protected void noteRootAdded(IlpRepresentationNode root)
noteRootAdded
in class IlpAbstractGraphModel
protected void noteRootsAdded(Collection roots)
noteRootsAdded
in class IlpAbstractGraphModel
protected void noteRootRemoved(IlpRepresentationNode root)
noteRootRemoved
in class IlpAbstractGraphModel
protected void noteRootsRemoved(Collection roots)
noteRootsRemoved
in class IlpAbstractGraphModel
public void addNetworkModelListener(NetworkModelListener listener)
addNetworkModelListener
in interface IlpNetworkModel
addNetworkModelListener
in class IlpAbstractNetworkModel
listener
- The listener to be registered.public void removeNetworkModelListener(NetworkModelListener listener)
addModelListener
.removeNetworkModelListener
in interface IlpNetworkModel
removeNetworkModelListener
in class IlpAbstractNetworkModel
listener
- The listener to be unregistered.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.