public class IlvFilterSDMModel extends IlvBasicSDMModel implements SDMModelListener, SDMPropertyChangeListener
IlvFilterSDMModel
is
a base class for SDM models that encapsulate
other models.
Filtering models are useful to provide control logic for an existing data model (such as the default model).
All the methods of the filtering model are implemented by calls to the corresponding methods of the filtered model. Subclasses will redefine one or several methods to define additional functionalities.
The filtering model automatically propagates notification events from the filtered model to its own listeners.
Constructor and Description |
---|
IlvFilterSDMModel()
Creates a new filtering model with no filtered model
specified.
|
IlvFilterSDMModel(IlvSDMModel filteredModel)
Creates a new filtering model for a specified filtered model.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(Object object,
Object parent,
Object before)
This method calls the
addObject method of the filtered model. |
protected void |
addObjectImpl(Object object,
Object parent,
Object before)
This method calls
addObject(java.lang.Object, java.lang.Object, java.lang.Object) . |
void |
adjustmentFinished(SDMModelEvent event)
This method is called at the end of an adjustment sequence on the underlying filtered model.
|
void |
clear()
This method calls the
clear method of the filtered model. |
Object |
createLink(String tag)
This method calls the
createLink method of the filtered model. |
Object |
createNode(String tag)
This method calls the
createNode method of the filtered model. |
void |
dataChanged(SDMModelEvent event)
This method is called when the contents of the underlying filtered model are changed.
|
Enumeration |
getChildren(Object parent)
This method calls the
getChildren method of the filtered model. |
IlvSDMModel |
getFilteredModel()
Returns the filtered model, that is, the model that
this filtering model encapsulates.
|
Object |
getFrom(Object link)
This method calls the
getFrom method of the filtered model. |
String |
getID(Object obj)
Returns the identifier of the object.
|
protected String |
getIDImpl(Object obj)
Returns the identifier of the object.
|
Object |
getObject(String id)
Returns the object of the model whose identifier is
id . |
Object |
getObjectProperty(Object obj,
String property)
This method calls the
getObjectProperty method of the filtered model. |
String[] |
getObjectPropertyNames(Object obj)
This method calls the
getObjectPropertyNames method of the filtered model. |
Enumeration |
getObjects()
This method calls the
getObjects method of the filtered model. |
Object |
getParent(Object object)
This method calls the
getParent method of the filtered model. |
String |
getTag(Object obj)
Returns the symbolic type (the "tag") of an object.
|
Object |
getTo(Object link)
This method calls the
getTo method of the filtered model. |
boolean |
isAdjusting()
This method calls the
isAdjusting method of the filtered model. |
boolean |
isEditable()
This method calls the
isEditable method of the filtered model. |
boolean |
isLink(Object obj)
This method calls the
isLink method of the filtered model. |
void |
linkDestinationChanged(SDMModelEvent event)
This method is called when the destination of a link has changed in the underlying filtered model.
|
void |
linkSourceChanged(SDMModelEvent event)
This method is called when the source of a link has changed in the underlying filtered model.
|
void |
objectAdded(SDMModelEvent event)
This method is called when an object is added to the underlying filtered model.
|
void |
objectRemoved(SDMModelEvent event)
This method is called when an object is removed from the underlying filtered model.
|
void |
propertyChanged(SDMPropertyChangeEvent event)
This method is called when a property of an object of the underlying filtered model is changed.
|
void |
removeObject(Object object)
This method calls the
removeObject method of the filtered model. |
void |
setAdjusting(boolean adjusting)
This method calls the
setAdjusting method of the filtered model. |
void |
setFilteredModel(IlvSDMModel model)
Sets the filtered model, that is, the model that
this filtering model encapsulates.
|
void |
setFrom(Object link,
Object node)
This method calls the
setFrom method of the filtered model. |
void |
setID(Object obj,
String id)
Sets the identifier of an object.
|
protected void |
setIDImpl(Object obj,
String id)
Sets the identifier of an object.
|
void |
setObjectProperty(Object object,
String property,
Object value)
This method calls the
setObjectProperty method of the filtered model. |
void |
setTo(Object link,
Object node)
This method calls the
setTo method of the filtered model. |
addSDMModelListener, addSDMPropertyChangeListener, allocID, contains, fireAdjustmentFinished, fireDataChanged, fireIDChanged, fireLinkDestinationChanged, fireLinkSourceChanged, fireObjectAdded, fireObjectRemoved, firePropertyChanged, firePropertyChanged, removeSDMModelListener, removeSDMPropertyChangeListener
public IlvFilterSDMModel()
setFilteredModel(ilog.views.sdm.IlvSDMModel)
to specify
the filtered model.public IlvFilterSDMModel(IlvSDMModel filteredModel)
filteredModel
- The model that this filtering model
encapsulates.public void setFilteredModel(IlvSDMModel model)
model
- The new filtered model.public IlvSDMModel getFilteredModel()
public Enumeration getObjects()
getObjects
method of the filtered model.getObjects
in interface IlvSDMModel
IlvGraphic
s by the
IlvSDMViewRenderer
associated with the
IlvSDMView
. The returned enumeration
can be null
if the model has no objects.public Enumeration getChildren(Object parent)
getChildren
method of the filtered model.getChildren
in interface IlvSDMModel
getChildren
in class IlvBasicSDMModel
parent
- The parent object.null
.public Object getParent(Object object)
getParent
method of the filtered model.getParent
in interface IlvSDMModel
getParent
in class IlvBasicSDMModel
object
- The child object.null
.public boolean isLink(Object obj)
isLink
method of the filtered model.isLink
in interface IlvSDMModel
isLink
in class IlvBasicSDMModel
obj
- The object whose type is queried.false
.public Object getFrom(Object link)
getFrom
method of the filtered model.getFrom
in interface IlvSDMModel
getFrom
in class IlvBasicSDMModel
link
- The link whose source node is queried.null
.public Object getTo(Object link)
getTo
method of the filtered model.getTo
in interface IlvSDMModel
getTo
in class IlvBasicSDMModel
link
- The link whose destination node is queried.null
.public String getID(Object obj)
This method simply calls the filtered model.
getID
in interface IlvSDMModel
getID
in class IlvBasicSDMModel
obj
- The object whose identifier is requested.String
that identifies the object in a unique way.protected String getIDImpl(Object obj)
This method calls getID(obj)
.
getIDImpl
in class IlvBasicSDMModel
obj
- The object whose identifier is requested.String
that identifies the object in a unique way.IlvBasicSDMModel.getID(java.lang.Object)
public void setID(Object obj, String id)
This method simply calls the filtered model.
setID
in interface IlvSDMModel
setID
in class IlvBasicSDMModel
obj
- The object whose identifier is to be changed.id
- The new identifier.protected void setIDImpl(Object obj, String id)
This method calls setID(obj, id)
.
setIDImpl
in class IlvBasicSDMModel
obj
- The object whose identifier is to be changed.id
- The new identifier.IlvBasicSDMModel.setID(java.lang.Object, java.lang.String)
public Object getObject(String id)
id
.
This method simply calls the filtered model.
getObject
in interface IlvSDMModel
getObject
in class IlvBasicSDMModel
id
- The identifier of the requested object.id
.public String getTag(Object obj)
This method simply calls the filtered model.
getTag
in interface IlvSDMModel
obj
- The object whose tag is requested.String
that identifies the symbolic type of the object.public Object getObjectProperty(Object obj, String property)
getObjectProperty
method of the filtered model.getObjectProperty
in interface IlvSDMModel
obj
- The object whose property is queried.property
- The name of the property.Object
representing the
value of the specified property, or null
if the object does not have or support the specified
property.public String[] getObjectPropertyNames(Object obj)
getObjectPropertyNames
method of the filtered model.getObjectPropertyNames
in interface IlvSDMModel
obj
- The object whose property names are queried.public boolean isEditable()
isEditable
method of the filtered model.isEditable
in interface IlvSDMModel
isEditable
in class IlvBasicSDMModel
public void addObject(Object object, Object parent, Object before)
addObject
method of the filtered model.
addObject
in interface IlvSDMModel
addObject
in class IlvBasicSDMModel
object
- The new object to add to the model.parent
- The parent if the new object must be added
to a submodel, or null
if the new object
is a top-level object.before
- An existing object of the model before which
the new object must be inserted. You can pass null
to append the new object at the end of the model.protected void addObjectImpl(Object object, Object parent, Object before)
addObject(java.lang.Object, java.lang.Object, java.lang.Object)
.
addObjectImpl
in class IlvBasicSDMModel
object
- The new object to add to the model.parent
- The parent if the new object must be added
to a submodel, or null
if the new object
is a top-level object.before
- An existing object of the model before which
the new object must be inserted. You can pass null
to append the new object at the end of the model.public void removeObject(Object object)
removeObject
method of the filtered model.removeObject
in interface IlvSDMModel
removeObject
in class IlvBasicSDMModel
object
- The object to remove.public void setObjectProperty(Object object, String property, Object value)
setObjectProperty
method of the filtered model.setObjectProperty
in interface IlvSDMModel
setObjectProperty
in class IlvBasicSDMModel
object
- The object whose property must be set.property
- The name of the property to set.value
- The new value of the property.public Object createNode(String tag)
createNode
method of the filtered model.createNode
in interface IlvSDMModel
createNode
in class IlvBasicSDMModel
tag
- The tag of the new node.public Object createLink(String tag)
createLink
method of the filtered model.createLink
in interface IlvSDMModel
createLink
in class IlvBasicSDMModel
tag
- The tag of the new link.public void setFrom(Object link, Object node)
setFrom
method of the filtered model.setFrom
in interface IlvSDMModel
setFrom
in class IlvBasicSDMModel
link
- The link whose source node must be set.node
- The new source node of the link.public void setTo(Object link, Object node)
setTo
method of the filtered model.setTo
in interface IlvSDMModel
setTo
in class IlvBasicSDMModel
link
- The link whose destination node must be set.node
- The new destination node of the link.public void setAdjusting(boolean adjusting)
setAdjusting
method of the filtered model.setAdjusting
in interface IlvSDMModel
setAdjusting
in class IlvBasicSDMModel
adjusting
- The value of the adjusting flag.public boolean isAdjusting()
isAdjusting
method of the filtered model.isAdjusting
in interface IlvSDMModel
isAdjusting
in class IlvBasicSDMModel
public void clear()
clear
method of the filtered model.clear
in interface IlvSDMModel
public void objectAdded(SDMModelEvent event)
IlvBasicSDMModel.fireObjectAdded(java.lang.Object)
to propagate
the event to the listeners of this filtering model.objectAdded
in interface SDMModelListener
event
- The event that was fired by the filtered model.public void objectRemoved(SDMModelEvent event)
IlvBasicSDMModel.fireObjectRemoved(java.lang.Object)
to propagate
the event to the listeners of this filtering model.objectRemoved
in interface SDMModelListener
event
- The event that was fired by the filtered model.public void dataChanged(SDMModelEvent event)
IlvBasicSDMModel.fireDataChanged(java.lang.Object)
to propagate
the event to the listeners of this filtering model.dataChanged
in interface SDMModelListener
event
- The event that was fired by the filtered model.public void linkSourceChanged(SDMModelEvent event)
IlvBasicSDMModel.fireLinkSourceChanged(java.lang.Object)
to propagate
the event to the listeners of this filtering model.linkSourceChanged
in interface SDMModelListener
event
- The event that was fired by the filtered model.public void linkDestinationChanged(SDMModelEvent event)
IlvBasicSDMModel.fireLinkDestinationChanged(java.lang.Object)
to propagate
the event to the listeners of this filtering model.linkDestinationChanged
in interface SDMModelListener
event
- The event that was fired by the filtered model.public void adjustmentFinished(SDMModelEvent event)
IlvBasicSDMModel.fireAdjustmentFinished()
to propagate
the event to the listeners of this filtering model.adjustmentFinished
in interface SDMModelListener
event
- The event that was fired by the filtered model.public void propertyChanged(SDMPropertyChangeEvent event)
IlvBasicSDMModel.firePropertyChanged(java.lang.Object, java.lang.String, java.lang.Object, java.lang.Object)
to propagate
the event to the listeners of this filtering model.propertyChanged
in interface SDMPropertyChangeListener
event
- The event that was fired by the filtered model.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.