Class ALcyGeneralFormat
- Direct Known Subclasses:
ALcyFileFormat
ALcyFormat
that works on general data formats (not necessarily files on disk), but
provides some nice extras:
- it adds workspace support for models and domain objects.
- it adds an asynchronous hint paint provider.
The behavior of this paint hint provider is based on the contents of the
ALcyProperties
instance passed in the constructor through the following key-value pairs:# Properties to configure the asynchronous paint hint provider (see
ALcyFormat.getAsynchronousPaintHintProvider()
). # Note that configuring the paint hint provider is not sufficient to enable asynchronous painting. # the format still needs to be wrapped with aTLcyAsynchronousFormatWrapper
for asynchronous painting. # When true, it indicates that an async paint hint provider must be created propertyPrefix.asynchronous = true # String value for theTLcyAsynchronousPaintHint.getMergeGroup()
propertyPrefix.asynchronous.mergeGroup = myMergeGroup # Boolean: when true, only the bodies are asynchronous. SeeTLcyAsynchronousPaintHint.isBodiesOnly()
propertyPrefix.asynchronous.bodiesOnly = false # Integer: seeTLcyAsynchronousPaintHint.getMinimumThreadPriority()
propertyPrefix.asynchronous.minimumThreadPriority = 0 - it adds a label placement hint provider.
The behavior of this label placement hint provider is based on the contents of the
ALcyProperties
instance passed in the constructor through the following key-value pairs:# Properties to configure the label placement hint provider (see
ALcyFormat.getLabelPlacementHintProvider()
). # String value for theTLcyGXYLabelPlacementHint.getLabelPlacementGroup()
propertyPrefix.labelPlacementGroup = myLabelPlacementGroup
- There is an
ILcdModelDecoder
. - The source name of the
ILcdModelDescriptor
of a decodedILcdModel
can again be provided to theILcdModelDecoder
to get the model back. - If an
ILcdModelEncoder
is available, and when saving anILcdModel
under a different name usingILcdModel.getModelEncoder().export
, the source name of theILcdModelDescriptor
of theILcdModel
is updated. This is usually only applicable for files, but not necessarily restricted to it. - The order in which the domain objects are decoded in an
ILcdModel
is deterministic. It uses this information to for example remember the selected objects. If the order does change, it will not throw exceptions, but side effects such as incorrectly restoring the selection and warning messages could appear. Replacing the codecs created bycreateDomainObjectWorkspaceCodecs
can remove this assumption. - If the
ILcdModelDecoder
returns aTLcdModelList
, that the sub-models are always in the same order for the same data source.
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALcyGeneralFormat
(ILcyLucyEnv aLucyEnv, Class aClass, ALcyProperties aProperties) Deprecated.Better use the constructor with explicit long and short prefix, to avoid any confusion.protected
ALcyGeneralFormat
(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties) Creates aALcyGeneralFormat
for the specified Lucy backend.protected
ALcyGeneralFormat
(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties, String aPropertyPrefix) Creates aALcyGeneralFormat
for the specified Lucy backend. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcyAsynchronousPaintHintProvider
Creates aILcyAsynchronousPaintHintProvider
for this format.protected ALcyWorkspaceObjectCodec[]
Creates theALcyWorkspaceObjectCodec
that can encode and decode theILcyCustomizerPanel
instances for the domain objects produced by the model decoders of this format.protected ILcyGXYLabelPlacementHintProvider
Creates theILcyLabelPlacementHintProvider
that can create aTLcyGXYLabelPlacementHint
for layers of this format.
protected ALcyWorkspaceObjectCodec[]
Creates theALcyWorkspaceObjectCodec
codecs that can encode and decode theILcdModel
instances produces by the model decoders of this format.Returns the long prefix of this format that can be used, for instance, to derive UID's.Returns theILcyLucyEnv
backend with which thisALcyFormat
is associated.Returns theALcyProperties
holding the configuration of this format.Returns the prefix that is used when deriving keys to retrieve configuration properties.Returns the short prefix of this format that can be used, for example, by the workspace codecs when writing information to the workspace.Methods inherited from class com.luciad.lucy.format.ALcyFormat
createAll, createBalloonContentProviders, createDataPropertyValueCustomizerPanelFactories, createDataSourceHandlerFileTypeDescriptorGroups, createDataSourceHandlerFileTypeDescriptors, createDataSourceHandlers, createDefaultModelDescriptorFactories, createDomainObjectCustomizerPanelFactories, createDomainObjectCustomizerPanelWorkspaceCodecs, createFormatBarFactory, createGXYLayerCustomizerPanelFactories, createGXYLayerCustomizerPanelWorkspaceCodecs, createGXYLayerDecoderFileTypeDescriptors, createGXYLayerDecoders, createGXYLayerEncoderFileTypeDescriptors, createGXYLayerEncoders, createGXYLayerFactory, createGXYLayerOfFormatFilter, createGXYLayerSelectionTransferHandlers, createGXYLayerStyleProvider, createGXYLayerTypeProvider, createGXYLayerWorkspaceCodecs, createLayerContextOfFormatFilter, createLayerHeightProviderFactory, createLayerMeasureProviderFactory, createModelContentTypeProvider, createModelContextOfFormatFilter, createModelCustomizerPanelFactories, createModelCustomizerPanelWorkspaceCodecs, createModelDecoderFileTypeDescriptorGroups, createModelDecoderFileTypeDescriptors, createModelDecoders, createModelEncoderCustomizerPanelFactories, createModelEncoderCustomizerPanelWorkspaceCodecs, createModelEncoderFileTypeDescriptors, createModelEncoders, createModelFactory, createModelHeightProviderFactory, createModelMeasureProviderFactory, createModelMetaDataCustomizerPanelFactories, createModelMetaDataCustomizerPanelWorkspaceCodecs, 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, isGXYLayerOfFormat, isModelOfFormat, toString
-
Constructor Details
-
ALcyGeneralFormat
@Deprecated protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, Class aClass, ALcyProperties aProperties) Deprecated.Better use the constructor with explicit long and short prefix, to avoid any confusion. Functionally equivalent toALcyGeneralFormat(aLucyEnv, ALcyTool.getLongPrefix(aClass), ALcyTool.getShortPrefix(aClass), aProperties)
.- Parameters:
aLucyEnv
- The Lucy backend for which to create this format. Must not benull
.aClass
- A representative class for using thisALcyApplicationPaneTool
, normally an extension ofALcyAddOn
. It is used to retrieve the long and short prefixes usinggetLongPrefix
andgetShortPrefix
. These prefixes are stored in workspace files, so if backward compatibility is a concern (e.g. read an old workspace file), the given class or its name must never change.aProperties
- TheALcyProperties
instance holding the configuration for this format. Must not benull
.- See Also:
-
ALcyGeneralFormat
protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties) Creates aALcyGeneralFormat
for the specified Lucy backend.- Parameters:
aLucyEnv
- The Lucy backend for which to create this format. Must not benull
.aLongPrefix
- The long prefix of this format. SeegetLongPrefix()
. Must not benull
.aShortPrefix
- The short prefix of this format. This prefix will also be set as the property prefix and be used when reading values fromaProperties
. SeegetShortPrefix()
andgetPropertyPrefix()
. Must not benull
.aProperties
- TheALcyProperties
instance holding the configuration for this format. Must not benull
.
-
ALcyGeneralFormat
protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties, String aPropertyPrefix) Creates aALcyGeneralFormat
for the specified Lucy backend.- Parameters:
aLucyEnv
- The Lucy backend for which to create this format. Must not benull
.aLongPrefix
- The long prefix of this format. SeegetLongPrefix()
. Must not benull
.aShortPrefix
- The short prefix of this format. SeegetShortPrefix()
Must not benull
.aProperties
- TheALcyProperties
instance holding the configuration for this format. Must not benull
.aPropertyPrefix
- The prefix to use when deriving keys to use for theALcyProperties
. Typically this is only different fromaShortPrefix
when the properties contain settings for multiple formats.
-
-
Method Details
-
getLucyEnv
Description copied from class:ALcyFormat
Returns the
ILcyLucyEnv
backend with which thisALcyFormat
is associated.- Specified by:
getLucyEnv
in classALcyFormat
- Returns:
- The
ILcyLucyEnv
backend. Must not benull
.
-
getLongPrefix
Description copied from class:ALcyFormat
Returns the long prefix of this format that can be used, for instance, to derive UID's. Typically this would be the fully qualified name of the addon.
- Specified by:
getLongPrefix
in classALcyFormat
- Returns:
- The long prefix that can be used to generate UID's. Must not be
null
.
-
getShortPrefix
Returns the short prefix of this format that can be used, for example, by the workspace codecs when writing information to the workspace. Typically this is the class name of add-on.
This prefix should not be used when you want to read values from the properties of this format. Use
getPropertyPrefix()
in that case.- Specified by:
getShortPrefix
in classALcyFormat
- Returns:
- the short prefix of this format
- See Also:
-
getPropertyPrefix
Returns the prefix that is used when deriving keys to retrieve configuration properties. Consult the class javadoc for more information.- Returns:
- the prefix that is used to read properties from the
getProperties()
instance.
-
getProperties
Returns theALcyProperties
holding the configuration of this format. It's strongly recommended to use keys that start with a format specific property prefix.- Returns:
- The
ALcyProperties
holding the configuration. Nevernull
.
-
createAsynchronousPaintHintProvider
Description copied from class:ALcyFormat
Creates a
ILcyAsynchronousPaintHintProvider
for this format.- Specified by:
createAsynchronousPaintHintProvider
in classALcyFormat
- Returns:
- A
ILcyAsynchronousPaintHintProvider
for the layers created by the layer factories of this format. May benull
. - See Also:
-
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 classALcyFormat
- Returns:
- An array containing the
ALcyWorkspaceObjectCodec
instances. Must not benull
, but may have length0
. Must not containnull
. - See Also:
-
createDomainObjectWorkspaceCodecs
Description copied from class:ALcyFormat
Creates the
ALcyWorkspaceObjectCodec
that can encode and decode theILcyCustomizerPanel
instances for the domain objects produced by the model decoders of this format.- Overrides:
createDomainObjectWorkspaceCodecs
in classALcyFormat
- Returns:
- An array of
ALcyWorkspaceObjectCodec
instances. Must not benull
but may have length0
. Must not containnull
. - See Also:
-
createLabelPlacementHintProvider
Creates theILcyLabelPlacementHintProvider
that can create aTLcyGXYLabelPlacementHint
for layers of this format.
This implementation return an
ILcyLabelPlacementHintProvider
that creates aTLcyGXYLabelPlacementHint
containing a labeling group. The labeling group is read from the format's configuration file.- Overrides:
createLabelPlacementHintProvider
in classALcyFormat
- Returns:
- An
ILcyLabelPlacementHintProvider
. - See Also:
-