public class TLcdModelTreeNodeSupport extends Object implements ILcdModelContainer
This is a utility class that can be used to create an
ILcdModelTreeNode
implementation.
This utility class provides support for all the methods in ILcdModelTreeNode
which are not
inherited from ILcdModel
.
As a consequence, this class is ideal for creating ILcdModelTreeNode
implementations
based on an existing ILcdModel
implementation. All those ILcdModelTreeNode
methods can then be delegated to an instance of this class.
Constructor and Description |
---|
TLcdModelTreeNodeSupport(ILcdModelTreeNode aNode)
Creates a new support object for node
aNode |
Modifier and Type | Method and Description |
---|---|
void |
addHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Registers the given
ILcdModelContainerListener to receive TLcdModelContainerEvent s from all the
ILcdModelTreeNode s contained in the tree with this node as root node. |
void |
addHierarchyModelListener(ILcdModelListener aModelListener)
Registers the given
ILcdModelListener to receive
TLcdModelChangedEvent s from all the ILcdModel s contained in the tree
with this node as root node. |
boolean |
addModel(ILcdModel aModel)
Add a new model to the container, and add the hierarchy listeners to it in order to be informed
of all the events in the newly added model
|
void |
addModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Registers the given
ILcdModelContainerListener to receive TLcdModelContainerEvent s for this model container. |
ILcdModel |
getModel(int aIndex)
Returns the
ILcdModel at the given index. |
int |
modelCount()
Returns the number of
ILcdModel objects contained in this
ILcdModelContainer . |
void |
modelProduced(TLcdModelProducerEvent e)
Notifies this ILcdModelProducerListener of a produced model.
|
Enumeration |
models()
Returns an
Enumeration of the ILcdModel objects contained in
this ILcdModelContainer . |
void |
removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Unregisters the given
ILcdModelContainerListener from receiving TLcdModelContainerEvent s for the tree
with the node for which this support is responsible as root node. |
void |
removeHierarchyModelListener(ILcdModelListener aModelListener)
Unregisters the given
ILcdModelListener from
receiving TLcdModelChangedEvent s for the tree with the node for which this support
is responsible as root node. |
boolean |
removeModel(ILcdModel aModel)
Remove a model from the container, and remove all the hierarchy listeners which were added
|
void |
removeModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Unregisters the given
ILcdModelContainerListener from receiving TLcdModelContainerEvent s from this model container |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModels
public TLcdModelTreeNodeSupport(ILcdModelTreeNode aNode)
aNode
aNode
- the node for which a support object is neededpublic boolean addModel(ILcdModel aModel)
addModel
in interface ILcdModelContainer
aModel
- the model to be added.true
if this collection of models changed as a result of the callpublic boolean removeModel(ILcdModel aModel)
removeModel
in interface ILcdModelContainer
aModel
- the model to be removed.true
if a model was removed as a result of this callpublic void addHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Registers the given ILcdModelContainerListener
to receive TLcdModelContainerEvent
s from all the
ILcdModelTreeNode
s contained in the tree with this node as root node.
The source ILcdModelContainer
of the event can be retrieved by calling TLcdModelContainerEvent.getModelContainer()
on the received TLcdModelContainerEvent
.
aModelContainerListener
- the listenerremoveHierarchyModelContainerListener(ILcdModelContainerListener)
public void removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Unregisters the given ILcdModelContainerListener
from receiving TLcdModelContainerEvent
s for the tree
with the node for which this support is responsible as root node.
aModelContainerListener
- the listener, must not be null
addHierarchyModelContainerListener(ILcdModelContainerListener)
public void addHierarchyModelListener(ILcdModelListener aModelListener)
Registers the given ILcdModelListener
to receive
TLcdModelChangedEvent
s from all the ILcdModel
s contained in the tree
with this node as root node.
The source ILcdModel
of the event can be retrieved by calling TLcdModelChangedEvent.getModel()
on the received TLcdModelChangedEvent
.
aModelListener
- the listenerremoveHierarchyModelListener(ILcdModelListener)
public void removeHierarchyModelListener(ILcdModelListener aModelListener)
Unregisters the given ILcdModelListener
from
receiving TLcdModelChangedEvent
s for the tree with the node for which this support
is responsible as root node.
aModelListener
- the listeneraddHierarchyModelListener(ILcdModelListener)
public void addModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Registers the given ILcdModelContainerListener
to receive TLcdModelContainerEvent
s for this model container.
addModelContainerListener
in interface ILcdModelContainer
aModelContainerListener
- the listener, must not be null
ILcdModelContainer.removeModelContainerListener(com.luciad.model.ILcdModelContainerListener)
public void removeModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Unregisters the given ILcdModelContainerListener
from receiving TLcdModelContainerEvent
s from this model container
removeModelContainerListener
in interface ILcdModelContainer
aModelContainerListener
- the listener, must not be null
ILcdModelContainer.addModelContainerListener(com.luciad.model.ILcdModelContainerListener)
public int modelCount()
ILcdModelContainer
ILcdModel
objects contained in this
ILcdModelContainer
.modelCount
in interface ILcdModelContainer
ILcdModel
objects contained in this
ILcdModelContainer
.public ILcdModel getModel(int aIndex)
ILcdModelContainer
ILcdModel
at the given index.getModel
in interface ILcdModelContainer
aIndex
- a valid index in this ILcdModelContainer
.ILcdModel
at the given index.public Enumeration models()
ILcdModelContainer
Enumeration
of the ILcdModel
objects contained in
this ILcdModelContainer
.models
in interface ILcdModelContainer
Enumeration
of the ILcdModel
objects contained in
this ILcdModelContainer
.public void modelProduced(TLcdModelProducerEvent e)
ILcdModelProducerListener
modelProduced
in interface ILcdModelProducerListener
e
- the event describing the changes to a ILcdModelProducer
.