Class TLcyLspLayerTreeNodeFormatWrapper
This ALcyLspFormatWrapper adds support for working with
ILcdLayerTreeNodes. 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 ILcdLayerTreeNodes 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
ILcdModelTreeNodeand 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 anILcdLayerTreeNodein that case. - The
canHandleModel(com.luciad.model.ILcdModel)of the delegate format should accept theILcdModelTreeNodeinstances. - It assumes a
TLcyLspSafeGuardFormatWrapperwill be applied around this format before plugging the format into the Lucy back-end.
- Since:
- 2012.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a wrapper for the specifiedALcyLspFormat. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandleModel(ILcdModel aModel) Returnstrueif and only if the given model can be visualized by this format.Creates the layer factory for this format.createLayerNode(ILcdModel aModel) Creates a newILcdLayerTreeNodewith modelaModel.Creates theALcyWorkspaceObjectCodecs that can encode the state of the layers created by the layer factory of this format.booleanisLayerOfFormat(ILspLayer aLayer) Returnstrueif and only if the given layer is a layer of this format.booleanisLayerTreeNodeOfFormat(ILspLayer aLayer) Returnstrueif and only if the given layer is anILcdLayerTreeNodeof 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, getShortPrefixMethods 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 allILcdModelTreeNodeinstances that belong toaFormat(seeALcyLspFormat.canHandleModel(com.luciad.model.ILcdModel)).- Parameters:
aFormat- TheALcyLspFormatto decorate. Must not benull.
-
-
Method Details
-
isLayerOfFormat
Returns
trueif 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 whetheraLayeris a layer of this format.Returns
truewhenaLayeris a node of this format (as determined by theisLayerTreeNodeOfFormatmethod), or when the delegate format accepts the layer.- Overrides:
isLayerOfFormatin classALcyLspFormatWrapper- Parameters:
aLayer- The layer to check- Returns:
trueif and only if the given layer is a layer of this format
-
isLayerTreeNodeOfFormat
Returns
trueif and only if the given layer is anILcdLayerTreeNodeof the current data format.- Parameters:
aLayer- the layer to check- Returns:
trueif and only if the given layer is anILcdLayerTreeNodeof the current data format.- See Also:
-
canHandleModel
Returns
trueif and only if the given model can be visualized by this format.Warning: the decorated format should accept the
ILcdModelTreeNodeinstances which are passed to this format, or this format will not accept them.- Overrides:
canHandleModelin classALcyLspFormatWrapper- Parameters:
aModel- The model to check- Returns:
trueif and only if the given model can be visualized by this format.
-
createLayerNode
Creates a new
ILcdLayerTreeNodewith 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
ILcdLayerTreeNodewhich 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
ILcdLayerTreeNodeinstances 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:
createLayerFactoryin classALcyLspFormatWrapper- Returns:
- The
ILspLayerFactoryfor this format. May benull - 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.
This implementations returns the instance created by the decorated format.
This format adds layer codecs for the
ILcdLayerTreeNodeinstances it creates. The workspace support for the child layers is left to the delegate format, which has also created these layers.- Overrides:
createLayerWorkspaceCodecsin classALcyLspFormatWrapper- Returns:
- The array of
ALcyWorkspaceObjectCodecs to encode the state of the layers. May be empty but notnull. Must not containnull - See Also:
-