public abstract class ALcdTransformingModel extends Object implements ILcdModel
A model representing transformed data of an original model
.
It uses a TLcdClusteringTransformer
to perform the transformation.
As the data transformation can be time-consuming, it might take a while before the original model
and this transformed model are in sync.
For example when an element is added to the original model, the transformed model must recalculate the
transformation.
Only when recalculation is done, the elements of the transformed model are updated.
To ensure that the layer containing this model remains responsive, the transformation is calculated on
a dedicated thread.
Once the transformation is done, the transformed model is updated (under a write lock) on the painting thread.
This means that you should treat this ALcdTransformingModel
just as you do any other ILcdModel
:
TLcdLockUtil.writeLock(Object)
).originalToTransformed(Collection)
and transformedToOriginal(Collection)
methods)
requires a read lock (see TLcdLockUtil.readLock(Object)
.
More information about the threading and locking rules of ILcdModel
instances can be found in the
developer guide.
The asynchronous nature of the transformation implies that when ILcdMultiDimensionalModel.applyDimensionFilter(com.luciad.multidimensional.TLcdDimensionFilter, int)
is called on an implementation of this class that also implements ILcdMultiDimensionalModel
,
Use TLcdTransformingModelFactory
to create instances of this class.
TLcdTransformingModelFactory
,
Serialized FormILcdModel.Query
FIRE_LATER, FIRE_NOW, NO_EVENT
Modifier and Type | Method and Description |
---|---|
abstract ILcdModel |
getOriginalModel()
Returns the model containing the original data on which the
TLcdClusteringTransformer
operates |
abstract Collection<Object> |
originalToTransformed(Collection<Object> aOriginalModelElements)
Returns a collection containing the domain objects from this
ALcdTransformingModel corresponding to
the objects from the getOriginalModel() contained in aOriginalModelElements |
abstract void |
setTransformer(TLcdClusteringTransformer aModelTransformer)
Sets the transformer responsible from transforming data from the original model.
|
abstract Collection<Object> |
transformedToOriginal(Collection<Object> aTransformedModelElements)
Returns a collection containing the domain objects from
getOriginalModel() corresponding to
the objects from this ALcdTransformingModel contained in aTransformedModelElements |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addElement, addElements, addModelListener, all, canAddElement, canRemoveElement, dispose, elementChanged, elements, elementsChanged, filter, fireCollectedModelChanges, getModelDescriptor, getModelEncoder, getModelMetadata, getModelReference, query, removeAllElements, removeElement, removeElements, removeModelListener
close
public abstract ILcdModel getOriginalModel()
TLcdClusteringTransformer
operatesTLcdClusteringTransformer
operatespublic abstract void setTransformer(TLcdClusteringTransformer aModelTransformer)
Sets the transformer responsible from transforming data from the original model.
aModelTransformer
- The transformer. Must not be null
.public abstract Collection<Object> originalToTransformed(Collection<Object> aOriginalModelElements)
ALcdTransformingModel
corresponding to
the objects from the getOriginalModel()
contained in aOriginalModelElements
aOriginalModelElements
- The elements of the getOriginalModel()
for which the
corresponding elements must be retrievedALcdTransformingModel
corresponding to
the objects from the getOriginalModel()
contained in aOriginalModelElements
.
Never null
, but might be empty (for example when those elements are filtered out).public abstract Collection<Object> transformedToOriginal(Collection<Object> aTransformedModelElements)
getOriginalModel()
corresponding to
the objects from this ALcdTransformingModel
contained in aTransformedModelElements
aTransformedModelElements
- The elements of this ALcdTransformingModel
for which the corresponding elements
must be retrievedgetOriginalModel()
corresponding to
the objects from this ALcdTransformingModel
contained in aTransformedModelElements
.
Never null
, but might be empty.