Class TLcdModelTreeNodeSupport
- All Implemented Interfaces:
ILcdModelContainer
,ILcdModelProducerListener
,EventListener
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.
- Since:
- 9.0
-
Constructor Summary
ConstructorDescriptionCreates a new support object for nodeaNode
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHierarchyModelContainerListener
(ILcdModelContainerListener aModelContainerListener) Registers the givenILcdModelContainerListener
to receiveTLcdModelContainerEvent
s from all theILcdModelTreeNode
s contained in the tree with this node as root node.void
addHierarchyModelListener
(ILcdModelListener aModelListener) Registers the givenILcdModelListener
to receiveTLcdModelChangedEvent
s from all theILcdModel
s contained in the tree with this node as root node.boolean
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 modelvoid
addModelContainerListener
(ILcdModelContainerListener aModelContainerListener) Registers the givenILcdModelContainerListener
to receiveTLcdModelContainerEvent
s for this model container.getModel
(int aIndex) Returns theILcdModel
at the given index.int
Returns the number ofILcdModel
objects contained in thisILcdModelContainer
.void
Notifies this ILcdModelProducerListener of a produced model.models()
Returns anEnumeration
of theILcdModel
objects contained in thisILcdModelContainer
.void
removeHierarchyModelContainerListener
(ILcdModelContainerListener aModelContainerListener) Unregisters the givenILcdModelContainerListener
from receivingTLcdModelContainerEvent
s for the tree with the node for which this support is responsible as root node.void
removeHierarchyModelListener
(ILcdModelListener aModelListener) Unregisters the givenILcdModelListener
from receivingTLcdModelChangedEvent
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 addedvoid
removeModelContainerListener
(ILcdModelContainerListener aModelContainerListener) Unregisters the givenILcdModelContainerListener
from receivingTLcdModelContainerEvent
s from this model containerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelContainer
getModels
-
Constructor Details
-
TLcdModelTreeNodeSupport
Creates a new support object for nodeaNode
- Parameters:
aNode
- the node for which a support object is needed
-
-
Method Details
-
addModel
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- Specified by:
addModel
in interfaceILcdModelContainer
- Parameters:
aModel
- the model to be added.- Returns:
true
if this collection of models changed as a result of the call
-
removeModel
Remove a model from the container, and remove all the hierarchy listeners which were added- Specified by:
removeModel
in interfaceILcdModelContainer
- Parameters:
aModel
- the model to be removed.- Returns:
true
if a model was removed as a result of this call
-
addHierarchyModelContainerListener
Registers the given
ILcdModelContainerListener
to receiveTLcdModelContainerEvent
s from all theILcdModelTreeNode
s contained in the tree with this node as root node.The source
ILcdModelContainer
of the event can be retrieved by callingTLcdModelContainerEvent.getModelContainer()
on the receivedTLcdModelContainerEvent
.- Parameters:
aModelContainerListener
- the listener- See Also:
-
removeHierarchyModelContainerListener
public void removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener) Unregisters the given
ILcdModelContainerListener
from receivingTLcdModelContainerEvent
s for the tree with the node for which this support is responsible as root node.- Parameters:
aModelContainerListener
- the listener, must not benull
- See Also:
-
addHierarchyModelListener
Registers the given
ILcdModelListener
to receiveTLcdModelChangedEvent
s from all theILcdModel
s contained in the tree with this node as root node.The source
ILcdModel
of the event can be retrieved by callingTLcdModelChangedEvent.getModel()
on the receivedTLcdModelChangedEvent
.- Parameters:
aModelListener
- the listener- See Also:
-
removeHierarchyModelListener
Unregisters the given
ILcdModelListener
from receivingTLcdModelChangedEvent
s for the tree with the node for which this support is responsible as root node.- Parameters:
aModelListener
- the listener- See Also:
-
addModelContainerListener
Registers the given
ILcdModelContainerListener
to receiveTLcdModelContainerEvent
s for this model container.- Specified by:
addModelContainerListener
in interfaceILcdModelContainer
- Parameters:
aModelContainerListener
- the listener, must not benull
- See Also:
-
removeModelContainerListener
Unregisters the given
ILcdModelContainerListener
from receivingTLcdModelContainerEvent
s from this model container- Specified by:
removeModelContainerListener
in interfaceILcdModelContainer
- Parameters:
aModelContainerListener
- the listener, must not benull
- See Also:
-
modelCount
public int modelCount()Description copied from interface:ILcdModelContainer
Returns the number ofILcdModel
objects contained in thisILcdModelContainer
.- Specified by:
modelCount
in interfaceILcdModelContainer
- Returns:
- the number of
ILcdModel
objects contained in thisILcdModelContainer
.
-
getModel
Description copied from interface:ILcdModelContainer
Returns theILcdModel
at the given index.- Specified by:
getModel
in interfaceILcdModelContainer
- Parameters:
aIndex
- a valid index in thisILcdModelContainer
.- Returns:
- the
ILcdModel
at the given index.
-
models
Description copied from interface:ILcdModelContainer
Returns anEnumeration
of theILcdModel
objects contained in thisILcdModelContainer
.- Specified by:
models
in interfaceILcdModelContainer
- Returns:
- an
Enumeration
of theILcdModel
objects contained in thisILcdModelContainer
.
-
modelProduced
Description copied from interface:ILcdModelProducerListener
Notifies this ILcdModelProducerListener of a produced model.- Specified by:
modelProduced
in interfaceILcdModelProducerListener
- Parameters:
e
- the event describing the changes to aILcdModelProducer
.
-