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
ConstructorsConstructorDescriptionTLcyTransformingModelFormatWrapper(ALcyFormat aFormat, Function<ILcdModel, Optional<ALcdTransformingModel>> aTransformingModelProducer, ILcdGXYLayerFactory aTransformedModelLayerFactory) Creates a newTLcyTransformingModelFormatWrapperinstance -
Method Summary
Modifier and TypeMethodDescriptionprotected final ILcdGXYLayerFactoryCreates aILcdGXYLayerFactoryfor this format.protected final ALcyWorkspaceObjectCodec[]Creates theALcyWorkspaceObjectCodeccodecs that can encode and decode theILcdModelinstances produces by the model decoders of this format.final booleanisModelOfFormat(ILcdModel aModel) Returns true if and only if the given model is a model of the current data format.final ILcdModeltransformModel(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, isGXYLayerOfFormatMethods 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 newTLcyTransformingModelFormatWrapperinstance- Parameters:
aFormat- The delegate formataTransformingModelProducer- Function which convert anILcdModelinto anALcdTransformingModelwhen 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 theALcdTransformingModelinstances created byaTransformingModelProducer
-
-
Method Details
-
createGXYLayerFactory
Creates a
The factory can also configure label algorithms on the created layers.ILcdGXYLayerFactoryfor 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
ALcdTransformingModelis 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:
createGXYLayerFactoryin classALcyFormatWrapper- Returns:
- the
ILcdGXYLayerFactoryfor 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
ALcdTransformingModelofaModel(for example to add clustering support) oraModelwhen no transformation is needed.
-
createModelWorkspaceCodecs
Description copied from class:ALcyFormatCreates the
ALcyWorkspaceObjectCodeccodecs that can encode and decode theILcdModelinstances produces by the model decoders of this format.- Overrides:
createModelWorkspaceCodecsin classALcyFormatWrapper- Returns:
- An array containing the
ALcyWorkspaceObjectCodecinstances. Must not benull, but may have length0. Must not containnull. - See Also:
-
isModelOfFormat
Description copied from class:ALcyFormatReturns true if and only if the given model is a model of the current data format.- Overrides:
isModelOfFormatin classALcyFormatWrapper- Parameters:
aModel- The model to check.- Returns:
trueif and only if the given model is a model of the current data format.
-