Class TLcdModelTreeNode
- All Implemented Interfaces:
ILcdIntegerIndexedModel,ILcdModel,ILcdModelContainer,ILcdModelProducerListener,ILcdModelTreeNode,ILcdDisposable,Serializable,AutoCloseable,EventListener
An implementation of ILcdModelTreeNode based on a TLcdVectorModel. It is mainly intended for empty model nodes: a model node where only
the data in the child nodes is important and the node itself contains no useful data.
The isEmpty() method is used to indicate whether a node is empty or not. By default,
this method will check the TLcdVectorModel.size() of the model.
When using this class to create a non-empty node, the model node itself is an instance
of TLcdVectorModel with the same features and properties as
a regular vector model.
- Since:
- 9.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.model.ILcdModel
ILcdModel.Query -
Field Summary
Fields inherited from class com.luciad.model.TLcdVectorModel
fVectorFields inherited from class com.luciad.model.ALcdModel
fModelEventSupportFields inherited from interface com.luciad.model.ILcdModel
FIRE_LATER, FIRE_NOW, NO_EVENT -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, emptyTLcdModelTreeNode, initialized with a defaultTLcdModelDescriptor.TLcdModelTreeNode(ILcdModelReference aModelReference) Constructs a new, emptyTLcdModelTreeNode, initialized with the specified model reference and a defaultTLcdModelDescriptor.TLcdModelTreeNode(ILcdModelReference aModelReference, ILcdModelDescriptor aModelDescriptor) Constructs a new, emptyTLcdModelTreeNode, initialized with the specified model reference and model descriptor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener) Registers the givenILcdModelContainerListenerto receiveTLcdModelContainerEvents from all theILcdModelTreeNodes contained in the tree with this node as root node.voidaddHierarchyModelListener(ILcdModelListener aModelListener) Registers the givenILcdModelListenerto receiveTLcdModelChangedEvents from all theILcdModels contained in the tree with this node as root node.booleanAdds theILcdModel aModelas a child model to thisILcdModelTreeNode.voidaddModelContainerListener(ILcdModelContainerListener aModelContainerListener) Adds anILcdModelContainerListenerto thisILcdModelContainer.getModel(int aIndex) Returns the child model at the given index.booleanisEmpty()Returnstruewhen the model node is only used as a container for other models, and contains no useful data itself,falseotherwise.intReturns the number of child models of this model node.voidNotifies this ILcdModelProducerListener of a produced model.models()Returns anEnumerationof the child models of thisILcdModelTreeNode.voidremoveHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener) Unregisters the givenILcdModelContainerListenerfrom receivingTLcdModelContainerEvents for the tree with this node as root node.voidremoveHierarchyModelListener(ILcdModelListener aModelListener) Unregisters the givenILcdModelListenerfrom receivingTLcdModelChangedEvents for the tree with this node as root node.booleanremoveModel(ILcdModel aModel) Removes the child modelaModelfrom thisILcdModelTreeNode.voidremoveModelContainerListener(ILcdModelContainerListener aModelContainerListener) Removes anILcdModelContainerListenerfrom thisILcdModelContainer.Methods inherited from class com.luciad.model.TLcdVectorModel
addElement, canAddElement, canRemoveElement, contains, elementAt, elements, getAddElementFilter, getRemoveElementFilter, indexOf, removeAllElements, removeElement, setAddElementFilter, setRemoveElementFilter, size, toStringMethods inherited from class com.luciad.model.ALcdModel
addElements, addModelListener, allElementsChanged, allElementsRemoved, dispose, elementAdded, elementChanged, elementRemoved, elementsAdded, elementsChanged, elementsRemoved, fireCollectedModelChanges, getModelDescriptor, getModelEncoder, getModelMetadata, getModelReference, initializeTransientValues, isClassTraceOn, isTraceOn, removeElements, removeModelListener, setClassTraceOn, setModelDescriptor, setModelDisposer, setModelEncoder, setModelMetadataFunction, setModelReference, setTraceOnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdDisposable
closeMethods inherited from interface com.luciad.model.ILcdModel
getModelMetadata, queryMethods inherited from interface com.luciad.model.ILcdModelContainer
getModelsMethods inherited from interface com.luciad.model.ILcdModelTreeNode
addElement, addElements, addModelListener, canAddElement, canRemoveElement, dispose, elementChanged, elements, elementsChanged, fireCollectedModelChanges, getModelDescriptor, getModelEncoder, getModelReference, removeAllElements, removeElement, removeElements, removeModelListener
-
Constructor Details
-
TLcdModelTreeNode
public TLcdModelTreeNode()Constructs a new, emptyTLcdModelTreeNode, initialized with a defaultTLcdModelDescriptor. -
TLcdModelTreeNode
Constructs a new, emptyTLcdModelTreeNode, initialized with the specified model reference and a defaultTLcdModelDescriptor.- Parameters:
aModelReference- the model reference describing the coordinate system used in this model.
-
TLcdModelTreeNode
Constructs a new, emptyTLcdModelTreeNode, initialized with the specified model reference and model descriptor.- Parameters:
aModelReference- the model reference describing the coordinate system used in this model.aModelDescriptor- the model descriptor providing meta information about this model.
-
-
Method Details
-
addModel
Description copied from interface:ILcdModelTreeNodeAdds the
ILcdModel aModelas a child model to thisILcdModelTreeNode.- Specified by:
addModelin interfaceILcdModelContainer- Specified by:
addModelin interfaceILcdModelTreeNode- Parameters:
aModel- the model to be added.- Returns:
trueif this collection of models changed as a result of the call
-
removeModel
Description copied from interface:ILcdModelTreeNodeRemoves the child model
aModelfrom thisILcdModelTreeNode.- Specified by:
removeModelin interfaceILcdModelContainer- Specified by:
removeModelin interfaceILcdModelTreeNode- Parameters:
aModel- the model to be removed.- Returns:
trueif a model was removed as a result of this call
-
addHierarchyModelContainerListener
Description copied from interface:ILcdModelTreeNodeRegisters the given
ILcdModelContainerListenerto receiveTLcdModelContainerEvents from all theILcdModelTreeNodes contained in the tree with this node as root node. If the listener should only receive events originating from this model node, it should be adedd as a regular model listener (seeILcdModelTreeNode.addModelContainerListener(ILcdModelContainerListener)).The source
ILcdModelContainerof the event can be retrieved by callingTLcdModelContainerEvent.getModelContainer()on the receivedTLcdModelContainerEvent.- Specified by:
addHierarchyModelContainerListenerin interfaceILcdModelTreeNode- Parameters:
aModelContainerListener- the listener- See Also:
-
removeHierarchyModelContainerListener
public void removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener) Description copied from interface:ILcdModelTreeNodeUnregisters the given
ILcdModelContainerListenerfrom receivingTLcdModelContainerEvents for the tree with this node as root node.- Specified by:
removeHierarchyModelContainerListenerin interfaceILcdModelTreeNode- Parameters:
aModelContainerListener- the listener- See Also:
-
addHierarchyModelListener
Description copied from interface:ILcdModelTreeNodeRegisters the given
ILcdModelListenerto receiveTLcdModelChangedEvents from all theILcdModels contained in the tree with this node as root node. If the listener should only receive events originating from this model node, it should be added as a regular model listener (seeILcdModelTreeNode.addModelListener(ILcdModelListener)).The source
ILcdModelof the event can be retrieved by callingTLcdModelChangedEvent.getModel()on the receivedTLcdModelChangedEvent.- Specified by:
addHierarchyModelListenerin interfaceILcdModelTreeNode- Parameters:
aModelListener- the listener- See Also:
-
removeHierarchyModelListener
Description copied from interface:ILcdModelTreeNodeUnregisters the given
ILcdModelListenerfrom receivingTLcdModelChangedEvents for the tree with this node as root node.- Specified by:
removeHierarchyModelListenerin interfaceILcdModelTreeNode- Parameters:
aModelListener- the listener- See Also:
-
modelCount
public int modelCount()Description copied from interface:ILcdModelTreeNodeReturns the number of child models of this model node.
- Specified by:
modelCountin interfaceILcdModelContainer- Specified by:
modelCountin interfaceILcdModelTreeNode- Returns:
- the number of child models of this model node.
-
getModel
Description copied from interface:ILcdModelTreeNodeReturns the child model at the given index.
- Specified by:
getModelin interfaceILcdModelContainer- Specified by:
getModelin interfaceILcdModelTreeNode- Parameters:
aIndex- a valid index in thisILcdModelTreeNode- Returns:
- the child model at the given index.
-
models
Description copied from interface:ILcdModelTreeNodeReturns an
Enumerationof the child models of thisILcdModelTreeNode.- Specified by:
modelsin interfaceILcdModelContainer- Specified by:
modelsin interfaceILcdModelTreeNode- Returns:
- an
Enumerationof the child models of thisILcdModelTreeNode.
-
modelProduced
Description copied from interface:ILcdModelProducerListenerNotifies this ILcdModelProducerListener of a produced model.- Specified by:
modelProducedin interfaceILcdModelProducerListener- Parameters:
e- the event describing the changes to aILcdModelProducer.
-
addModelContainerListener
Description copied from interface:ILcdModelTreeNodeAdds anILcdModelContainerListenerto thisILcdModelContainer.It will only receive notifications of changes in this
.ILcdModelTreeNodeand not of any changes in the state of the child model node(s). If this is required, the listener must be registered as a hierarchy listener (seeILcdModelTreeNode.addHierarchyModelContainerListener(ILcdModelContainerListener)).- Specified by:
addModelContainerListenerin interfaceILcdModelContainer- Specified by:
addModelContainerListenerin interfaceILcdModelTreeNode- Parameters:
aModelContainerListener- the listener to be added.- See Also:
-
removeModelContainerListener
Description copied from interface:ILcdModelTreeNodeRemoves anILcdModelContainerListenerfrom thisILcdModelContainer.It is not possible to remove a hierarchy model container listener. Use
ILcdModelTreeNode.removeHierarchyModelContainerListener(ILcdModelContainerListener)for this purpose.- Specified by:
removeModelContainerListenerin interfaceILcdModelContainer- Specified by:
removeModelContainerListenerin interfaceILcdModelTreeNode- Parameters:
aModelContainerListener- the listener to be removed.- See Also:
-
isEmpty
public boolean isEmpty()Returns
truewhen the model node is only used as a container for other models, and contains no useful data itself,falseotherwise.This implementation looks at the
TLcdVectorModel.size()of the model to determine whether this model node is empty or not.- Specified by:
isEmptyin interfaceILcdModelTreeNode- Returns:
truewhen the model node contains no useful data,falseotherwise
-