Class ALcyLspFormat
- Direct Known Subclasses:
ALcyLspFormatWrapper,ALcyLspGeneralFormat
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanHandleModel(ILcdModel aModel) Returnstrueif and only if the given model can be visualized by this format.protected final voidUtility method to check if thisALcyLspFormatis properly initialized, which is only the case aftercreateAll()has been called.voidCreates all the instances of the concepts of this class by calling all the abstractcreate<Concept>methods, and performs some validity checks on the created values.protected ILcdBalloonContentProvider[]Creates theILcdBalloonContentProviders for this format.protected ALcyFormatBarFactoryCreates theALcyFormatBarFactorythat can create a bar to manipulate layers of this format.final ILcdFiltercreateLayerContextOfFormatFilter(boolean aAcceptArrays) Utility method to create aILcdFilterthat only acceptsTLcyLayerContexts whose layers are accepted byisLayerOfFormat(com.luciad.view.lightspeed.layer.ILspLayer).protected ILcyCustomizerPanelFactory[]Creates theILcyCustomizerPanelFactoryfactories that can createILcyCustomizerPanelinstances for the layers created by the layer factories of this format.protected ALcyWorkspaceObjectCodec[]Creates theALcyWorkspaceObjectCodeccodecs for theILcyCustomizerPanelinstances for the layers created by the layer factories of this format.protected abstract ILspLayerFactoryCreates the layer factory for this format.protected ILcdLayerMeasureProviderFactoryCreates aILcdLayerMeasureProviderFactorythat can create measure providers for a layer created by the layer factories of this format.protected ALcyLayerSelectionTransferHandler[]Creates theALcyLayerSelectionTransferHandlertransfer handlers that can transfer the selection of the layers created by the layer factories of this format.protected ALcyFileTypeDescriptor[]CreatesALcyFileTypeDescriptors for theILcyLayerStyleCodecs.protected ILcyLayerStyleCodec[]Creates theILcyLayerStyleCodecinstances which can encode/decode the style of the layers created by the layer factory of this format.protected ILcyLayerStyleProvider[]Creates the style provider instances that can retrieve and encode the style of the layers created by the layer factory of this format.protected ALcyWorkspaceObjectCodec[]Creates theALcyWorkspaceObjectCodecs that can encode the state of the layers created by the layer factory of this format.final ILcdBalloonContentProvider[]Returns theILcdBalloonContentProviders created by this format.final ALcyFormatBarFactoryReturns theALcyFormatBarFactorythat can create a bar to manipulate layers of this format.final ILcyCustomizerPanelFactory[]Returns theILcyCustomizerPanelFactorys that can createILcyCustomizerPanelinstances for the layers created by the layer factories of this format.final ALcyWorkspaceObjectCodec[]Returns theALcyWorkspaceObjectCodecs for theILcyCustomizerPanelinstances for the layers created by the layer factories of this format.final ILspLayerFactoryReturns theILspLayerFactorycreated by this format.Returns theILcdLayerMeasureProviderFactorythat can create measure providers for a layer created by the layer factories of this format.Returns theALcyLayerSelectionTransferHandlertransfer handlers that can transfer the selection of the layers created by the layer factories of this format.final ALcyFileTypeDescriptor[]Returns theALcyFileTypeDescriptordescriptors describing the files for theILcyLayerStyleCodeccodecs created by this format.final ILcyLayerStyleCodec[]Returns the array ofILcyLayerStyleCodecs created by this format.final ILcyLayerStyleProvider[]Returns the array ofILcyLayerStyleProviders created by this format.final ALcyWorkspaceObjectCodec[]Returns theALcyWorkspaceObjectCodecs that can encode the state of the layers created by the layer factory of this format.abstract StringReturns the long prefix of this format that can be used, for instance, to derive UID's.abstract ILcyLucyEnvReturns theILcyLucyEnvbackend with which thisALcyLspFormatis associated.abstract StringReturns the short prefix of this format that can be used, for instance, to derive keys for aALcyPropertiesinstance.booleanisLayerOfFormat(ILspLayer aLayer) Returnstrueif and only if the given layer is a layer of this format.toString()
-
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 appropriateget<Concept>methods. -
createLayerFactory
Creates the layer factory for this format. The default implementation returns
null.- Returns:
- The
ILspLayerFactoryfor this format. May benull - See Also:
-
getLayerFactory
Returns the
ILspLayerFactorycreated by this format.One must have called
createAllbefore calling this method.- Returns:
- The
ILspLayerFactorycreated by this format. Can benull - See Also:
-
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 containnull. - See Also:
-
getLayerStyleProviders
Returns the array of
ILcyLayerStyleProviders created by this format.One must have called
createAllbefore calling this method.- Returns:
- The
ILcyLayerStyleProviderarray created by this format. Can be empty but will not benull. The array will not contain anynullvalues. - See Also:
-
createLayerStyleCodecs
Creates the
ILcyLayerStyleCodecinstances 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
ILcyLayerStyleCodecinstances. Must not benull. The array may be empty, but must not containnull. - See Also:
-
getLayerStyleCodecs
Returns the array of
ILcyLayerStyleCodecs created by this format.One must have called
createAllbefore calling this method.- Returns:
- The
ILcyLayerStyleCodecarray created by this format. Can be empty but will not benull. The array will not contain anynullvalues. - See Also:
-
createLayerStyleCodecFileTypeDescriptors
Creates
ALcyFileTypeDescriptors for theILcyLayerStyleCodecs. The length of the returned array must be equal to that ofcreateLayerStyleCodecs().The default implementation returns a zero-length array.
- Returns:
- An array of
ALcyFileTypeDescriptorinstances. Must not benulland its length must be equal to the length of the array of layer style encoders created by this format. May containnull. - See Also:
-
getLayerStyleCodecFileTypeDescriptors
Returns the
ALcyFileTypeDescriptordescriptors describing the files for theILcyLayerStyleCodeccodecs created by this format. Should only be called aftercreateAll()has been called.- Returns:
- The array of
ALcyFileTypeDescriptordescriptors. - See Also:
-
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 notnull. Must not containnull - See Also:
-
getLayerWorkspaceCodecs
Returns the
ALcyWorkspaceObjectCodecs that can encode the state of the layers created by the layer factory of this format.One must have called
createAllbefore calling this method.- Returns:
- The
ALcyWorkspaceObjectCodecs that can encode the state of the layers. Can be empty but will not benull. Will not containnull. - See Also:
-
createLayerCustomizerPanelFactories
Creates the
ILcyCustomizerPanelFactoryfactories that can createILcyCustomizerPanelinstances 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, seeTLcyLspStyledLayerCustomizerPanelFactory.- Returns:
- An array of
ILcyCustomizerPanelFactoryinstances. Must not benull. The array may be empty, but must not containnull. - See Also:
-
getLayerCustomizerPanelFactories
Returns the
ILcyCustomizerPanelFactorys that can createILcyCustomizerPanelinstances for the layers created by the layer factories of this format. Should only be called aftercreateAll()has been called.The created
ILcyCustomizerPanels should work with instances ofTLcyLayerContextin theirsetObjectmethod.- Returns:
- The array of
ILcyCustomizerPanelFactorys. - See Also:
-
createLayerCustomizerPanelWorkspaceCodecs
Creates the
ALcyWorkspaceObjectCodeccodecs for theILcyCustomizerPanelinstances for the layers created by the layer factories of this format.- Returns:
- An array containing the
ALcyWorkspaceObjectCodecinstances. Must not benull, but may have length0. Must not containnull. - See Also:
-
getLayerCustomizerPanelWorkspaceCodecs
Returns the
ALcyWorkspaceObjectCodecs for theILcyCustomizerPanelinstances for the layers created by the layer factories of this format.- Returns:
- The array of
ALcyWorkspaceObjectCodecs - See Also:
-
createLayerSelectionTransferHandlers
Creates the
ALcyLayerSelectionTransferHandlertransfer 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
ALcyLayerSelectionTransferHandlerinstances. Must not benullbut may have length0. Must not containnull. - See Also:
-
getLayerSelectionTransferHandlers
Returns the
ALcyLayerSelectionTransferHandlertransfer handlers that can transfer the selection of the layers created by the layer factories of this format. Should only be called aftercreateAll()has been called.- Returns:
- The array of
ALcyLayerSelectionTransferHandlertransfer handlers. - See Also:
-
createLayerMeasureProviderFactory
Creates a
ILcdLayerMeasureProviderFactorythat can create measure providers for a layer created by the layer factories of this format.The default implementation returns
null.- Returns:
- an
ILcdLayerMeasureProviderFactoryinstance. Can benull. - See Also:
-
getLayerMeasureProviderFactory
Returns the
ILcdLayerMeasureProviderFactorythat can create measure providers for a layer created by the layer factories of this format. Should only be called aftercreateAll()has been called.- Returns:
- an
ILcdLayerMeasureProviderFactoryinstance. Can benull. - See Also:
-
createFormatBarFactory
Creates the
ALcyFormatBarFactorythat can create a bar to manipulate layers of this format.The default implementation returns
null.- Returns:
- An
ALcyFormatBarFactory. May benull.
-
getFormatBarFactory
Returns the
ALcyFormatBarFactorythat can create a bar to manipulate layers of this format. Should only be called aftercreateAll()has been called.- Returns:
- The
ALcyFormatBarFactory. - See Also:
-
createBalloonContentProviders
Creates the
ILcdBalloonContentProviders for this format.The default implementation returns an empty array.
- Returns:
- the
ILcdBalloonContentProviders for this format. Must not benull. The array may be empty but must not containnull. - See Also:
-
getBalloonContentProviders
Returns the
ILcdBalloonContentProviders created by this format. Should only be called aftercreateAll()has been called.- Returns:
- The
ILcdBalloonContentProviders created by this format - See Also:
-
getLucyEnv
Returns the
ILcyLucyEnvbackend with which thisALcyLspFormatis associated.- Returns:
- The
ILcyLucyEnvbackend. Must not benull.
-
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
Returns the short prefix of this format that can be used, for instance, to derive keys for a
ALcyPropertiesinstance. 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
Returns
trueif and only if the given model can be visualized by this format.- Parameters:
aModel- The model to check- Returns:
trueif and only if the given model can be visualized by this format.
-
isLayerOfFormat
Returns
trueif and only if the given layer is a layer of this format.The default implementation uses the
canHandleModel(com.luciad.model.ILcdModel)to determine whetheraLayeris a layer of this format.- Parameters:
aLayer- The layer to check- Returns:
trueif and only if the given layer is a layer of this format
-
createLayerContextOfFormatFilter
Utility method to create a
ILcdFilterthat only acceptsTLcyLayerContexts whose layers are accepted byisLayerOfFormat(com.luciad.view.lightspeed.layer.ILspLayer).- Parameters:
aAcceptArrays- iftrue, the filter will also accept arrays ofTLcyLayerContext- Returns:
- The
ILcdFilter.
-
checkInitialized
Utility method to check if this
ALcyLspFormatis properly initialized, which is only the case aftercreateAll()has been called.- Throws:
IllegalStateException- When not properly initialized.
-
toString
-