public class TLcyLspLayerTreeNodeFormatWrapper extends ALcyLspFormatWrapper
This ALcyLspFormatWrapper
adds support for working with
ILcdLayerTreeNode
s. When an ILcdModelTreeNode
is given to its
ILspLayerFactory
it automatically creates a matching layer tree node structure. The
creation of the layers for the sub-models is left to the delegate ALcyFormat
.
Consider this model structure:
ILcdModelTreeNode-A
| |
ILcdModelTreeNode-B ILcdModel-E
| |
ILcdModel-C ILcdModel-D
A matching structure of ILcdLayerTreeNode
s is created. The layer nodes for A and
B are created by this wrapper, the creation of the (regular) layers for the models C, D and E are
left to the wrapped format.
It also adds workspace support for the layer nodes it creates.
Limitations
ILcdModelTreeNode
and when
this tree node contains data, the creation of the layer is left to the delegate format. This class
assumes that the delegate format creates an ILcdLayerTreeNode
in that case.canHandleModel(com.luciad.model.ILcdModel)
of the delegate format should accept the
ILcdModelTreeNode
instances.TLcyLspSafeGuardFormatWrapper
will be applied around this format before
plugging the format into the
Lucy back-end.Constructor and Description |
---|
TLcyLspLayerTreeNodeFormatWrapper(ALcyLspFormat aFormat)
Creates a wrapper for the specified
ALcyLspFormat . |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandleModel(ILcdModel aModel)
Returns
true if and only if the given model can be visualized by this format. |
ILspLayerFactory |
createLayerFactory()
Creates the layer factory for this format.
|
ILcdLayerTreeNode |
createLayerNode(ILcdModel aModel)
Creates a new
ILcdLayerTreeNode with model aModel . |
ALcyWorkspaceObjectCodec[] |
createLayerWorkspaceCodecs()
Creates the
ALcyWorkspaceObjectCodec s that can encode the state of the layers
created by the layer factory of this format. |
boolean |
isLayerOfFormat(ILspLayer aLayer)
Returns
true if and only if the given layer is a layer of this format. |
boolean |
isLayerTreeNodeOfFormat(ILspLayer aLayer)
Returns
true if and only if the given layer is an
ILcdLayerTreeNode of the current data format. |
createAll, createBalloonContentProviders, createFormatBarFactory, createLayerCustomizerPanelFactories, createLayerCustomizerPanelWorkspaceCodecs, createLayerMeasureProviderFactory, createLayerSelectionTransferHandlers, createLayerStyleCodecFileTypeDescriptors, createLayerStyleCodecs, createLayerStyleProviders, getFormat, getLongPrefix, getLucyEnv, getShortPrefix
checkInitialized, createLayerContextOfFormatFilter, getBalloonContentProviders, getFormatBarFactory, getLayerCustomizerPanelFactories, getLayerCustomizerPanelWorkspaceCodecs, getLayerFactory, getLayerMeasureProviderFactory, getLayerSelectionTransferHandlers, getLayerStyleCodecFileTypeDescriptors, getLayerStyleCodecs, getLayerStyleProviders, getLayerWorkspaceCodecs, toString
public TLcyLspLayerTreeNodeFormatWrapper(ALcyLspFormat aFormat)
ALcyLspFormat
.
Layer tree nodes will be created for all ILcdModelTreeNode
instances that belong
to aFormat
(see ALcyLspFormat.canHandleModel(com.luciad.model.ILcdModel)
).aFormat
- The ALcyLspFormat
to decorate. Must not be null
.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 ALcyLspFormat.canHandleModel(com.luciad.model.ILcdModel)
to
determine whether aLayer
is a layer of this format.
Returns true
when aLayer
is a node of this format (as determined by
the isLayerTreeNodeOfFormat
method), or when the delegate format accepts the layer.
isLayerOfFormat
in class ALcyLspFormatWrapper
aLayer
- The layer to checktrue
if and only if the given layer is a layer of this formatpublic boolean isLayerTreeNodeOfFormat(ILspLayer aLayer)
Returns true
if and only if the given layer is an
ILcdLayerTreeNode
of the current data format.
aLayer
- the layer to checktrue
if and only if the given layer is an ILcdLayerTreeNode
of the current data format.createLayerNode(com.luciad.model.ILcdModel)
public boolean canHandleModel(ILcdModel aModel)
Returns true
if and only if the given model can be visualized by this format.
Warning: the decorated format should accept the ILcdModelTreeNode
instances which are passed to this format, or this format will not accept
them.
canHandleModel
in class ALcyLspFormatWrapper
aModel
- The model to checktrue
if and only if the given model can be visualized by this format.public ILcdLayerTreeNode createLayerNode(ILcdModel aModel)
Creates a new ILcdLayerTreeNode
with model aModel
.
If you overwrite this method, make sure the created nodes still pass the isLayerTreeNodeOfFormat(com.luciad.view.lightspeed.layer.ILspLayer)
check.
aModel
- The model for the layer nodeILcdLayerTreeNode
which passes the isLayerTreeNodeOfFormat(com.luciad.view.lightspeed.layer.ILspLayer)
checkpublic ILspLayerFactory createLayerFactory()
Creates the layer factory for this format. The default implementation returns null
.
This implementations returns the instance created by the decorated format.
Returns a layer factory which creates ILcdLayerTreeNode
instances for an
ILcdModelTreeNode
, and delegates the creation of the child layers to the layer
factory of the decorated format. This is explained in more detail in the class javadoc.
createLayerFactory
in class ALcyLspFormatWrapper
ILspLayerFactory
for this format. May be null
ALcyLspFormat.getLayerFactory()
public 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.
This implementations returns the instance created by the decorated format.
This format adds layer codecs for the ILcdLayerTreeNode
instances it creates. The
workspace support for the child layers is left to the delegate format, which has also created
these layers.
createLayerWorkspaceCodecs
in class ALcyLspFormatWrapper
ALcyWorkspaceObjectCodec
s to encode the state of the layers.
May be empty but not null
. Must not contain null
ALcyLspFormat.getLayerWorkspaceCodecs()