Class ALcyLspFormat

java.lang.Object
com.luciad.lucy.format.lightspeed.ALcyLspFormat
Direct Known Subclasses:
ALcyLspFormatWrapper, ALcyLspGeneralFormat

public abstract class ALcyLspFormat extends Object

This class provides the basic support facilities for adding Lightspeed visualization for some data format to Lucy. It defines factory methods, some abstract, some with a default implementation, that clients are supposed to implement for their specific data format. For instance there is a factory method for the Lightspeed layer factory.

The createAll method calls all the factory methods and checks whether the created objects follow the documented rules. After this method has been called, all the created objects can be retrieved with the appropriate getters.

None of the implementations of the factory methods are expected to register the created objects with the Lucy back-end. For that you are advised to use the TLcyLspFormatTool.

You are encouraged to only implement the core functionality of your format into a subclass of this ALcyLspFormat, and use one or more ALcyLspFormatWrapper wrappers to enable common functionality. For instance, the TLcyLspSafeGuardFormatWrapper offers convenient checks to for example avoid creating a Lightspeed layer for the wrong model.

You are discouraged to subclass this class directly, rather use one of the more specific extensions such as ALcyLspGeneralFormat.

Since:
2012.0
See Also:
  • Constructor Details

    • ALcyLspFormat

      protected ALcyLspFormat()
      Default constructor.
  • Method Details

    • createAll

      public void createAll()

      Creates all the instances of the concepts of this class by calling all the abstract create<Concept> methods, and performs some validity checks on the created values. All created instances can later on be retrieved by calling the appropriate get<Concept> methods.

    • createLayerFactory

      protected abstract ILspLayerFactory createLayerFactory()

      Creates the layer factory for this format. The default implementation returns null.

      Returns:
      The ILspLayerFactory for this format. May be null
      See Also:
    • getLayerFactory

      public final ILspLayerFactory getLayerFactory()

      Returns the ILspLayerFactory created by this format.

      One must have called createAll before calling this method.

      Returns:
      The ILspLayerFactory created by this format. Can be null
      See Also:
    • createLayerStyleProviders

      protected ILcyLayerStyleProvider[] createLayerStyleProviders()

      Creates the style provider instances that can retrieve and encode the style of the layers created by the layer factory of this format.

      The default implementation returns an empty array.

      Returns:
      The style provider to retrieve and encode the style of the layers. Must not be null. The array may be empty, but must not contain null.
      See Also:
    • getLayerStyleProviders

      public final ILcyLayerStyleProvider[] getLayerStyleProviders()

      Returns the array of ILcyLayerStyleProviders created by this format.

      One must have called createAll before calling this method.

      Returns:
      The ILcyLayerStyleProvider array created by this format. Can be empty but will not be null. The array will not contain any null values.
      See Also:
    • createLayerStyleCodecs

      protected ILcyLayerStyleCodec[] createLayerStyleCodecs()

      Creates the ILcyLayerStyleCodec instances which can encode/decode the style of the layers created by the layer factory of this format.

      The default implementation returns an empty array.

      Returns:
      an array of ILcyLayerStyleCodec instances. Must not be null. The array may be empty, but must not contain null.
      See Also:
    • getLayerStyleCodecs

      public final ILcyLayerStyleCodec[] getLayerStyleCodecs()

      Returns the array of ILcyLayerStyleCodecs created by this format.

      One must have called createAll before calling this method.

      Returns:
      The ILcyLayerStyleCodec array created by this format. Can be empty but will not be null. The array will not contain any null values.
      See Also:
    • createLayerStyleCodecFileTypeDescriptors

      protected ALcyFileTypeDescriptor[] createLayerStyleCodecFileTypeDescriptors()

      Creates ALcyFileTypeDescriptors for the ILcyLayerStyleCodecs. The length of the returned array must be equal to that of createLayerStyleCodecs().

      The default implementation returns a zero-length array.

      Returns:
      An array of ALcyFileTypeDescriptor instances. Must not be null and its length must be equal to the length of the array of layer style encoders created by this format. May contain null.
      See Also:
    • getLayerStyleCodecFileTypeDescriptors

      public final ALcyFileTypeDescriptor[] getLayerStyleCodecFileTypeDescriptors()

      Returns the ALcyFileTypeDescriptor descriptors describing the files for the ILcyLayerStyleCodec codecs created by this format. Should only be called after createAll() has been called.

      Returns:
      The array of ALcyFileTypeDescriptor descriptors.
      See Also:
    • createLayerWorkspaceCodecs

      protected ALcyWorkspaceObjectCodec[] createLayerWorkspaceCodecs()

      Creates the ALcyWorkspaceObjectCodecs that can encode the state of the layers created by the layer factory of this format.

      The default implementation returns an array with a single codec which uses the layer factory and the layer style codecs of the format.

      Returns:
      The array of ALcyWorkspaceObjectCodecs to encode the state of the layers. May be empty but not null. Must not contain null
      See Also:
    • getLayerWorkspaceCodecs

      public final ALcyWorkspaceObjectCodec[] getLayerWorkspaceCodecs()

      Returns the ALcyWorkspaceObjectCodecs that can encode the state of the layers created by the layer factory of this format.

      One must have called createAll before calling this method.

      Returns:
      The ALcyWorkspaceObjectCodecs that can encode the state of the layers. Can be empty but will not be null. Will not contain null.
      See Also:
    • createLayerCustomizerPanelFactories

      protected ILcyCustomizerPanelFactory[] createLayerCustomizerPanelFactories()

      Creates the ILcyCustomizerPanelFactory factories that can create ILcyCustomizerPanel instances for the layers created by the layer factories of this format.

      The default implementation returns a zero-length array.

      If you're looking for the fall back behavior when no factories are registered, see TLcyLspLayerCustomizerAddOn. If you want to customize the behavior for this format only, see TLcyLspStyledLayerCustomizerPanelFactory.

      Returns:
      An array of ILcyCustomizerPanelFactory instances. Must not be null. The array may be empty, but must not contain null.
      See Also:
    • getLayerCustomizerPanelFactories

      public final ILcyCustomizerPanelFactory[] getLayerCustomizerPanelFactories()

      Returns the ILcyCustomizerPanelFactorys that can create ILcyCustomizerPanel instances for the layers created by the layer factories of this format. Should only be called after createAll() has been called.

      The created ILcyCustomizerPanels should work with instances of TLcyLayerContext in their setObject method.

      Returns:
      The array of ILcyCustomizerPanelFactorys.
      See Also:
    • createLayerCustomizerPanelWorkspaceCodecs

      protected ALcyWorkspaceObjectCodec[] createLayerCustomizerPanelWorkspaceCodecs()

      Creates the ALcyWorkspaceObjectCodec codecs for the ILcyCustomizerPanel instances for the layers created by the layer factories of this format.

      Returns:
      An array containing the ALcyWorkspaceObjectCodec instances. Must not be null, but may have length 0. Must not contain null.
      See Also:
    • getLayerCustomizerPanelWorkspaceCodecs

      public final ALcyWorkspaceObjectCodec[] getLayerCustomizerPanelWorkspaceCodecs()

      Returns the ALcyWorkspaceObjectCodecs for the ILcyCustomizerPanel instances for the layers created by the layer factories of this format.

      Returns:
      The array of ALcyWorkspaceObjectCodecs
      See Also:
    • createLayerSelectionTransferHandlers

      protected ALcyLayerSelectionTransferHandler[] createLayerSelectionTransferHandlers()

      Creates the ALcyLayerSelectionTransferHandler transfer handlers that can transfer the selection of the layers created by the layer factories of this format.

      The default implementation returns a zero-length array.

      Returns:
      An array of ALcyLayerSelectionTransferHandler instances. Must not be null but may have length 0. Must not contain null.
      See Also:
    • getLayerSelectionTransferHandlers

      public final ALcyLayerSelectionTransferHandler[] getLayerSelectionTransferHandlers()

      Returns the ALcyLayerSelectionTransferHandler transfer handlers that can transfer the selection of the layers created by the layer factories of this format. Should only be called after createAll() has been called.

      Returns:
      The array of ALcyLayerSelectionTransferHandler transfer handlers.
      See Also:
    • createLayerMeasureProviderFactory

      protected ILcdLayerMeasureProviderFactory createLayerMeasureProviderFactory()

      Creates a ILcdLayerMeasureProviderFactory that can create measure providers for a layer created by the layer factories of this format.

      The default implementation returns null.

      Returns:
      an ILcdLayerMeasureProviderFactory instance. Can be null.
      See Also:
    • getLayerMeasureProviderFactory

      public final ILcdLayerMeasureProviderFactory getLayerMeasureProviderFactory()

      Returns the ILcdLayerMeasureProviderFactory that can create measure providers for a layer created by the layer factories of this format. Should only be called after createAll() has been called.

      Returns:
      an ILcdLayerMeasureProviderFactory instance. Can be null.
      See Also:
    • createFormatBarFactory

      protected ALcyFormatBarFactory createFormatBarFactory()

      Creates the ALcyFormatBarFactory that can create a bar to manipulate layers of this format.

      The default implementation returns null.

      Returns:
      An ALcyFormatBarFactory. May be null.
    • getFormatBarFactory

      public final ALcyFormatBarFactory getFormatBarFactory()

      Returns the ALcyFormatBarFactory that can create a bar to manipulate layers of this format. Should only be called after createAll() has been called.

      Returns:
      The ALcyFormatBarFactory.
      See Also:
    • createBalloonContentProviders

      protected ILcdBalloonContentProvider[] createBalloonContentProviders()

      Creates the ILcdBalloonContentProviders for this format.

      The default implementation returns an empty array.

      Returns:
      the ILcdBalloonContentProviders for this format. Must not be null. The array may be empty but must not contain null.
      See Also:
    • getBalloonContentProviders

      public final ILcdBalloonContentProvider[] getBalloonContentProviders()

      Returns the ILcdBalloonContentProviders created by this format. Should only be called after createAll() has been called.

      Returns:
      The ILcdBalloonContentProviders created by this format
      See Also:
    • getLucyEnv

      public abstract ILcyLucyEnv getLucyEnv()

      Returns the ILcyLucyEnv backend with which this ALcyLspFormat is associated.

      Returns:
      The ILcyLucyEnv backend. Must not be null.
    • getLongPrefix

      public abstract String getLongPrefix()

      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 add-on.

      Returns:
      The long prefix that can be used to generate UID's. Must not be null.
      See Also:
    • getShortPrefix

      public abstract String getShortPrefix()

      Returns the short prefix of this format that can be used, for instance, to derive keys for a ALcyProperties instance. This would typically be the short class name of the add-on.

      Returns:
      The short prefix of this format. Must not be null.
      See Also:
    • canHandleModel

      public abstract boolean canHandleModel(ILcdModel aModel)

      Returns true if and only if the given model can be visualized by this format.

      Parameters:
      aModel - The model to check
      Returns:
      true if and only if the given model can be visualized by this format.
    • isLayerOfFormat

      public boolean isLayerOfFormat(ILspLayer aLayer)

      Returns true if and only if the given layer is a layer of this format.

      The default implementation uses the canHandleModel(com.luciad.model.ILcdModel) to determine whether aLayer is a layer of this format.

      Parameters:
      aLayer - The layer to check
      Returns:
      true if and only if the given layer is a layer of this format
    • createLayerContextOfFormatFilter

      public final ILcdFilter createLayerContextOfFormatFilter(boolean aAcceptArrays)

      Utility method to create a ILcdFilter that only accepts TLcyLayerContexts whose layers are accepted by isLayerOfFormat(com.luciad.view.lightspeed.layer.ILspLayer).

      Parameters:
      aAcceptArrays - if true, the filter will also accept arrays of TLcyLayerContext
      Returns:
      The ILcdFilter.
    • checkInitialized

      protected final void checkInitialized() throws IllegalStateException

      Utility method to check if this ALcyLspFormat is properly initialized, which is only the case after createAll() has been called.

      Throws:
      IllegalStateException - When not properly initialized.
    • toString

      public String toString()
      Overrides:
      toString in class Object