public class TLcdKML22AbstractContainer extends TLcdKML22AbstractFeature implements ILcdModelTreeNode, ILcd2DBoundsIndexedModel, ILcdIntegerIndexedModel, ReadWriteLock
ILcdModel.Query
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
ABSTRACT_CONTAINER_OBJECT_EXTENSION_GROUP_PROPERTY
Data property that maps to the
AbstractContainerObjectExtensionGroup element. |
static TLcdDataProperty |
ABSTRACT_CONTAINER_SIMPLE_EXTENSION_GROUP_PROPERTY
Data property that maps to the
AbstractContainerSimpleExtensionGroup element. |
static TLcdDataProperty |
ABSTRACT_FEATURE_OBJECT_EXTENSION_GROUP_PROPERTY
Data property that maps to the
AbstractFeatureObjectExtensionGroup element. |
static TLcdDataProperty |
ABSTRACT_FEATURE_SIMPLE_EXTENSION_GROUP_PROPERTY
Data property that maps to the
AbstractFeatureSimpleExtensionGroup element. |
static TLcdDataProperty |
ABSTRACT_STYLE_SELECTOR_GROUP_PROPERTY
Data property that maps to the
AbstractStyleSelectorGroup element. |
static TLcdDataProperty |
ABSTRACT_TIME_PRIMITIVE_GROUP_PROPERTY
Data property that maps to the
AbstractTimePrimitiveGroup element. |
static TLcdDataProperty |
ABSTRACT_VIEW_GROUP_PROPERTY
Data property that maps to the
AbstractViewGroup element. |
static TLcdDataProperty |
ADDRESS_DETAILS_PROPERTY
Data property that maps to the
AddressDetails element. |
static TLcdDataProperty |
ADDRESS_PROPERTY
Data property that maps to the
address element. |
static TLcdDataProperty |
ATOM_LINK_PROPERTY
Data property that maps to the
link element. |
static TLcdDataProperty |
AUTHOR_PROPERTY
Data property that maps to the
author element. |
static TLcdDataProperty |
DESCRIPTION_PROPERTY
Data property that maps to the
description element. |
static TLcdDataProperty |
EXTENDED_DATA_PROPERTY
Data property that maps to the choice between the
Metadata and ExtendedData elements. |
static TLcdDataProperty |
NAME_PROPERTY
Data property that maps to the
name element. |
static TLcdDataProperty |
OPEN_PROPERTY
Data property that maps to the
open element. |
static TLcdDataProperty |
PHONE_NUMBER_PROPERTY
Data property that maps to the
phoneNumber element. |
static TLcdDataProperty |
REGION_PROPERTY
Data property that maps to the
Region element. |
static TLcdDataProperty |
SNIPPET_PROPERTY
Data property that maps to the choice between the
Snippet and snippet elements. |
static TLcdDataProperty |
STYLE_URL_PROPERTY
Data property that maps to the
styleUrl element. |
static TLcdDataProperty |
VISIBILITY_PROPERTY
Data property that maps to the
visibility element. |
ID_PROPERTY, OBJECT_SIMPLE_EXTENSION_GROUP_PROPERTY, TARGET_ID_PROPERTY
FIRE_LATER, FIRE_NOW, NO_EVENT
Constructor and Description |
---|
TLcdKML22AbstractContainer(TLcdDataType aType)
Creates a new
TLcdKML22AbstractContainer with a custom TLcdDataType . |
Modifier and Type | Method and Description |
---|---|
void |
addElement(Object aElement,
int aEventMode)
Adds the specified element to this model.
|
void |
addElements(Vector aElements,
int aEventMode)
Adds all of the elements in the specified vector to this model.
|
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)
Adds the
ILcdModel aModel as a child model to this
ILcdModelTreeNode . |
void |
addModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Adds an
ILcdModelContainerListener to this ILcdModelContainer . |
void |
addModelListener(ILcdModelListener aModelListener)
Registers the specified model listener to receive notifications of model changes on this model.
|
int |
applyOnInteract2DBounds(ILcdBounds aBounds,
boolean aStrictOverlap,
ILcdFunction aFunctionToApply,
double aPrecisionX,
double aPrecisionY)
Applies the specified function to all the model elements of which the 2D bounds overlap with the specified bounds.
|
int |
applyOnInteract2DBounds(ILcdBounds aBounds,
boolean aStrictOverlap,
ILcdFunction aFunctionToApply,
double aPrecisionX,
double aPrecisionY,
double aMinSizeX,
double aMinSizeY,
boolean aIncludePoints)
Applies the specified function to all the elements of which the 2D bounds overlap with the specified bounds.
|
boolean |
canAddElement(Object aElement)
Returns
true if the specified element can be added to this model, false otherwise. |
boolean |
canRemoveElement(Object aElement)
Returns
true if the specified element can be removed from this model, false otherwise. |
void |
dispose()
Disposes of this model and allows it to release any system resources that it is holding.
|
Object |
elementAt(int aIndex)
Returns the element at the specified index.
|
void |
elementChanged(Object aElement,
int aEventMode)
Notifies this model that the specified element has changed.
|
Enumeration |
elements()
Returns an enumeration over all elements of this model.
|
void |
elementsChanged(Vector aElements,
int aEventMode)
Notifies this model that the elements in the specified vector have changed.
|
void |
fireCollectedModelChanges()
Notifies all listeners that are registered on this model of all the changes that have been collected between the
previous notification and now.
|
void |
fireCollectedModelChanges(boolean aIsAdjusting) |
List<TLcdKML22AbstractFeature> |
getAbstractFeatureGroup()
Gets the value of the
ABSTRACT_FEATURE_GROUP_PROPERTY property. |
List<TLcdKML22AbstractStyleSelector> |
getAbstractStyleSelectorGroup()
Returns the value of the property that maps to the
AbstractStyleSelectorGroup element. |
TLcdKML22AbstractTimePrimitive |
getAbstractTimePrimitiveGroup()
Returns the value of the property that maps to the
AbstractTimePrimitiveGroup element. |
TLcdKML22AbstractView |
getAbstractViewGroup()
Returns the value of the property that maps to the
AbstractViewGroup element. |
String |
getAddress()
Returns the value of the property that maps to the
address element. |
ILcdDataObject |
getAddressDetails()
Returns the value of the property that maps to the
AddressDetails element. |
ILcdDataObject |
getAtomLink()
Returns the value of the property that maps to the
link element. |
ILcdDataObject |
getAuthor()
Returns the value of the property that maps to the
author element. |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
String |
getDescription()
Returns the value of the property that maps to the
description element. |
ILcdDataObject |
getExtendedData()
Returns the value of the property that maps to the choice between the
Metadata and ExtendedData elements. |
ILcdModel |
getModel(int aIndex)
Returns the child model at the given index.
|
ILcdModelDescriptor |
getModelDescriptor()
Returns the
ILcdModelDescriptor providing meta information about this model and
its elements. |
ILcdModelEncoder |
getModelEncoder()
Returns, if available, a model encoder that is capable of encoding this model,
(
encoder.canEncode(this) ), null otherwise. |
TLcdModelMetadata |
getModelMetadata()
Collects and returns metadata about the model.
|
ILcdModelReference |
getModelReference()
Returns the
ILcdModelReference describing how the geometry of the elements contained in this
model should be interpreted. |
String |
getName()
Returns the value of the property that maps to the
name element. |
Boolean |
getOpen()
Returns the value of the property that maps to the
open element. |
String |
getPhoneNumber()
Returns the value of the property that maps to the
phoneNumber element. |
TLcdKML22Region |
getRegion()
Returns the value of the property that maps to the
Region element. |
TLcdKML22Snippet |
getSnippet()
Returns the value of the property that maps to the choice between the
Snippet and snippet elements. |
String |
getStyleUrl()
Returns the value of the property that maps to the
styleUrl element. |
int |
indexOf(Object aObject)
Returns the index of the first occurrence of the specified element in the model, or -1 if this model does not
contain the element.
|
boolean |
isEmpty()
Returns
true when the model node is only used as a container for other models,
and contains no useful data itself, false otherwise. |
int |
modelCount()
Returns the number of child models of this model node.
|
void |
modelProduced(TLcdModelProducerEvent aModelProducerEvent)
Notifies this ILcdModelProducerListener of a produced model.
|
Enumeration |
models()
Returns an
Enumeration of the child models of this
ILcdModelTreeNode . |
Lock |
readLock() |
void |
removeAllElements(int aEventMode)
Removes all elements from this model.
|
void |
removeElement(Object aElement,
int aEventMode)
Removes the specified element from this model.
|
void |
removeElements(Vector aElements,
int aEventMode)
Removes all of the elements in the specified vector from this model.
|
void |
removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Unregisters the given
ILcdModelContainerListener from receiving TLcdModelContainerEvent s for the tree
with this node as root node. |
void |
removeHierarchyModelListener(ILcdModelListener aModelListener)
Unregisters the given
ILcdModelListener from
receiving TLcdModelChangedEvent s for the tree with this node as root node. |
boolean |
removeModel(ILcdModel aModel)
Removes the child model
aModel from this ILcdModelTreeNode . |
void |
removeModelContainerListener(ILcdModelContainerListener aModelContainerListener)
Removes an
ILcdModelContainerListener from this ILcdModelContainer . |
void |
removeModelListener(ILcdModelListener aModelListener)
Unregisters the specified model listener so that it no longer receives notifications of model changes on this model.
|
void |
setAbstractTimePrimitiveGroup(TLcdKML22AbstractTimePrimitive aValue)
Sets the value of the property that maps to the
AbstractTimePrimitiveGroup element. |
void |
setAbstractViewGroup(TLcdKML22AbstractView aValue)
Sets the value of the property that maps to the
AbstractViewGroup element. |
void |
setAddress(String aValue)
Sets the value of the property that maps to the
address element. |
void |
setAddressDetails(ILcdDataObject aValue)
Sets the value of the property that maps to the
AddressDetails element. |
void |
setAtomLink(ILcdDataObject aValue)
Sets the value of the property that maps to the
link element. |
void |
setAuthor(ILcdDataObject aValue)
Sets the value of the property that maps to the
author element. |
void |
setDescription(String aValue)
Sets the value of the property that maps to the
description element. |
void |
setExtendedData(ILcdDataObject aValue)
Sets the value of the property that maps to the choice between the
Metadata and ExtendedData elements. |
void |
setKMLSourceName(String aSourceName)
Sets the source name of the originating KML document of this abstract feature.
|
void |
setModelReference(ILcdModelReference aModelReference)
Sets the model reference of this
TLcdKML22AbstractContainer |
void |
setName(String aValue)
Sets the value of the property that maps to the
name element. |
void |
setOpen(Boolean aValue)
Sets the value of the property that maps to the
open element. |
void |
setPhoneNumber(String aValue)
Sets the value of the property that maps to the
phoneNumber element. |
void |
setRegion(TLcdKML22Region aValue)
Sets the value of the property that maps to the
Region element. |
void |
setSnippet(TLcdKML22Snippet aValue)
Sets the value of the property that maps to the choice between the
Snippet and snippet elements. |
void |
setStyleUrl(String aValue)
Sets the value of the property that maps to the
styleUrl element. |
void |
setVisibility(Boolean aValue)
Sets the value of the property that maps to the
visibility element. |
int |
size()
Returns the number of elements in this model.
|
Lock |
writeLock() |
clearCache, clone, getCachedObject, getInnerStyleSelector, getKMLSourceName, getTimeBounds, getVisibility, insertIntoCache, removeCachedObject
getId, getTargetId, setId, setTargetId
clone, getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getModels
query
close
public static final TLcdDataProperty ABSTRACT_CONTAINER_SIMPLE_EXTENSION_GROUP_PROPERTY
AbstractContainerSimpleExtensionGroup
element.
The possible values for this property are instances of List<String>
.public static final TLcdDataProperty ABSTRACT_CONTAINER_OBJECT_EXTENSION_GROUP_PROPERTY
AbstractContainerObjectExtensionGroup
element.
The possible values for this property are instances of List<TLcdKML22AbstractObject>
.public static final TLcdDataProperty NAME_PROPERTY
name
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty VISIBILITY_PROPERTY
visibility
element.
The possible values for this property are instances of Boolean
.public static final TLcdDataProperty OPEN_PROPERTY
open
element.
The possible values for this property are instances of Boolean
.public static final TLcdDataProperty AUTHOR_PROPERTY
author
element.
The possible values for this property are instances of ILcdDataObject
.public static final TLcdDataProperty ATOM_LINK_PROPERTY
link
element.
The possible values for this property are instances of ILcdDataObject
.public static final TLcdDataProperty ADDRESS_PROPERTY
address
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty ADDRESS_DETAILS_PROPERTY
AddressDetails
element.
The possible values for this property are instances of ILcdDataObject
.public static final TLcdDataProperty PHONE_NUMBER_PROPERTY
phoneNumber
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty SNIPPET_PROPERTY
Snippet
and snippet
elements.
The possible values for this property are instances of
TLcdKML22Snippet
String
public static final TLcdDataProperty DESCRIPTION_PROPERTY
description
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty ABSTRACT_VIEW_GROUP_PROPERTY
AbstractViewGroup
element.
The possible values for this property are instances of TLcdKML22AbstractView
.public static final TLcdDataProperty ABSTRACT_TIME_PRIMITIVE_GROUP_PROPERTY
AbstractTimePrimitiveGroup
element.
The possible values for this property are instances of TLcdKML22AbstractTimePrimitive
.public static final TLcdDataProperty STYLE_URL_PROPERTY
styleUrl
element.
The possible values for this property are instances of String
.public static final TLcdDataProperty ABSTRACT_STYLE_SELECTOR_GROUP_PROPERTY
AbstractStyleSelectorGroup
element.
The possible values for this property are instances of List<TLcdKML22AbstractStyleSelector>
.public static final TLcdDataProperty REGION_PROPERTY
Region
element.
The possible values for this property are instances of TLcdKML22Region
.public static final TLcdDataProperty EXTENDED_DATA_PROPERTY
Metadata
and ExtendedData
elements.
The possible values for this property are instances of
public static final TLcdDataProperty ABSTRACT_FEATURE_SIMPLE_EXTENSION_GROUP_PROPERTY
AbstractFeatureSimpleExtensionGroup
element.
The possible values for this property are instances of List<String>
.public static final TLcdDataProperty ABSTRACT_FEATURE_OBJECT_EXTENSION_GROUP_PROPERTY
AbstractFeatureObjectExtensionGroup
element.
The possible values for this property are instances of List<TLcdKML22AbstractObject>
.public TLcdKML22AbstractContainer(TLcdDataType aType)
TLcdKML22AbstractContainer
with a custom TLcdDataType
.aType
- a custom TLcdDataType
public void setKMLSourceName(String aSourceName)
TLcdKML22AbstractFeature
setKMLSourceName
in class TLcdKML22AbstractFeature
aSourceName
- the new source name of the document in which this abstract feature residespublic void setModelReference(ILcdModelReference aModelReference)
TLcdKML22AbstractContainer
aModelReference
- an ILcdModelReference
public List<TLcdKML22AbstractFeature> getAbstractFeatureGroup()
ABSTRACT_FEATURE_GROUP_PROPERTY
property.ABSTRACT_FEATURE_GROUP_PROPERTY
property.public void fireCollectedModelChanges(boolean aIsAdjusting)
public Lock readLock()
readLock
in interface ReadWriteLock
public Lock writeLock()
writeLock
in interface ReadWriteLock
public ILcdModelReference getModelReference()
ILcdModelTreeNode
ILcdModelReference
describing how the geometry of the elements contained in this
model should be interpreted.
This model reference is independent of the model reference(s) of the child models of this node.
getModelReference
in interface ILcdModel
getModelReference
in interface ILcdModelTreeNode
ILcdModelReference
of this ILcdModel
.public ILcdModelDescriptor getModelDescriptor()
ILcdModelTreeNode
ILcdModelDescriptor
providing meta information about this model and
its elements.
This model descriptor is independent of the model descriptor(s) of the child models of this node.
getModelDescriptor
in interface ILcdModel
getModelDescriptor
in interface ILcdModelTreeNode
ILcdModelDescriptor
of this ILcdModel
. Should not be null
.public ILcdModelEncoder getModelEncoder()
ILcdModelTreeNode
encoder.canEncode(this)
), null
otherwise.
It is implementation-dependant whether this encoder considers the child models or not.
getModelEncoder
in interface ILcdModel
getModelEncoder
in interface ILcdModelTreeNode
null
otherwise.public TLcdModelMetadata getModelMetadata()
ILcdModel
TLcdModelMetadata
instance every time it is called.
The default implementation uses TLcdModelMetadata.Builder.fromModel(com.luciad.model.ILcdModel)
.
Implementations can recreate
or extend
the metadata.
The following example adds a data category and source file mime type:
public TLcdModelMetadata getModelMetadata() {
String source = this.getModelDescriptor().getSourceName();
return this.getModelMetadata().asBuilder()
.entryPoint(new TLcdModelMetadata.Source(source, MIME_XML))
.addDataCategory(TLcdModelMetadata.DataCategory.VECTOR)
.build();
}
getModelMetadata
in interface ILcdModel
public Enumeration elements()
ILcdModelTreeNode
The elements of the child model(s) are not included in this enumeration.
elements
in interface ILcdModel
elements
in interface ILcdModelTreeNode
public void addElement(Object aElement, int aEventMode)
ILcdModelTreeNode
Models that support this operation may place limitations on what elements may be added to this model. For example,
implementations that are based on a spatial indexing structure will require that elements implement
ILcdBounded
.
When adding an element, the user should make sure that canAddElement(aElement)
holds, and that the
element's geometry is expressed in the same model reference as this model. It is generally undefined what happens
if an invalid element is added.
Implementations of this interface should clearly specify in their documentation any restrictions on what elements
may be added. Although it is unspecified what happens if the preconditions are not met, implementations are
encouraged to throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException,
ClassCastException, UnsupportedOperationException
), whenever possible.
The element will only be added to this model node and not to any of the child model(s).
addElement
in interface ILcdModel
addElement
in interface ILcdModelTreeNode
aElement
- the element to be added to this model.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canAddElement(Object)
public boolean canAddElement(Object aElement)
ILcdModelTreeNode
true
if the specified element can be added to this model, false
otherwise.
Note that this method generally does not validate whether the specified element is expressed in the same model reference as this model. It is the responsibility of the user of this model to make sure this precondition is fulfilled when an element is added to this model.
This method only checks this model node and not any of the child models.
canAddElement
in interface ILcdModel
canAddElement
in interface ILcdModelTreeNode
aElement
- the element to be verified.true
if the specified element can be added to this model, false
otherwise.public void addElements(Vector aElements, int aEventMode)
ILcdModelTreeNode
ILcdBounded
. Implementations of this interface should clearly specify in their documentation any
restrictions on what elements may be added.
The behavior of this operation is undefined if the specified vector is modified while the operation is in progress.
The specified elements will be added to this model in the order they are specified in the vector. If an element cannot be added, this method will return at the first failure. Succeeding elements won't be added.
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
The elements will only be added to this model node and not to any of the child model(s).
addElements
in interface ILcdModel
addElements
in interface ILcdModelTreeNode
aElements
- the vector of elements to be added to this model.aEventMode
- the mode for sending the model change events This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canAddElement(Object)
public void removeElement(Object aElement, int aEventMode)
ILcdModelTreeNode
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
The element will not be removed from the child model(s).
removeElement
in interface ILcdModel
removeElement
in interface ILcdModelTreeNode
aElement
- the element to be removed from this model.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canRemoveElement(Object)
public boolean canRemoveElement(Object aElement)
ILcdModelTreeNode
true
if the specified element can be removed from this model, false
otherwise.
Note that this method generally does not check whether the specified element is actually contained in this model.
This method will only check this model node and not any of the child models.
canRemoveElement
in interface ILcdModel
canRemoveElement
in interface ILcdModelTreeNode
aElement
- the element to be verified.true
if the specified element can be removed from this model, false
otherwise.public void removeElements(Vector aElements, int aEventMode)
ILcdModelTreeNode
The behavior of this operation is undefined if the specified vector is modified while the operation is in progress.
The specified elements will be removed from this model in the order they are specified in the vector. If an element cannot be removed, this method will return at the first failure. Succeeding elements won't be removed.
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
The elements will not be removed from the child model(s).
removeElements
in interface ILcdModel
removeElements
in interface ILcdModelTreeNode
aElements
- the vector of elements to be removed from this model.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canRemoveElement(Object)
public void removeAllElements(int aEventMode)
ILcdModelTreeNode
If an element cannot be removed, this method will return at the first failure. Succeeding elements won't be removed.
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
It will not remove any elements from any of the child models.
removeAllElements
in interface ILcdModel
removeAllElements
in interface ILcdModelTreeNode
aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.public void elementChanged(Object aElement, int aEventMode)
ILcdModelTreeNode
When an element in one the child models has changed, this method must be called on that child model and not on this node.
elementChanged
in interface ILcdModel
elementChanged
in interface ILcdModelTreeNode
aElement
- the element that has changed.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.public void elementsChanged(Vector aElements, int aEventMode)
ILcdModelTreeNode
When elements of one of the child models have changed, this method must be called on that child model and not on this node.
elementsChanged
in interface ILcdModel
elementsChanged
in interface ILcdModelTreeNode
aElements
- the vector of elements that have changed.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.public void fireCollectedModelChanges()
ILcdModelTreeNode
Notice that both the hierarchical as the regular registered model listeners will be notified.
Only the changes in this model node will be fired, not the changes in any of the child models.
fireCollectedModelChanges
in interface ILcdModel
fireCollectedModelChanges
in interface ILcdModelTreeNode
ILcdModelListener.modelChanged(TLcdModelChangedEvent)
public void addModelListener(ILcdModelListener aModelListener)
ILcdModelTreeNode
Registers the specified model listener to receive notifications of model changes on this model.
Model changes are sent out when an element has been added, removed or changed. Model changes can be sent out
individually, grouped or silently applied without notifications, depending on the ILcdFireEventMode
that was specified with the change.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this model,
you can use a ALcdWeakModelListener
instance as model listener.
The model listener will not receive any notifications of model changes in any of the child
models. If the listener should also receive notifications about changes in the child models, it
should be registered as a hierarchy listener (see ILcdModelTreeNode.addHierarchyModelListener(ILcdModelListener)
).
addModelListener
in interface ILcdModel
addModelListener
in interface ILcdModelTreeNode
aModelListener
- the ILcdModelListener
to register on this model.ILcdModel.removeModelListener(com.luciad.model.ILcdModelListener)
,
ILcdModelListener
public void removeModelListener(ILcdModelListener aModelListener)
ILcdModelTreeNode
It is not possible to unregister hierarchy model listeners with this method. Use ILcdModelTreeNode.removeHierarchyModelListener(ILcdModelListener)
for this purpose.
removeModelListener
in interface ILcdModel
removeModelListener
in interface ILcdModelTreeNode
aModelListener
- the ILcdModelListener
to remove.ILcdModel.addModelListener(com.luciad.model.ILcdModelListener)
,
ILcdModelListener
public void dispose()
ILcdModelTreeNode
finalize
) on this model subsequent to a call to
this method is undefined.
Calling this method will not dispose any of the child models, or alter the hierarchical structure. If the child models should also be disposed, this method should be called on those models.
dispose
in interface ILcdModel
dispose
in interface ILcdModelTreeNode
dispose
in interface ILcdDisposable
public int size()
ILcdIntegerIndexedModel
size
in interface ILcdIntegerIndexedModel
public Object elementAt(int aIndex)
ILcdIntegerIndexedModel
elementAt
in interface ILcdIntegerIndexedModel
aIndex
- an index into this ILcdModel
.public int indexOf(Object aObject)
ILcdIntegerIndexedModel
i
for which this.elementAt(i).equals(aElement)
.indexOf
in interface ILcdIntegerIndexedModel
aObject
- the element to search for.public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictOverlap, ILcdFunction aFunctionToApply, double aPrecisionX, double aPrecisionY)
ILcd2DBoundsIndexedModel
false
.applyOnInteract2DBounds
in interface ILcd2DBoundsIndexedModel
aBounds
- the rectangle to test overlap with.aStrictOverlap
- if false
, the spatial search may return more elements than the ones strictly
overlapping; if true
, the search only returns the elements that are
overlapping. The latter mode is more precise, but it may be slower.aFunctionToApply
- the function to apply on each element that overlaps with the given bounds.
The return value of the specified function is used as a stop criterion: the spatial query is interrupted
if the function returns false
.aPrecisionX
- the precision required in the x dimension, expressed in model units.
For example, for a cartesian grid system expressed in meters, the values
should be expressed in meters as well, for a geodetic coordinate system the accuracy
values should be expressed in degrees.
The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aPrecisionY
- the precision required in the y dimension, expressed in model units.ILcdFunction
has been applied.public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictOverlap, ILcdFunction aFunctionToApply, double aPrecisionX, double aPrecisionY, double aMinSizeX, double aMinSizeY, boolean aIncludePoints)
ILcd2DBoundsInteractable
false
for an element it was applied on.applyOnInteract2DBounds
in interface ILcd2DBoundsIndexedModel
applyOnInteract2DBounds
in interface ILcd2DBoundsInteractable
aBounds
- the rectangle to test overlap with.aStrictOverlap
- if false
, the spatial search may return more elements than the ones strictly
overlapping; if true
, the search only returns the elements that are
overlapping. The latter mode is more precise, but it may be slower.aFunctionToApply
- the function to apply on each element that overlaps with the given bounds.aPrecisionX
- the precision required in the x dimension, expressed in model units.
For example, for a cartesian grid system expressed in meters, the values
should be expressed in meters as well, for a geodetic coordinate system the accuracy
values should be expressed in degrees.
The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aPrecisionY
- the precision required in the y dimension, expressed in model units.aMinSizeX
- the minimal element size in the x dimension (as in
ILcdBounds.getWidth()
), expressed in model units.
Elements that are smaller than this size will be skipped. This may, for example, be
useful when improving the efficiency of painting elements by skipping elements
that are smaller than some threshold (e.g. one pixel, converted to model units).aMinSizeY
- the minimal element size in the y dimension (as in
ILcdBounds.getHeight()
), expressed in model units.aIncludePoints
- if true
, zero-sized elements (points) are considered as well, even though they
might be smaller than the minimum size.ILcdFunction
has been applied.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void modelProduced(TLcdModelProducerEvent aModelProducerEvent)
ILcdModelProducerListener
modelProduced
in interface ILcdModelProducerListener
aModelProducerEvent
- the event describing the changes to a ILcdModelProducer
.public int modelCount()
ILcdModelTreeNode
Returns the number of child models of this model node.
modelCount
in interface ILcdModelContainer
modelCount
in interface ILcdModelTreeNode
public ILcdModel getModel(int aIndex)
ILcdModelTreeNode
Returns the child model at the given index.
getModel
in interface ILcdModelContainer
getModel
in interface ILcdModelTreeNode
aIndex
- a valid index in this ILcdModelTreeNode
public Enumeration models()
ILcdModelTreeNode
Returns an Enumeration
of the child models of this
ILcdModelTreeNode
.
models
in interface ILcdModelContainer
models
in interface ILcdModelTreeNode
Enumeration
of the child models of this ILcdModelTreeNode
.public boolean addModel(ILcdModel aModel)
ILcdModelTreeNode
Adds the ILcdModel aModel
as a child model to this
ILcdModelTreeNode
.
addModel
in interface ILcdModelContainer
addModel
in interface ILcdModelTreeNode
aModel
- the model to be added.true
if this collection of models changed as a result of the callpublic boolean removeModel(ILcdModel aModel)
ILcdModelTreeNode
Removes the child model aModel
from this ILcdModelTreeNode
.
removeModel
in interface ILcdModelContainer
removeModel
in interface ILcdModelTreeNode
aModel
- the model to be removed.true
if a model was removed as a result of this callpublic void addModelContainerListener(ILcdModelContainerListener aModelContainerListener)
ILcdModelTreeNode
ILcdModelContainerListener
to this ILcdModelContainer
.
It will only receive notifications of changes in this ILcdModelTreeNode
and 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 (see ILcdModelTreeNode.addHierarchyModelContainerListener(ILcdModelContainerListener)
).
addModelContainerListener
in interface ILcdModelContainer
addModelContainerListener
in interface ILcdModelTreeNode
aModelContainerListener
- the listener to be added.ILcdModelContainer.removeModelContainerListener(com.luciad.model.ILcdModelContainerListener)
public void removeModelContainerListener(ILcdModelContainerListener aModelContainerListener)
ILcdModelTreeNode
ILcdModelContainerListener
from this ILcdModelContainer
.
It is not possible to remove a hierarchy model container listener. Use ILcdModelTreeNode.removeHierarchyModelContainerListener(ILcdModelContainerListener)
for this purpose.
removeModelContainerListener
in interface ILcdModelContainer
removeModelContainerListener
in interface ILcdModelTreeNode
aModelContainerListener
- the listener to be removed.ILcdModelContainer.addModelContainerListener(com.luciad.model.ILcdModelContainerListener)
public boolean isEmpty()
ILcdModelTreeNode
Returns true
when the model node is only used as a container for other models,
and contains no useful data itself, false
otherwise.
isEmpty
in interface ILcdModelTreeNode
true
when the model node contains no useful data, false
otherwisepublic void addHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
ILcdModelTreeNode
Registers the given ILcdModelContainerListener
to receive TLcdModelContainerEvent
s from all the
ILcdModelTreeNode
s 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 (see ILcdModelTreeNode.addModelContainerListener(ILcdModelContainerListener)
).
The source ILcdModelContainer
of the event can be retrieved by calling TLcdModelContainerEvent.getModelContainer()
on the received TLcdModelContainerEvent
.
addHierarchyModelContainerListener
in interface ILcdModelTreeNode
aModelContainerListener
- the listenerILcdModelTreeNode.removeHierarchyModelContainerListener(ILcdModelContainerListener)
public void removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
ILcdModelTreeNode
Unregisters the given ILcdModelContainerListener
from receiving TLcdModelContainerEvent
s for the tree
with this node as root node.
removeHierarchyModelContainerListener
in interface ILcdModelTreeNode
aModelContainerListener
- the listenerILcdModelTreeNode.addHierarchyModelContainerListener(ILcdModelContainerListener)
public void addHierarchyModelListener(ILcdModelListener aModelListener)
ILcdModelTreeNode
Registers the given ILcdModelListener
to receive
TLcdModelChangedEvent
s from all the ILcdModel
s 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 (see ILcdModelTreeNode.addModelListener(ILcdModelListener)
).
The source ILcdModel
of the event can be retrieved by calling TLcdModelChangedEvent.getModel()
on the received TLcdModelChangedEvent
.
addHierarchyModelListener
in interface ILcdModelTreeNode
aModelListener
- the listenerILcdModelTreeNode.removeHierarchyModelListener(ILcdModelListener)
public void removeHierarchyModelListener(ILcdModelListener aModelListener)
ILcdModelTreeNode
Unregisters the given ILcdModelListener
from
receiving TLcdModelChangedEvent
s for the tree with this node as root node.
removeHierarchyModelListener
in interface ILcdModelTreeNode
aModelListener
- the listenerILcdModelTreeNode.addHierarchyModelListener(ILcdModelListener)
public String getName()
name
element.NAME_PROPERTY
property.public void setName(String aValue)
name
element.aValue
- the value to set for the NAME_PROPERTY
property.public void setVisibility(Boolean aValue)
visibility
element.aValue
- the value to set for the VISIBILITY_PROPERTY
property.public Boolean getOpen()
open
element.OPEN_PROPERTY
property.public void setOpen(Boolean aValue)
open
element.aValue
- the value to set for the OPEN_PROPERTY
property.public ILcdDataObject getAuthor()
author
element.AUTHOR_PROPERTY
property.public void setAuthor(ILcdDataObject aValue)
author
element.aValue
- the value to set for the AUTHOR_PROPERTY
property.public ILcdDataObject getAtomLink()
link
element.ATOM_LINK_PROPERTY
property.public void setAtomLink(ILcdDataObject aValue)
link
element.aValue
- the value to set for the ATOM_LINK_PROPERTY
property.public String getAddress()
address
element.ADDRESS_PROPERTY
property.public void setAddress(String aValue)
address
element.aValue
- the value to set for the ADDRESS_PROPERTY
property.public ILcdDataObject getAddressDetails()
AddressDetails
element.
This container defines the details of the address. Can define multiple addresses including tracking address history
ADDRESS_DETAILS_PROPERTY
property.public void setAddressDetails(ILcdDataObject aValue)
AddressDetails
element.
This container defines the details of the address. Can define multiple addresses including tracking address history
aValue
- the value to set for the ADDRESS_DETAILS_PROPERTY
property.public String getPhoneNumber()
phoneNumber
element.PHONE_NUMBER_PROPERTY
property.public void setPhoneNumber(String aValue)
phoneNumber
element.aValue
- the value to set for the PHONE_NUMBER_PROPERTY
property.public TLcdKML22Snippet getSnippet()
Snippet
and snippet
elements.
The possible values for this property are instances of
TLcdKML22Snippet
String
SNIPPET_PROPERTY
property.public void setSnippet(TLcdKML22Snippet aValue)
Snippet
and snippet
elements.
The possible values for this property are instances of
TLcdKML22Snippet
String
aValue
- the value to set for the SNIPPET_PROPERTY
property.public String getDescription()
description
element.DESCRIPTION_PROPERTY
property.public void setDescription(String aValue)
description
element.aValue
- the value to set for the DESCRIPTION_PROPERTY
property.public TLcdKML22AbstractView getAbstractViewGroup()
AbstractViewGroup
element.ABSTRACT_VIEW_GROUP_PROPERTY
property.public void setAbstractViewGroup(TLcdKML22AbstractView aValue)
AbstractViewGroup
element.aValue
- the value to set for the ABSTRACT_VIEW_GROUP_PROPERTY
property.public TLcdKML22AbstractTimePrimitive getAbstractTimePrimitiveGroup()
AbstractTimePrimitiveGroup
element.ABSTRACT_TIME_PRIMITIVE_GROUP_PROPERTY
property.public void setAbstractTimePrimitiveGroup(TLcdKML22AbstractTimePrimitive aValue)
AbstractTimePrimitiveGroup
element.aValue
- the value to set for the ABSTRACT_TIME_PRIMITIVE_GROUP_PROPERTY
property.public String getStyleUrl()
styleUrl
element.STYLE_URL_PROPERTY
property.public void setStyleUrl(String aValue)
styleUrl
element.aValue
- the value to set for the STYLE_URL_PROPERTY
property.public List<TLcdKML22AbstractStyleSelector> getAbstractStyleSelectorGroup()
AbstractStyleSelectorGroup
element.ABSTRACT_STYLE_SELECTOR_GROUP_PROPERTY
property.public TLcdKML22Region getRegion()
Region
element.REGION_PROPERTY
property.public void setRegion(TLcdKML22Region aValue)
Region
element.aValue
- the value to set for the REGION_PROPERTY
property.public ILcdDataObject getExtendedData()
Metadata
and ExtendedData
elements.
The possible values for this property are instances of
EXTENDED_DATA_PROPERTY
property.public void setExtendedData(ILcdDataObject aValue)
Metadata
and ExtendedData
elements.
The possible values for this property are instances of
aValue
- the value to set for the EXTENDED_DATA_PROPERTY
property.