Class TLcyLspLayerTreeNodeFormatWrapper
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
- When any of the nodes in the model structure is an
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 anILcdLayerTreeNode
in that case. - The
canHandleModel(com.luciad.model.ILcdModel)
of the delegate format should accept theILcdModelTreeNode
instances. - It assumes a
TLcyLspSafeGuardFormatWrapper
will be applied around this format before plugging the format into the Lucy back-end.
- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionCreates a wrapper for the specifiedALcyLspFormat
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandleModel
(ILcdModel aModel) Returnstrue
if and only if the given model can be visualized by this format.Creates the layer factory for this format.createLayerNode
(ILcdModel aModel) Creates a newILcdLayerTreeNode
with modelaModel
.Creates theALcyWorkspaceObjectCodec
s that can encode the state of the layers created by the layer factory of this format.boolean
isLayerOfFormat
(ILspLayer aLayer) Returnstrue
if and only if the given layer is a layer of this format.boolean
isLayerTreeNodeOfFormat
(ILspLayer aLayer) Returnstrue
if and only if the given layer is anILcdLayerTreeNode
of the current data format.Methods inherited from class com.luciad.lucy.format.lightspeed.ALcyLspFormatWrapper
createAll, createBalloonContentProviders, createFormatBarFactory, createLayerCustomizerPanelFactories, createLayerCustomizerPanelWorkspaceCodecs, createLayerMeasureProviderFactory, createLayerSelectionTransferHandlers, createLayerStyleCodecFileTypeDescriptors, createLayerStyleCodecs, createLayerStyleProviders, getFormat, getLongPrefix, getLucyEnv, getShortPrefix
Methods inherited from class com.luciad.lucy.format.lightspeed.ALcyLspFormat
checkInitialized, createLayerContextOfFormatFilter, getBalloonContentProviders, getFormatBarFactory, getLayerCustomizerPanelFactories, getLayerCustomizerPanelWorkspaceCodecs, getLayerFactory, getLayerMeasureProviderFactory, getLayerSelectionTransferHandlers, getLayerStyleCodecFileTypeDescriptors, getLayerStyleCodecs, getLayerStyleProviders, getLayerWorkspaceCodecs, toString
-
Constructor Details
-
TLcyLspLayerTreeNodeFormatWrapper
Creates a wrapper for the specifiedALcyLspFormat
. Layer tree nodes will be created for allILcdModelTreeNode
instances that belong toaFormat
(seeALcyLspFormat.canHandleModel(com.luciad.model.ILcdModel)
).- Parameters:
aFormat
- TheALcyLspFormat
to decorate. Must not benull
.
-
-
Method Details
-
isLayerOfFormat
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 whetheraLayer
is a layer of this format.Returns
true
whenaLayer
is a node of this format (as determined by theisLayerTreeNodeOfFormat
method), or when the delegate format accepts the layer.- Overrides:
isLayerOfFormat
in classALcyLspFormatWrapper
- Parameters:
aLayer
- The layer to check- Returns:
true
if and only if the given layer is a layer of this format
-
isLayerTreeNodeOfFormat
Returns
true
if and only if the given layer is anILcdLayerTreeNode
of the current data format.- Parameters:
aLayer
- the layer to check- Returns:
true
if and only if the given layer is anILcdLayerTreeNode
of the current data format.- See Also:
-
canHandleModel
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.- Overrides:
canHandleModel
in classALcyLspFormatWrapper
- Parameters:
aModel
- The model to check- Returns:
true
if and only if the given model can be visualized by this format.
-
createLayerNode
Creates a new
ILcdLayerTreeNode
with modelaModel
.If you overwrite this method, make sure the created nodes still pass the
isLayerTreeNodeOfFormat(com.luciad.view.lightspeed.layer.ILspLayer)
check.- Parameters:
aModel
- The model for the layer node- Returns:
- a new
ILcdLayerTreeNode
which passes theisLayerTreeNodeOfFormat(com.luciad.view.lightspeed.layer.ILspLayer)
check
-
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 anILcdModelTreeNode
, 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.- Overrides:
createLayerFactory
in classALcyLspFormatWrapper
- Returns:
- The
ILspLayerFactory
for this format. May benull
- 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.
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.- Overrides:
createLayerWorkspaceCodecs
in classALcyLspFormatWrapper
- Returns:
- The array of
ALcyWorkspaceObjectCodec
s to encode the state of the layers. May be empty but notnull
. Must not containnull
- See Also:
-