Class TLcyGXYLayerTreeNodeFormatWrapper2

java.lang.Object
com.luciad.lucy.format.ALcyFormat
com.luciad.lucy.format.ALcyFormatWrapper
com.luciad.lucy.format.TLcyGXYLayerTreeNodeFormatWrapper2

public class TLcyGXYLayerTreeNodeFormatWrapper2 extends ALcyFormatWrapper

This ALcyFormatWrapper adds support for working with ILcdLayerTreeNode's. When a ILcdModelTreeNode is given to its ILcdGXYLayerFactory 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
It assumes actual data is only present in the leafs of the model structure, not in the nodes itself.

Note: This implementation can not handle models that are an instance of TLcdModelList. To avoid problems, wrap a format that uses model lists in a TLcyModelListToTreeNodeFormatWrapper before wrapping it in this format wrapper.

Since:
2013.0
See Also:
  • Constructor Details

    • TLcyGXYLayerTreeNodeFormatWrapper2

      public TLcyGXYLayerTreeNodeFormatWrapper2(ALcyFormat aFormat)
      Creates a layer tree node wrapper for the specified ALcyFormat. Layer tree nodes will be created for all ILcdModelTreeNode and TLcdModelList instances that belong to aFormat (see ALcyFormat.isModelOfFormat(com.luciad.model.ILcdModel)).
      Parameters:
      aFormat - The ALcyFormat to decorate. Must not be null.
    • TLcyGXYLayerTreeNodeFormatWrapper2

      public TLcyGXYLayerTreeNodeFormatWrapper2(ALcyFormat aFormat, ILcdFilter<ILcdModelTreeNode> aModelTreeNodeFilter)
      Creates a layer tree node wrapper for the specified ALcyFormat, using the given model filter. Layer tree nodes will be created for all ILcdModelTreeNode instances that belong to aFormat (see ALcyFormat.isModelOfFormat(com.luciad.model.ILcdModel)) and pass the given filter.
      Parameters:
      aFormat - The ALcyFormat to decorate. Must not be null.
      aModelTreeNodeFilter - An ILcdFilter that decides for which ILcdModelTreeNode instances to create layer tree nodes.
  • Method Details

    • isGXYLayerTreeNodeOfFormat

      public boolean isGXYLayerTreeNodeOfFormat(ILcdGXYLayer aGXYLayer)

      Returns true if and only if the given layer is an ILcdLayerTreeNode of the current data format.

      Parameters:
      aGXYLayer - the layer to check
      Returns:
      true if and only if the given layer is an ILcdLayerTreeNode of the current data format.
    • createGXYLayerNode

      public ILcdLayerTreeNode createGXYLayerNode()

      Creates a new TLcdGXYLayerTreeNode.

      If you overwrite it, make sure you're still compatible with the codec

      Returns:
      a new empty TLcyGXYLayerTreeNode which can be encoded/decoded
    • createGXYLayerNode

      public ILcdLayerTreeNode createGXYLayerNode(ILcdModel aModel)

      Creates a new TLcdGXYLayerTreeNode with model aModel.

      If you overwrite it, make sure you're still compatible with the codec

      Parameters:
      aModel - the model for the layer node
      Returns:
      a new TLcyGXYLayerTreeNode with model aModel which can be encoded/decoded
    • isModelOfFormat

      public boolean isModelOfFormat(ILcdModel aModel)
      Description copied from class: ALcyFormat
      Returns true if and only if the given model is a model of the current data format.
      Overrides:
      isModelOfFormat in class ALcyFormatWrapper
      Parameters:
      aModel - The model to check.
      Returns:
      true if and only if the given model is a model of the current data format.