Package com.luciad.lucy.format
Class TLcyTransformingModelFormatWrapper
java.lang.Object
com.luciad.lucy.format.ALcyFormat
com.luciad.lucy.format.ALcyFormatWrapper
com.luciad.lucy.format.TLcyTransformingModelFormatWrapper
An
ALcyFormatWrapper
instance which adds support for transforming the models in the layer factory, for
example to add support for clustering.
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.ClusteringSHPAddOn#createSHPFormat()
.- Since:
- 2017.1
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcyTransformingModelFormatWrapper
(ALcyFormat aFormat, Function<ILcdModel, Optional<ALcdTransformingModel>> aTransformingModelProducer, ILcdGXYLayerFactory aTransformedModelLayerFactory) Creates a newTLcyTransformingModelFormatWrapper
instance -
Method Summary
Modifier and TypeMethodDescriptionprotected final ILcdGXYLayerFactory
Creates aILcdGXYLayerFactory
for this format.protected final ALcyWorkspaceObjectCodec[]
Creates theALcyWorkspaceObjectCodec
codecs that can encode and decode theILcdModel
instances produces by the model decoders of this format.final boolean
isModelOfFormat
(ILcdModel aModel) Returns true if and only if the given model is a model of the current data format.final ILcdModel
transformModel
(ILcdModel aModel) This public method can be called from other classes to obtain a transformed version ofaModel
, for example if a Lightspeed format wants to add clustering for its domain objects.Methods inherited from class com.luciad.lucy.format.ALcyFormatWrapper
createAll, createAsynchronousPaintHintProvider, createBalloonContentProviders, createDataPropertyValueCustomizerPanelFactories, createDataSourceHandlerFileTypeDescriptorGroups, createDataSourceHandlerFileTypeDescriptors, createDataSourceHandlers, createDefaultModelDescriptorFactories, createDomainObjectCustomizerPanelFactories, createDomainObjectCustomizerPanelWorkspaceCodecs, createDomainObjectWorkspaceCodecs, createFormatBarFactory, createGXYLayerCustomizerPanelFactories, createGXYLayerCustomizerPanelWorkspaceCodecs, createGXYLayerDecoderFileTypeDescriptors, createGXYLayerDecoders, createGXYLayerEncoderFileTypeDescriptors, createGXYLayerEncoders, createGXYLayerSelectionTransferHandlers, createGXYLayerStyleProvider, createGXYLayerTypeProvider, createGXYLayerWorkspaceCodecs, createLabelPlacementHintProvider, createLayerHeightProviderFactory, createLayerMeasureProviderFactory, createModelContentTypeProvider, createModelCustomizerPanelFactories, createModelCustomizerPanelWorkspaceCodecs, createModelDecoderFileTypeDescriptorGroups, createModelDecoderFileTypeDescriptors, createModelDecoders, createModelEncoderCustomizerPanelFactories, createModelEncoderCustomizerPanelWorkspaceCodecs, createModelEncoderFileTypeDescriptors, createModelEncoders, createModelFactory, createModelHeightProviderFactory, createModelMeasureProviderFactory, createModelMetaDataCustomizerPanelFactories, createModelMetaDataCustomizerPanelWorkspaceCodecs, getFormat, getLongPrefix, getLucyEnv, getShortPrefix, isGXYLayerOfFormat
Methods inherited from class com.luciad.lucy.format.ALcyFormat
createGXYLayerOfFormatFilter, createLayerContextOfFormatFilter, createModelContextOfFormatFilter, createModelOfFormatFilter, getAsynchronousPaintHintProvider, getBalloonContentProviders, getDataPropertyValueCustomizerPanelFactories, getDataSourceHandlerFileTypeDescriptorGroups, getDataSourceHandlerFileTypeDescriptors, getDataSourceHandlers, getDefaultModelDescriptorFactories, getDomainObjectCustomizerPanelFactories, getDomainObjectCustomizerPanelWorkspaceCodecs, getDomainObjectWorkspaceCodecs, getFormatBarFactory, getGXYLayerCustomizerPanelFactories, getGXYLayerCustomizerPanelWorkspaceCodecs, getGXYLayerDecoderFileTypeDescriptors, getGXYLayerDecoders, getGXYLayerEncoderFileTypeDescriptors, getGXYLayerEncoders, getGXYLayerFactory, getGXYLayerSelectionTransferHandlers, getGXYLayerStyleProvider, getGXYLayerTypeProvider, getGXYLayerWorkspaceCodecs, getLabelPlacementHintProvider, getLayerHeightProviderFactory, getLayerMeasureProviderFactory, getModelContentTypeProvider, getModelCustomizerPanelFactories, getModelCustomizerPanelWorkspaceCodecs, getModelDecoderFileTypeDescriptorGroups, getModelDecoderFileTypeDescriptors, getModelDecoders, getModelEncoderCustomizerPanelFactories, getModelEncoderCustomizerPanelWorkspaceCodecs, getModelEncoderFileTypeDescriptors, getModelEncoders, getModelFactory, getModelHeightProviderFactory, getModelMeasureProviderFactory, getModelMetaDataCustomizerPanelFactories, getModelMetaDataCustomizerPanelWorkspaceCodecs, getModelWorkspaceCodecs, toString
-
Constructor Details
-
TLcyTransformingModelFormatWrapper
public TLcyTransformingModelFormatWrapper(ALcyFormat aFormat, Function<ILcdModel, Optional<ALcdTransformingModel>> aTransformingModelProducer, ILcdGXYLayerFactory aTransformedModelLayerFactory) Creates a newTLcyTransformingModelFormatWrapper
instance- Parameters:
aFormat
- The delegate formataTransformingModelProducer
- Function which convert anILcdModel
into anALcdTransformingModel
when needed (for example to add clustering support). The function should return an empty Optional when the model does not need to be converted.aTransformedModelLayerFactory
- Layer factory responsible for the creation of the layers for theALcdTransformingModel
instances created byaTransformingModelProducer
-
-
Method Details
-
createGXYLayerFactory
Creates a
The factory can also configure label algorithms on the created layers.ILcdGXYLayerFactory
for this format.For each incoming model, the layer factory will:
- Try transforming the model by calling the transforming model producer passed in the constructor.
-
If an
ALcdTransformingModel
is produced, 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.
- Overrides:
createGXYLayerFactory
in classALcyFormatWrapper
- Returns:
- the
ILcdGXYLayerFactory
for this data format. May benull
. - See Also:
-
transformModel
This public method can be called from other classes to obtain a transformed version ofaModel
, for example if a Lightspeed format wants to add clustering for its domain objects. It will delegate the creation of the transformed model to the transforming model producer function passed in the constructor.- Parameters:
aModel
- The model- Returns:
- An
ALcdTransformingModel
ofaModel
(for example to add clustering support) oraModel
when no transformation is needed.
-
createModelWorkspaceCodecs
Description copied from class:ALcyFormat
Creates the
ALcyWorkspaceObjectCodec
codecs that can encode and decode theILcdModel
instances produces by the model decoders of this format.- Overrides:
createModelWorkspaceCodecs
in classALcyFormatWrapper
- Returns:
- An array containing the
ALcyWorkspaceObjectCodec
instances. Must not benull
, but may have length0
. Must not containnull
. - See Also:
-
isModelOfFormat
Description copied from class:ALcyFormat
Returns true if and only if the given model is a model of the current data format.- Overrides:
isModelOfFormat
in classALcyFormatWrapper
- Parameters:
aModel
- The model to check.- Returns:
true
if and only if the given model is a model of the current data format.
-