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
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
canHandleModel
(ILcdModel aModel) Returnstrue
if and only if the given model can be visualized by this format.protected final void
Utility method to check if thisALcyLspFormat
is properly initialized, which is only the case aftercreateAll()
has been called.void
Creates 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 theILcdBalloonContentProvider
s for this format.protected ALcyFormatBarFactory
Creates theALcyFormatBarFactory
that can create a bar to manipulate layers of this format.final ILcdFilter
createLayerContextOfFormatFilter
(boolean aAcceptArrays) Utility method to create aILcdFilter
that only acceptsTLcyLayerContext
s whose layers are accepted byisLayerOfFormat(com.luciad.view.lightspeed.layer.ILspLayer)
.protected ILcyCustomizerPanelFactory[]
Creates theILcyCustomizerPanelFactory
factories that can createILcyCustomizerPanel
instances for the layers created by the layer factories of this format.protected ALcyWorkspaceObjectCodec[]
Creates theALcyWorkspaceObjectCodec
codecs for theILcyCustomizerPanel
instances for the layers created by the layer factories of this format.protected abstract ILspLayerFactory
Creates the layer factory for this format.protected ILcdLayerMeasureProviderFactory
Creates aILcdLayerMeasureProviderFactory
that can create measure providers for a layer created by the layer factories of this format.protected ALcyLayerSelectionTransferHandler[]
Creates theALcyLayerSelectionTransferHandler
transfer handlers that can transfer the selection of the layers created by the layer factories of this format.protected ALcyFileTypeDescriptor[]
CreatesALcyFileTypeDescriptor
s for theILcyLayerStyleCodec
s.protected ILcyLayerStyleCodec[]
Creates theILcyLayerStyleCodec
instances 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 theALcyWorkspaceObjectCodec
s that can encode the state of the layers created by the layer factory of this format.final ILcdBalloonContentProvider[]
Returns theILcdBalloonContentProvider
s created by this format.final ALcyFormatBarFactory
Returns theALcyFormatBarFactory
that can create a bar to manipulate layers of this format.final ILcyCustomizerPanelFactory[]
Returns theILcyCustomizerPanelFactory
s that can createILcyCustomizerPanel
instances for the layers created by the layer factories of this format.final ALcyWorkspaceObjectCodec[]
Returns theALcyWorkspaceObjectCodec
s for theILcyCustomizerPanel
instances for the layers created by the layer factories of this format.final ILspLayerFactory
Returns theILspLayerFactory
created by this format.Returns theILcdLayerMeasureProviderFactory
that can create measure providers for a layer created by the layer factories of this format.Returns theALcyLayerSelectionTransferHandler
transfer handlers that can transfer the selection of the layers created by the layer factories of this format.final ALcyFileTypeDescriptor[]
Returns theALcyFileTypeDescriptor
descriptors describing the files for theILcyLayerStyleCodec
codecs created by this format.final ILcyLayerStyleCodec[]
Returns the array ofILcyLayerStyleCodec
s created by this format.final ILcyLayerStyleProvider[]
Returns the array ofILcyLayerStyleProvider
s created by this format.final ALcyWorkspaceObjectCodec[]
Returns theALcyWorkspaceObjectCodec
s that can encode the state of the layers created by the layer factory of this format.abstract String
Returns the long prefix of this format that can be used, for instance, to derive UID's.abstract ILcyLucyEnv
Returns theILcyLucyEnv
backend with which thisALcyLspFormat
is associated.abstract String
Returns the short prefix of this format that can be used, for instance, to derive keys for aALcyProperties
instance.boolean
isLayerOfFormat
(ILspLayer aLayer) Returnstrue
if 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
ILspLayerFactory
for this format. May benull
- See Also:
-
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 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
ILcyLayerStyleProvider
s 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 benull
. The array will not contain anynull
values. - See Also:
-
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 benull
. The array may be empty, but must not containnull
. - See Also:
-
getLayerStyleCodecs
Returns the array of
ILcyLayerStyleCodec
s 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 benull
. The array will not contain anynull
values. - See Also:
-
createLayerStyleCodecFileTypeDescriptors
Creates
ALcyFileTypeDescriptor
s for theILcyLayerStyleCodec
s. The length of the returned array must be equal to that ofcreateLayerStyleCodecs()
.The default implementation returns a zero-length array.
- Returns:
- An array of
ALcyFileTypeDescriptor
instances. Must not benull
and 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
ALcyFileTypeDescriptor
descriptors describing the files for theILcyLayerStyleCodec
codecs created by this format. Should only be called aftercreateAll()
has been called.- Returns:
- The array of
ALcyFileTypeDescriptor
descriptors. - See Also:
-
createLayerWorkspaceCodecs
Creates the
ALcyWorkspaceObjectCodec
s 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
ALcyWorkspaceObjectCodec
s to encode the state of the layers. May be empty but notnull
. Must not containnull
- See Also:
-
getLayerWorkspaceCodecs
Returns the
ALcyWorkspaceObjectCodec
s 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
ALcyWorkspaceObjectCodec
s that can encode the state of the layers. Can be empty but will not benull
. Will not containnull
. - See Also:
-
createLayerCustomizerPanelFactories
Creates the
ILcyCustomizerPanelFactory
factories that can createILcyCustomizerPanel
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, seeTLcyLspStyledLayerCustomizerPanelFactory
.- Returns:
- An array of
ILcyCustomizerPanelFactory
instances. Must not benull
. The array may be empty, but must not containnull
. - See Also:
-
getLayerCustomizerPanelFactories
Returns the
ILcyCustomizerPanelFactory
s that can createILcyCustomizerPanel
instances for the layers created by the layer factories of this format. Should only be called aftercreateAll()
has been called.The created
ILcyCustomizerPanel
s should work with instances ofTLcyLayerContext
in theirsetObject
method.- Returns:
- The array of
ILcyCustomizerPanelFactory
s. - See Also:
-
createLayerCustomizerPanelWorkspaceCodecs
Creates the
ALcyWorkspaceObjectCodec
codecs for theILcyCustomizerPanel
instances for the layers created by the layer factories of this format.- Returns:
- An array containing the
ALcyWorkspaceObjectCodec
instances. Must not benull
, but may have length0
. Must not containnull
. - See Also:
-
getLayerCustomizerPanelWorkspaceCodecs
Returns the
ALcyWorkspaceObjectCodec
s for theILcyCustomizerPanel
instances for the layers created by the layer factories of this format.- Returns:
- The array of
ALcyWorkspaceObjectCodec
s - See Also:
-
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 benull
but may have length0
. Must not containnull
. - See Also:
-
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 aftercreateAll()
has been called.- Returns:
- The array of
ALcyLayerSelectionTransferHandler
transfer handlers. - See Also:
-
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 benull
. - See Also:
-
getLayerMeasureProviderFactory
Returns the
ILcdLayerMeasureProviderFactory
that 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
ILcdLayerMeasureProviderFactory
instance. Can benull
. - See Also:
-
createFormatBarFactory
Creates the
ALcyFormatBarFactory
that can create a bar to manipulate layers of this format.The default implementation returns
null
.- Returns:
- An
ALcyFormatBarFactory
. May benull
.
-
getFormatBarFactory
Returns the
ALcyFormatBarFactory
that 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
ILcdBalloonContentProvider
s for this format.The default implementation returns an empty array.
- Returns:
- the
ILcdBalloonContentProvider
s for this format. Must not benull
. The array may be empty but must not containnull
. - See Also:
-
getBalloonContentProviders
Returns the
ILcdBalloonContentProvider
s created by this format. Should only be called aftercreateAll()
has been called.- Returns:
- The
ILcdBalloonContentProvider
s created by this format - See Also:
-
getLucyEnv
Returns the
ILcyLucyEnv
backend with which thisALcyLspFormat
is associated.- Returns:
- The
ILcyLucyEnv
backend. 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
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
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
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 whetheraLayer
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
Utility method to create a
ILcdFilter
that only acceptsTLcyLayerContext
s 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
ALcyLspFormat
is properly initialized, which is only the case aftercreateAll()
has been called.- Throws:
IllegalStateException
- When not properly initialized.
-
toString
-