Class TLcyLspCompositeLayerFactory

java.lang.Object
com.luciad.lucy.util.TLcyGenericComposite<ILspLayerFactory>
com.luciad.lucy.map.lightspeed.TLcyLspCompositeLayerFactory
All Implemented Interfaces:
ILspLayerFactory, Iterable<ILspLayerFactory>

public class TLcyLspCompositeLayerFactory extends TLcyGenericComposite<ILspLayerFactory> implements ILspLayerFactory

Composite implementation (see composite design pattern) of ILspLayerFactory. It keeps a list of associated ILspLayerFactorys: one can add and remove other ILspLayerFactorys to this ILspLayerFactory. When it is asked to create a layer, it loops over its associated ILspLayerFactorys to find the first one that returns a valid layer (means canCreateLayers does return true). That layer will then be returned.

Since:
2012.0
  • Constructor Details

  • Method Details

    • canCreateLayers

      public boolean canCreateLayers(ILcdModel aModel)
      Description copied from interface: ILspLayerFactory
      Determines whether or not this layer factory is capable of creating layers for the given model. If this method returns false, the result of calling ILspLayerFactory.createLayers(com.luciad.model.ILcdModel) with the same parameters is undefined.
      Specified by:
      canCreateLayers in interface ILspLayerFactory
      Parameters:
      aModel - the model for which layers should be created
      Returns:
      true if this factory can create layers for aModel, or false otherwise
    • createLayers

      public Collection<ILspLayer> createLayers(ILcdModel aModel)
      Description copied from interface: ILspLayerFactory
      Creates one or more ILspLayer objects for the given model.

      Note that this method should not be called if ILspLayerFactory.canCreateLayers(com.luciad.model.ILcdModel) returns false; the results are undefined in this case.

      In most typical scenarios, this method will only create a single ILspLayer instances for a given model. In such cases, the ALspSingleLayerFactory provides a convenient abstract base class for layer factory implementations. An example of when it might be useful to return multiple layers is a model that describes objects moving along a certain trajectory. The layer factory might return one layer which represents the trajectories as polylines, and another which represents the current positions of the objects as point icons.

      Specified by:
      createLayers in interface ILspLayerFactory
      Parameters:
      aModel - the model for which layers should be created
      Returns:
      a collection of layers representing the given model