ilog.views.sdm.model
Class IlvDefaultSDMModel

java.lang.Object
  extended by ilog.views.sdm.model.IlvBasicSDMModel
      extended by ilog.views.sdm.model.IlvAbstractSDMModel
          extended by ilog.views.sdm.model.IlvDefaultSDMModel
All Implemented Interfaces:
IlvSDMModel, Serializable

public class IlvDefaultSDMModel
extends IlvAbstractSDMModel

The class IlvDefaultSDMModel is a subclass of IlvAbstractSDMModel that stores the SDM nodes and links in memory.

Since:
JViews 4.0
See Also:
Serialized Form

Constructor Summary
IlvDefaultSDMModel()
          Creates a new, empty SDM model.
 
Method Summary
protected  void addObjectImpl(Object object, Object parent, Object before)
          Adds a node or a link to this SDM model.
 void clear()
          Removes all the objects from this model.
 Object getObject(String id)
          Returns the object of the model whose identifier is id.
 int getObjectCount()
          Returns the number of objects (nodes or links) contained in this model (not including the objects contained in subobjects).
 int getObjectIndex(Object obj)
          Returns the index of given object among the toplevel objects.
 Enumeration getObjects()
          Returns all the data objects added to this SDM model.
 void moveObjectTo(Object obj, int index)
          Moves the specified object as a component in the toplevel object list at the specified index.
 void removeObject(Object object)
          Removes a node or a link from this SDM model.
protected  void setIDImpl(Object obj, String id)
          Sets the identifier of an object.
 
Methods inherited from class ilog.views.sdm.model.IlvAbstractSDMModel
createLink, createNode, getChildren, getFrom, getIDImpl, getObjectProperty, getObjectPropertyNames, getParent, getTag, getTo, isEditable, isLink, setEditable, setFrom, setObjectProperty, setTo
 
Methods inherited from class ilog.views.sdm.model.IlvBasicSDMModel
addObject, addSDMModelListener, addSDMPropertyChangeListener, allocID, contains, fireAdjustmentFinished, fireDataChanged, fireIDChanged, fireLinkDestinationChanged, fireLinkSourceChanged, fireObjectAdded, fireObjectRemoved, firePropertyChanged, getID, isAdjusting, removeSDMModelListener, removeSDMPropertyChangeListener, setAdjusting, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDefaultSDMModel

public IlvDefaultSDMModel()
Creates a new, empty SDM model. The SDM must be populated by calling the addNode and addLink methods.

Method Detail

clear

public void clear()
Removes all the objects from this model. After this call, the contents of this model are as if the model had just been created.


addObjectImpl

protected void addObjectImpl(Object object,
                             Object parent,
                             Object before)
Adds a node or a link to this SDM model.

Overrides:
addObjectImpl in class IlvBasicSDMModel
Parameters:
object - The object to add.
parent - The parent if the object is to be added to a submodel, or null otherwise.
before - The object before which the new object must be inserted, or null if the new object must be appended to the list of children.

setIDImpl

protected void setIDImpl(Object obj,
                         String id)
Sets the identifier of an object.

Overrides:
setIDImpl in class IlvAbstractSDMModel
Parameters:
obj - The object whose identifier is to be changed.
id - The new identifier.
See Also:
IlvBasicSDMModel.setID(java.lang.Object, java.lang.String)

removeObject

public void removeObject(Object object)
Removes a node or a link from this SDM model.

Specified by:
removeObject in interface IlvSDMModel
Overrides:
removeObject in class IlvBasicSDMModel
Parameters:
object - The object to remove.

getObjects

public Enumeration getObjects()
Returns all the data objects added to this SDM model.

Returns:
An enumeration of IlvSDMNodes.

getObjectCount

public int getObjectCount()
Returns the number of objects (nodes or links) contained in this model (not including the objects contained in subobjects).


getObjectIndex

public int getObjectIndex(Object obj)
Returns the index of given object among the toplevel objects.

This method is internal, just to enable a feature in the dashboard. It must be completed before becoming public.

Parameters:
obj - an object.
Returns:
the index of the first occurrence of the argument among the toplevel children of the model. returns -1 if the object is not found.
Since:
Jviews 8.0
Internal method or field: do not use!

moveObjectTo

public void moveObjectTo(Object obj,
                         int index)
Moves the specified object as a component in the toplevel object list at the specified index. Each component in this list with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

The index must be a value greater than to 0 and less than or equal to the current size - 1 of the list.

This method is internal, just to enable a feature in the dashbaord. It must be completed before becoming public.

Parameters:
index - where to move the new component.
obj - the component to insert.
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
Since:
Jviews 8.0
Internal method or field: do not use!

getObject

public Object getObject(String id)
Returns the object of the model whose identifier is id.

Specified by:
getObject in interface IlvSDMModel
Overrides:
getObject in class IlvBasicSDMModel
Parameters:
id - The identifier of the requested object.
Returns:
The object whose identifier is id.


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