ilog.cpl.network
Class IlpDefaultNetworkModel

java.lang.Object
  extended by ilog.cpl.graph.IlpAbstractGraphModel
      extended by ilog.cpl.network.IlpAbstractNetworkModel
          extended by ilog.cpl.network.IlpDefaultNetworkModel
All Implemented Interfaces:
IlpGraphModel, IlpMutableGraphModel, IlpMutableNetworkModel, IlpNetworkModel, IlvBatchable

public class IlpDefaultNetworkModel
extends IlpAbstractNetworkModel
implements IlpMutableNetworkModel

This class is the default implementation of the IlpNetworkModel interface. It contains a number of nodes (instances of IlpNetworkNode), links (instances of IlpNetworkLink) and possibly other representation objects.

This class attaches RepresentationNodeListeners 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.

Since:
JTGO 3.0

Constructor Summary
IlpDefaultNetworkModel()
          Constructor.
 
Method Summary
 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.
 
Methods inherited from class ilog.cpl.network.IlpAbstractNetworkModel
endChangingNetworkModel, fireAttributeValueEvent, fireNetworkModelEvent, startChangingNetworkModel
 
Methods inherited from class ilog.cpl.graph.IlpAbstractGraphModel
addModelListener, addRootObject, addRootObjects, addToObservationScope, clear, endBatch, fireModelEvent, getChildren, getFrom, getObservationScope, getParent, getRootObjects, getTo, isInObservationScope, isLeaf, removeFromObservationScope, removeModelListener, removeRootObject, removeRootObjects, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.cpl.network.IlpMutableNetworkModel
endChangingNetworkModel, startChangingNetworkModel
 
Methods inherited from interface ilog.cpl.graph.IlpGraphModel
getChildren, getFrom, getParent, getRootObjects, getTo, isLeaf
 
Methods inherited from interface ilog.cpl.graph.IlpMutableGraphModel
addRootObject, addRootObjects, clear, removeRootObject, removeRootObjects
 
Methods inherited from interface ilog.cpl.graph.IlpGraphModel
getChildren, getFrom, getParent, getRootObjects, getTo, isLeaf
 

Constructor Detail

IlpDefaultNetworkModel

public IlpDefaultNetworkModel()
Constructor.

Method Detail

isNode

public boolean isNode(IlpRepresentationObject object)
Returns true if a network object is a node in this model.

Specified by:
isNode in interface IlpGraphModel
Specified by:
isNode in class IlpAbstractGraphModel
Parameters:
object - The object to be checked.
Returns:
true if the object is an instance of IlpNetworkNode and not an instance of IlpNetworkLink.
See Also:
IlpGraphModel.isLink(ilog.cpl.model.IlpRepresentationObject)

isLink

public boolean isLink(IlpRepresentationObject object)
Returns 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.

Specified by:
isLink in interface IlpGraphModel
Specified by:
isLink in class IlpAbstractGraphModel
Parameters:
object - The object to be checked.
Returns:
true if the object is a link in this model; false otherwise.
See Also:
IlpGraphModel.isNode(ilog.cpl.model.IlpRepresentationObject)

noteChildrenAdded

protected void noteChildrenAdded(IlpRepresentationNode node,
                                 int[] indices,
                                 IlpRepresentationNode[] children)
Specified by:
noteChildrenAdded in class IlpAbstractGraphModel
Internal method or field: do not use!

noteChildrenRemoved

protected void noteChildrenRemoved(IlpRepresentationNode node,
                                   int[] indices,
                                   IlpRepresentationNode[] children)
Specified by:
noteChildrenRemoved in class IlpAbstractGraphModel
Internal method or field: do not use!

noteEndChanged

protected void noteEndChanged(IlpRepresentationLink link,
                              boolean origin,
                              IlpRepresentationNode oldEnd,
                              IlpRepresentationNode newEnd)
Specified by:
noteEndChanged in class IlpAbstractGraphModel
Internal method or field: do not use!

noteRootAdded

protected void noteRootAdded(IlpRepresentationNode root)
Specified by:
noteRootAdded in class IlpAbstractGraphModel
Internal method or field: do not use!

noteRootsAdded

protected void noteRootsAdded(Collection roots)
Specified by:
noteRootsAdded in class IlpAbstractGraphModel
Internal method or field: do not use!

noteRootRemoved

protected void noteRootRemoved(IlpRepresentationNode root)
Specified by:
noteRootRemoved in class IlpAbstractGraphModel
Internal method or field: do not use!

noteRootsRemoved

protected void noteRootsRemoved(Collection roots)
Specified by:
noteRootsRemoved in class IlpAbstractGraphModel
Internal method or field: do not use!

addNetworkModelListener

public void addNetworkModelListener(NetworkModelListener listener)
Adds a listener that is notified each time a change to this model occurs.

Specified by:
addNetworkModelListener in interface IlpNetworkModel
Overrides:
addNetworkModelListener in class IlpAbstractNetworkModel
Parameters:
listener - The listener to be registered.
Internal method or field: do not use!

removeNetworkModelListener

public void removeNetworkModelListener(NetworkModelListener listener)
Removes a listener previously added with addModelListener.

Specified by:
removeNetworkModelListener in interface IlpNetworkModel
Overrides:
removeNetworkModelListener in class IlpAbstractNetworkModel
Parameters:
listener - The listener to be unregistered.
Internal method or field: do not use!


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.