Class ALcyGeneralFormat

java.lang.Object
com.luciad.lucy.format.ALcyFormat
com.luciad.lucy.format.ALcyGeneralFormat
Direct Known Subclasses:
ALcyFileFormat

public abstract class ALcyGeneralFormat extends ALcyFormat
Extension of ALcyFormat that works on general data formats (not necessarily files on disk), but provides some nice extras: The format makes the following assumptions:
  • There is an ILcdModelDecoder.
  • The source name of the ILcdModelDescriptor of a decoded ILcdModel can again be provided to the ILcdModelDecoder to get the model back.
  • If an ILcdModelEncoder is available, and when saving an ILcdModel under a different name using ILcdModel.getModelEncoder().export, the source name of the ILcdModelDescriptor of the ILcdModel 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 by createDomainObjectWorkspaceCodecs can remove this assumption.
  • If the ILcdModelDecoder returns a TLcdModelList, that the sub-models are always in the same order for the same data source.
  • 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 to ALcyGeneralFormat(aLucyEnv, ALcyTool.getLongPrefix(aClass), ALcyTool.getShortPrefix(aClass), aProperties).
      Parameters:
      aLucyEnv - The Lucy backend for which to create this format. Must not be null.
      aClass - A representative class for using this ALcyApplicationPaneTool, normally an extension of ALcyAddOn. It is used to retrieve the long and short prefixes using getLongPrefix and getShortPrefix. 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 - The ALcyProperties instance holding the configuration for this format. Must not be null.
      See Also:
    • ALcyGeneralFormat

      protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties)
      Creates a ALcyGeneralFormat for the specified Lucy backend.
      Parameters:
      aLucyEnv - The Lucy backend for which to create this format. Must not be null.
      aLongPrefix - The long prefix of this format. See getLongPrefix(). Must not be null.
      aShortPrefix - The short prefix of this format. This prefix will also be set as the property prefix and be used when reading values from aProperties. See getShortPrefix() and getPropertyPrefix(). Must not be null.
      aProperties - The ALcyProperties instance holding the configuration for this format. Must not be null.
    • ALcyGeneralFormat

      protected ALcyGeneralFormat(ILcyLucyEnv aLucyEnv, String aLongPrefix, String aShortPrefix, ALcyProperties aProperties, String aPropertyPrefix)
      Creates a ALcyGeneralFormat for the specified Lucy backend.
      Parameters:
      aLucyEnv - The Lucy backend for which to create this format. Must not be null.
      aLongPrefix - The long prefix of this format. See getLongPrefix(). Must not be null.
      aShortPrefix - The short prefix of this format. See getShortPrefix() Must not be null.
      aProperties - The ALcyProperties instance holding the configuration for this format. Must not be null.
      aPropertyPrefix - The prefix to use when deriving keys to use for the ALcyProperties. Typically this is only different from aShortPrefix when the properties contain settings for multiple formats.
  • Method Details

    • getLucyEnv

      public ILcyLucyEnv getLucyEnv()
      Description copied from class: ALcyFormat

      Returns the ILcyLucyEnv backend with which this ALcyFormat is associated.

      Specified by:
      getLucyEnv in class ALcyFormat
      Returns:
      The ILcyLucyEnv backend. Must not be null.
    • getLongPrefix

      public String 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 class ALcyFormat
      Returns:
      The long prefix that can be used to generate UID's. Must not be null.
    • getShortPrefix

      public String 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 class ALcyFormat
      Returns:
      the short prefix of this format
      See Also:
    • getPropertyPrefix

      public String 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

      public ALcyProperties getProperties()
      Returns the ALcyProperties 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. Never null.
    • createAsynchronousPaintHintProvider

      protected ILcyAsynchronousPaintHintProvider createAsynchronousPaintHintProvider()
      Description copied from class: ALcyFormat

      Creates a ILcyAsynchronousPaintHintProvider for this format.

      Specified by:
      createAsynchronousPaintHintProvider in class ALcyFormat
      Returns:
      A ILcyAsynchronousPaintHintProvider for the layers created by the layer factories of this format. May be null.
      See Also:
    • createModelWorkspaceCodecs

      protected ALcyWorkspaceObjectCodec[] createModelWorkspaceCodecs()
      Description copied from class: ALcyFormat

      Creates the ALcyWorkspaceObjectCodec codecs that can encode and decode the ILcdModel instances produces by the model decoders of this format.

      Overrides:
      createModelWorkspaceCodecs in class ALcyFormat
      Returns:
      An array containing the ALcyWorkspaceObjectCodec instances. Must not be null, but may have length 0. Must not contain null.
      See Also:
    • createDomainObjectWorkspaceCodecs

      protected ALcyWorkspaceObjectCodec[] createDomainObjectWorkspaceCodecs()
      Description copied from class: ALcyFormat

      Creates the ALcyWorkspaceObjectCodec that can encode and decode the ILcyCustomizerPanel instances for the domain objects produced by the model decoders of this format.

      Overrides:
      createDomainObjectWorkspaceCodecs in class ALcyFormat
      Returns:
      An array of ALcyWorkspaceObjectCodec instances. Must not be null but may have length 0. Must not contain null.
      See Also:
    • createLabelPlacementHintProvider

      protected ILcyGXYLabelPlacementHintProvider createLabelPlacementHintProvider()
      Creates the ILcyLabelPlacementHintProvider that can create a TLcyGXYLabelPlacementHint for layers of this format.

      This implementation return an ILcyLabelPlacementHintProvider that creates a TLcyGXYLabelPlacementHint containing a labeling group. The labeling group is read from the format's configuration file.

      Overrides:
      createLabelPlacementHintProvider in class ALcyFormat
      Returns:
      An ILcyLabelPlacementHintProvider.
      See Also: