public class IlvDefaultSDMModel extends IlvAbstractSDMModel
IlvDefaultSDMModel
is a subclass of IlvAbstractSDMModel
that stores the SDM nodes and links in memory.Constructor and Description |
---|
IlvDefaultSDMModel()
Creates a new, empty SDM model.
|
Modifier and Type | Method and Description |
---|---|
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.
|
createLink, createNode, getChildren, getFrom, getIDImpl, getObjectProperty, getObjectPropertyNames, getParent, getTag, getTo, isEditable, isLink, setEditable, setFrom, setObjectProperty, setTo
addObject, addSDMModelListener, addSDMPropertyChangeListener, allocID, contains, fireAdjustmentFinished, fireDataChanged, fireIDChanged, fireLinkDestinationChanged, fireLinkSourceChanged, fireObjectAdded, fireObjectRemoved, firePropertyChanged, firePropertyChanged, getID, isAdjusting, removeSDMModelListener, removeSDMPropertyChangeListener, setAdjusting, setID
public IlvDefaultSDMModel()
addNode
and addLink
methods.public void clear()
protected void addObjectImpl(Object object, Object parent, Object before)
addObjectImpl
in class IlvBasicSDMModel
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.protected void setIDImpl(Object obj, String id)
setIDImpl
in class IlvAbstractSDMModel
obj
- The object whose identifier is to be changed.id
- The new identifier.IlvBasicSDMModel.setID(java.lang.Object, java.lang.String)
public void removeObject(Object object)
removeObject
in interface IlvSDMModel
removeObject
in class IlvBasicSDMModel
object
- The object to remove.public Enumeration getObjects()
IlvSDMNode
s.public int getObjectCount()
public int getObjectIndex(Object obj)
This method is internal, just to enable a feature in the dashboard. It must be completed before becoming public.
obj
- an object.-1
if the object is not found.public void moveObjectTo(Object obj, int index)
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.
index
- where to move the new component.obj
- the component to insert.ArrayIndexOutOfBoundsException
- if the index was invalid.public Object getObject(String id)
id
.
getObject
in interface IlvSDMModel
getObject
in class IlvBasicSDMModel
id
- The identifier of the requested object.id
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.