Class TLcd2DBoundsIndexedModelTreeNode
- All Implemented Interfaces:
ILcd2DBoundsIndexedModel,ILcd2DBoundsInteractable,ILcdIntegerIndexedModel,ILcdModel,ILcdModelContainer,ILcdModelProducerListener,ILcdModelTreeNode,ILcdBounded,ILcdDisposable,Serializable,AutoCloseable,EventListener
An implementation of ILcdModelTreeNode based on a TLcd2DBoundsIndexedModel. It is mainly intended for
nodes with data (see TLcdModelTreeNode for empty nodes). Such a model node is a model
which useful data and could have child models.
The isEmpty() method is used to indicate whether a node is empty or not. By default,
this method will check the TLcd2DBoundsIndexedModel.size() of the model.
The created model nodes are instances of TLcd2DBoundsIndexedModel, and have the same features and properties.
- 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.ALcdModel
fModelEventSupportFields inherited from interface com.luciad.model.ILcdModel
FIRE_LATER, FIRE_NOW, NO_EVENT -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, emptyTLcd2DBoundsIndexedModelwith a defaultTLcdModelDescriptor.Constructs a new emptyTLcd2DBoundsIndexedModelwith a defaultTLcdModelDescriptor. -
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.TLcd2DBoundsIndexedModel
addElement, allElementsChanged, applyOnInteract2DBounds, applyOnInteract2DBounds, canAddElement, canRemoveElement, contains, elementAt, elementChanged, elements, elementsChanged, getAddElementFilter, getBounds, getRemoveElementFilter, indexOf, isSynchronized, removeAllElements, removeElement, setAddElementFilter, setRemoveElementFilter, setSynchronized, sizeMethods inherited from class com.luciad.model.ALcdModel
addElements, addModelListener, allElementsRemoved, dispose, elementAdded, elementRemoved, elementsAdded, 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, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcd2DBoundsIndexedModel
queryMethods inherited from interface com.luciad.util.ILcdDisposable
closeMethods inherited from interface com.luciad.model.ILcdModel
getModelMetadataMethods 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
-
TLcd2DBoundsIndexedModelTreeNode
public TLcd2DBoundsIndexedModelTreeNode()Constructs a new, emptyTLcd2DBoundsIndexedModelwith a defaultTLcdModelDescriptor. -
TLcd2DBoundsIndexedModelTreeNode
Constructs a new emptyTLcd2DBoundsIndexedModelwith a defaultTLcdModelDescriptor.- Parameters:
aBounds- the initial bounds for the spatial indexing scheme of the model. They should ideally encompass all the elements the user plans to add to the model, although this model will extend its bounds when required, by 'unfolding' the rectangle in the appropriate direction, i.e. by doubling the size of the bounds. The initial width or height of the bounds must therefore be larger than 0. The bounds of the entire model space are a safe bet, although they will be less efficient when the model is much smaller.
-
-
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:
-
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:
-
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.
-
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
TLcd2DBoundsIndexedModel.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
-