public class TLcyLspTransformingModelFormatWrapper extends ALcyLspFormatWrapper
An ALcyLspFormatWrapper
instance which adds support for transforming the models in the layer factory, for
example to add support for clustering.
This format wrapper can only be used if the ALcyFormat
(which normally provides the model decoder and model workspace support for the format)
is wrapped with an TLcyTransformingModelFormatWrapper
.
This format wrapper has a layer factory implementation which allows to convert the model
into a ALcdTransformingModel
and create a layer for that.
A possible use-case is if you want to cluster the domain objects on the map.
The Lucy clustering sample illustrates a usage of this class.
See samples.lucy.clustering.lightspeed.LspClusteringSHPAddOn#createBaseFormat()
.
TLcyTransformingModelFormatWrapper
Constructor and Description |
---|
TLcyLspTransformingModelFormatWrapper(ALcyLspFormat aFormat,
TLcyTransformingModelFormatWrapper aGXYFormatWrapper,
ILspLayerFactory aTransformedModelLayerFactory)
Creates a new
TLcyLspTransformingModelFormatWrapper instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandleModel(ILcdModel aModel)
Returns
true if and only if the given model can be visualized by this format. |
ILspLayerFactory |
createLayerFactory()
Creates the layer factory for this format.
|
boolean |
isLayerOfFormat(ILspLayer aLayer)
Returns
true if and only if the given layer is a layer of this format. |
createAll, createBalloonContentProviders, createFormatBarFactory, createLayerCustomizerPanelFactories, createLayerCustomizerPanelWorkspaceCodecs, createLayerMeasureProviderFactory, createLayerSelectionTransferHandlers, createLayerStyleCodecFileTypeDescriptors, createLayerStyleCodecs, createLayerStyleProviders, createLayerWorkspaceCodecs, getFormat, getLongPrefix, getLucyEnv, getShortPrefix
checkInitialized, createLayerContextOfFormatFilter, getBalloonContentProviders, getFormatBarFactory, getLayerCustomizerPanelFactories, getLayerCustomizerPanelWorkspaceCodecs, getLayerFactory, getLayerMeasureProviderFactory, getLayerSelectionTransferHandlers, getLayerStyleCodecFileTypeDescriptors, getLayerStyleCodecs, getLayerStyleProviders, getLayerWorkspaceCodecs, toString
public TLcyLspTransformingModelFormatWrapper(ALcyLspFormat aFormat, TLcyTransformingModelFormatWrapper aGXYFormatWrapper, ILspLayerFactory aTransformedModelLayerFactory)
TLcyLspTransformingModelFormatWrapper
instance.aFormat
- The delegate Lightspeed formataGXYFormatWrapper
- The TLcyTransformingModelFormatWrapper
instance which is used to add transforming model support
to the GXY format.
The actual transforming of the models will be delegated to the TLcyTransformingModelFormatWrapper.transformModel(ILcdModel)
method.aTransformedModelLayerFactory
- Layer factory responsible for the creation of the layers for ALcdTransformingModel
instances.public final ILspLayerFactory createLayerFactory()
Creates the layer factory for this format. The default implementation returns null
.
This implementations returns the instance created by the decorated format.
For each incoming model, the layer factory will:
TLcyTransformingModelFormatWrapper.transformModel(ILcdModel)
method.ALcdTransformingModel
, layer creation will be delegated to the layer factory passed in the constructor.
If not, layer creation is delegated to the layer factory of the delegate format.
createLayerFactory
in class ALcyLspFormatWrapper
ILspLayerFactory
for this format. May be null
ALcyLspFormat.getLayerFactory()
public final boolean canHandleModel(ILcdModel aModel)
ALcyLspFormat
Returns true
if and only if the given model can be visualized by this format.
canHandleModel
in class ALcyLspFormatWrapper
aModel
- The model to checktrue
if and only if the given model can be visualized by this format.public final boolean isLayerOfFormat(ILspLayer aLayer)
ALcyLspFormat
Returns true
if and only if the given layer is a layer of this format.
The default implementation uses the ALcyLspFormat.canHandleModel(com.luciad.model.ILcdModel)
to
determine whether aLayer
is a layer of this format.
isLayerOfFormat
in class ALcyLspFormatWrapper
aLayer
- The layer to checktrue
if and only if the given layer is a layer of this format