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
ALcyPropertiesinstance 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 aTLcyAsynchronousFormatWrapperfor 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
ALcyPropertiesinstance 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
ILcdModelDescriptorof a decodedILcdModelcan again be provided to theILcdModelDecoderto get the model back. - If an
ILcdModelEncoderis available, and when saving anILcdModelunder a different name usingILcdModel.getModelEncoder().export, the source name of theILcdModelDescriptorof theILcdModelis 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
ILcdModelis 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 bycreateDomainObjectWorkspaceCodecscan remove this assumption. - If the
ILcdModelDecoderreturns aTLcdModelList, that the sub-models are always in the same order for the same data source.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedALcyGeneralFormat(ILcyLucyEnv aLucyEnv, Class aClass, ALcyProperties aProperties) Deprecated.Better use the constructor with explicit long and short prefix, to avoid any confusion.protectedALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties) Creates aALcyGeneralFormatfor the specified Lucy backend.protectedALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties, String aPropertyPrefix) Creates aALcyGeneralFormatfor the specified Lucy backend. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcyAsynchronousPaintHintProviderCreates aILcyAsynchronousPaintHintProviderfor this format.protected ALcyWorkspaceObjectCodec[]Creates theALcyWorkspaceObjectCodecthat can encode and decode theILcyCustomizerPanelinstances for the domain objects produced by the model decoders of this format.protected ILcyGXYLabelPlacementHintProviderCreates theILcyLabelPlacementHintProviderthat can create aTLcyGXYLabelPlacementHintfor layers of this format.protected ALcyWorkspaceObjectCodec[]Creates theALcyWorkspaceObjectCodeccodecs that can encode and decode theILcdModelinstances 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 theILcyLucyEnvbackend with which thisALcyFormatis associated.Returns theALcyPropertiesholding 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 usinggetLongPrefixandgetShortPrefix. 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- TheALcyPropertiesinstance holding the configuration for this format. Must not benull.- See Also:
-
ALcyGeneralFormat
protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties) Creates aALcyGeneralFormatfor 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- TheALcyPropertiesinstance holding the configuration for this format. Must not benull.
-
ALcyGeneralFormat
protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties, String aPropertyPrefix) Creates aALcyGeneralFormatfor 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- TheALcyPropertiesinstance 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 fromaShortPrefixwhen the properties contain settings for multiple formats.
-
-
Method Details
-
getLucyEnv
Description copied from class:ALcyFormatReturns the
ILcyLucyEnvbackend with which thisALcyFormatis associated.- Specified by:
getLucyEnvin classALcyFormat- Returns:
- The
ILcyLucyEnvbackend. Must not benull.
-
getLongPrefix
Description copied from class:ALcyFormatReturns 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:
getLongPrefixin 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:
getShortPrefixin 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 theALcyPropertiesholding the configuration of this format. It's strongly recommended to use keys that start with a format specific property prefix.- Returns:
- The
ALcyPropertiesholding the configuration. Nevernull.
-
createAsynchronousPaintHintProvider
Description copied from class:ALcyFormatCreates a
ILcyAsynchronousPaintHintProviderfor this format.- Specified by:
createAsynchronousPaintHintProviderin classALcyFormat- Returns:
- A
ILcyAsynchronousPaintHintProviderfor the layers created by the layer factories of this format. May benull. - See Also:
-
createModelWorkspaceCodecs
Description copied from class:ALcyFormatCreates the
ALcyWorkspaceObjectCodeccodecs that can encode and decode theILcdModelinstances produces by the model decoders of this format.- Overrides:
createModelWorkspaceCodecsin classALcyFormat- Returns:
- An array containing the
ALcyWorkspaceObjectCodecinstances. Must not benull, but may have length0. Must not containnull. - See Also:
-
createDomainObjectWorkspaceCodecs
Description copied from class:ALcyFormatCreates the
ALcyWorkspaceObjectCodecthat can encode and decode theILcyCustomizerPanelinstances for the domain objects produced by the model decoders of this format.- Overrides:
createDomainObjectWorkspaceCodecsin classALcyFormat- Returns:
- An array of
ALcyWorkspaceObjectCodecinstances. Must not benullbut may have length0. Must not containnull. - See Also:
-
createLabelPlacementHintProvider
Creates theILcyLabelPlacementHintProviderthat can create aTLcyGXYLabelPlacementHintfor layers of this format.This implementation return an
ILcyLabelPlacementHintProviderthat creates aTLcyGXYLabelPlacementHintcontaining a labeling group. The labeling group is read from the format's configuration file.- Overrides:
createLabelPlacementHintProviderin classALcyFormat- Returns:
- An
ILcyLabelPlacementHintProvider. - See Also:
-