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
.
ALcyLspFormatWrapper
,
TLcyLspFormatTool
Modifier | Constructor and Description |
---|---|
protected |
ALcyLspFormat()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canHandleModel(ILcdModel aModel)
Returns
true if and only if the given model can be visualized by this format. |
protected void |
checkInitialized()
Utility method to check if this
ALcyLspFormat is properly initialized, which is only the
case after createAll() has been called. |
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. |
protected ILcdBalloonContentProvider[] |
createBalloonContentProviders()
Creates the
ILcdBalloonContentProvider s for this format. |
protected ALcyFormatBarFactory |
createFormatBarFactory()
Creates the
ALcyFormatBarFactory that can create a bar to manipulate layers of
this format. |
ILcdFilter |
createLayerContextOfFormatFilter(boolean aAcceptArrays)
Utility method to create a
ILcdFilter that only accepts
TLcyLayerContext s whose layers are accepted by isLayerOfFormat(com.luciad.view.lightspeed.layer.ILspLayer) . |
protected ILcyCustomizerPanelFactory[] |
createLayerCustomizerPanelFactories()
Creates the
ILcyCustomizerPanelFactory factories that can create
ILcyCustomizerPanel instances for the layers created by the layer factories of
this format. |
protected ALcyWorkspaceObjectCodec[] |
createLayerCustomizerPanelWorkspaceCodecs()
Creates the
ALcyWorkspaceObjectCodec codecs for the
ILcyCustomizerPanel instances for the layers created by the layer factories of
this format. |
protected abstract ILspLayerFactory |
createLayerFactory()
Creates the layer factory for this format.
|
protected ILcdLayerMeasureProviderFactory |
createLayerMeasureProviderFactory()
Creates a
ILcdLayerMeasureProviderFactory that can create measure providers for
a layer created by the layer factories of this format. |
protected ALcyLayerSelectionTransferHandler[] |
createLayerSelectionTransferHandlers()
Creates the
ALcyLayerSelectionTransferHandler transfer handlers that can
transfer the selection of the layers created by the layer factories of this format. |
protected ALcyFileTypeDescriptor[] |
createLayerStyleCodecFileTypeDescriptors()
Creates
ALcyFileTypeDescriptor s for the ILcyLayerStyleCodec s. |
protected ILcyLayerStyleCodec[] |
createLayerStyleCodecs()
Creates the
ILcyLayerStyleCodec instances which can encode/decode the style of
the layers created by the layer factory of this format. |
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.
|
protected ALcyWorkspaceObjectCodec[] |
createLayerWorkspaceCodecs()
Creates the
ALcyWorkspaceObjectCodec s that can encode the state of the layers
created by the layer factory of this format. |
ILcdBalloonContentProvider[] |
getBalloonContentProviders()
Returns the
ILcdBalloonContentProvider s created by this format. |
ALcyFormatBarFactory |
getFormatBarFactory()
Returns the
ALcyFormatBarFactory that can create a bar to manipulate layers of
this format. |
ILcyCustomizerPanelFactory[] |
getLayerCustomizerPanelFactories()
Returns the
ILcyCustomizerPanelFactory s that can create
ILcyCustomizerPanel instances for the layers created by the layer factories of
this format. |
ALcyWorkspaceObjectCodec[] |
getLayerCustomizerPanelWorkspaceCodecs()
Returns the
ALcyWorkspaceObjectCodec s for the ILcyCustomizerPanel
instances for the layers created by the layer factories of this format. |
ILspLayerFactory |
getLayerFactory()
Returns the
ILspLayerFactory created by this format. |
ILcdLayerMeasureProviderFactory |
getLayerMeasureProviderFactory()
Returns the
ILcdLayerMeasureProviderFactory that can create measure providers for
a layer created by the layer factories of this format. |
ALcyLayerSelectionTransferHandler[] |
getLayerSelectionTransferHandlers()
Returns the
ALcyLayerSelectionTransferHandler transfer handlers that can
transfer the selection of the layers created by the layer factories of this format. |
ALcyFileTypeDescriptor[] |
getLayerStyleCodecFileTypeDescriptors()
Returns the
ALcyFileTypeDescriptor descriptors describing the files for the
ILcyLayerStyleCodec codecs created by this format. |
ILcyLayerStyleCodec[] |
getLayerStyleCodecs()
Returns the array of
ILcyLayerStyleCodec s created by this format. |
ILcyLayerStyleProvider[] |
getLayerStyleProviders()
Returns the array of
ILcyLayerStyleProvider s created by this format. |
ALcyWorkspaceObjectCodec[] |
getLayerWorkspaceCodecs()
Returns the
ALcyWorkspaceObjectCodec s that can encode the state of the layers
created by the layer factory of this format. |
abstract String |
getLongPrefix()
Returns the long prefix of this format that can be used, for instance, to derive UID's.
|
abstract ILcyLucyEnv |
getLucyEnv()
Returns the
ILcyLucyEnv backend with which this ALcyLspFormat is
associated. |
abstract String |
getShortPrefix()
Returns the short prefix of this format that can be used, for instance, to derive keys for a
ALcyProperties instance. |
boolean |
isLayerOfFormat(ILspLayer aLayer)
Returns
true if and only if the given layer is a layer of this format. |
String |
toString() |
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.
protected abstract ILspLayerFactory createLayerFactory()
Creates the layer factory for this format. The default implementation returns null
.
ILspLayerFactory
for this format. May be null
getLayerFactory()
public final ILspLayerFactory getLayerFactory()
Returns the ILspLayerFactory
created by this format.
One must have called createAll
before calling this method.
ILspLayerFactory
created by this format. Can be null
createLayerFactory()
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.
null
. The array may be empty, but must not contain null
.getLayerStyleProviders()
public final ILcyLayerStyleProvider[] getLayerStyleProviders()
Returns the array of ILcyLayerStyleProvider
s created by this format.
One must have called createAll
before calling this method.
ILcyLayerStyleProvider
array created by this format. Can be empty but
will not be null
. The array will not contain any null
values.createLayerStyleProviders()
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.
ILcyLayerStyleCodec
instances. Must not be null
.
The array may be empty, but must not contain null
.getLayerStyleCodecs()
,
createLayerStyleCodecFileTypeDescriptors()
public final ILcyLayerStyleCodec[] getLayerStyleCodecs()
Returns the array of ILcyLayerStyleCodec
s created by this format.
One must have called createAll
before calling this method.
ILcyLayerStyleCodec
array created by this format. Can be empty but
will not be null
. The array will not contain any null
values.createLayerStyleCodecs()
protected ALcyFileTypeDescriptor[] createLayerStyleCodecFileTypeDescriptors()
Creates ALcyFileTypeDescriptor
s for the ILcyLayerStyleCodec
s. The
length of the returned array must be equal to that of createLayerStyleCodecs()
.
The default implementation returns a zero-length array.
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
.createLayerStyleCodecs()
,
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.
ALcyFileTypeDescriptor
descriptors.createLayerStyleCodecFileTypeDescriptors()
protected ALcyWorkspaceObjectCodec[] 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.
ALcyWorkspaceObjectCodec
s to encode the state of the layers.
May be empty but not null
. Must not contain null
getLayerWorkspaceCodecs()
public final ALcyWorkspaceObjectCodec[] 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.
ALcyWorkspaceObjectCodec
s that can encode the state of the layers. Can
be empty but will not be null
. Will not contain null
.createLayerWorkspaceCodecs()
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
.
ILcyCustomizerPanelFactory
instances. Must not be
null
. The array may be empty, but must not contain null
.getLayerCustomizerPanelFactories()
public final ILcyCustomizerPanelFactory[] getLayerCustomizerPanelFactories()
Returns the ILcyCustomizerPanelFactory
s 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 ILcyCustomizerPanel
s should work with instances of TLcyLayerContext
in their setObject
method.
ILcyCustomizerPanelFactory
s.createLayerCustomizerPanelFactories()
protected ALcyWorkspaceObjectCodec[] createLayerCustomizerPanelWorkspaceCodecs()
Creates the ALcyWorkspaceObjectCodec
codecs for the
ILcyCustomizerPanel
instances for the layers created by the layer factories of
this format.
ALcyWorkspaceObjectCodec
instances. Must not be
null
, but may have length 0
. Must not contain
null
.getLayerCustomizerPanelWorkspaceCodecs()
public final ALcyWorkspaceObjectCodec[] getLayerCustomizerPanelWorkspaceCodecs()
Returns the ALcyWorkspaceObjectCodec
s for the ILcyCustomizerPanel
instances for the layers created by the layer factories of this format.
ALcyWorkspaceObjectCodec
screateLayerCustomizerPanelWorkspaceCodecs()
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.
ALcyLayerSelectionTransferHandler
instances. Must not be
null
but may have length 0
. Must not contain
null
.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.
ALcyLayerSelectionTransferHandler
transfer handlers.createLayerSelectionTransferHandlers()
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
.
ILcdLayerMeasureProviderFactory
instance. Can be null
.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.
ILcdLayerMeasureProviderFactory
instance. Can be null
.createLayerMeasureProviderFactory()
protected ALcyFormatBarFactory createFormatBarFactory()
Creates the ALcyFormatBarFactory
that can create a bar to manipulate layers of
this format.
The default implementation returns null
.
ALcyFormatBarFactory
. May be null
.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.
ALcyFormatBarFactory
.createFormatBarFactory()
protected ILcdBalloonContentProvider[] createBalloonContentProviders()
Creates the ILcdBalloonContentProvider
s for this format.
The default implementation returns an empty array.
ILcdBalloonContentProvider
s for this format. Must not be
null
. The array may be empty but must not contain null
.getBalloonContentProviders()
public final ILcdBalloonContentProvider[] getBalloonContentProviders()
Returns the ILcdBalloonContentProvider
s created by this format. Should only be
called after createAll()
has been called.
ILcdBalloonContentProvider
s created by this formatcreateBalloonContentProviders()
public abstract ILcyLucyEnv getLucyEnv()
Returns the ILcyLucyEnv
backend with which this ALcyLspFormat
is
associated.
ILcyLucyEnv
backend. Must not be null
.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.
null
.ALcyTool.getLongPrefix(Class)
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.
null
.ALcyTool.getShortPrefix(Class)
public abstract boolean canHandleModel(ILcdModel aModel)
Returns true
if and only if the given model can be visualized by this format.
aModel
- The model to checktrue
if and only if the given model can be visualized by this format.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.
aLayer
- The layer to checktrue
if and only if the given layer is a layer of this formatpublic final ILcdFilter createLayerContextOfFormatFilter(boolean aAcceptArrays)
Utility method to create a ILcdFilter
that only accepts
TLcyLayerContext
s whose layers are accepted by isLayerOfFormat(com.luciad.view.lightspeed.layer.ILspLayer)
.
aAcceptArrays
- if true
, the filter will also accept arrays of TLcyLayerContext
ILcdFilter
.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.
IllegalStateException
- When not properly initialized.