public class TLspCompositeLayerFactory extends Object implements ILspLayerFactory
ILspLayerFactory
. Any number of layer
factories can be added to this composite; the
createLayers(com.luciad.model.ILcdModel)
method will delegate to the
first factory in the list whose
ILspLayerFactory.canCreateLayers(com.luciad.model.ILcdModel)
returns
true for the given input model.
ILspLayerFactory
instances, you can use:
ILspLayerFactory layerFactory =
new TLspCompositeLayerFactory(TLcdServiceLoader.getInstance(ILspLayerFactory.class));
This will use all layer factories annotated with the @LcdService
annotation.Constructor and Description |
---|
TLspCompositeLayerFactory()
Creates a new, empty composite layer factory.
|
TLspCompositeLayerFactory(ILspLayerFactory... aLayerFactories)
Creates a new composite layer factory containing the supplied delegate
factories.
|
TLspCompositeLayerFactory(Iterable<? extends ILspLayerFactory> aLayerFactories)
Creates a new composite layer factory that lazily uses the given Iterable to delegate to.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateLayers(ILcdModel aModel)
Returns true if there is at least one delegate factory whose
canCreateLayer() method also returns true for the given model. |
Collection<ILspLayer> |
createLayers(ILcdModel aModel)
Delegates to the first layer factory whose
canCreateLayer() method
returns true for the given model. |
List<ILspLayerFactory> |
getLayerFactories()
Returns the list of delegate layer factories contained in this composite.
|
public TLspCompositeLayerFactory()
layer factory list
.public TLspCompositeLayerFactory(Iterable<? extends ILspLayerFactory> aLayerFactories)
aLayerFactories
- delegate factories to be added to the compositepublic TLspCompositeLayerFactory(ILspLayerFactory... aLayerFactories)
aLayerFactories
- delegate factories to be added to the compositepublic List<ILspLayerFactory> getLayerFactories()
public Collection<ILspLayer> createLayers(ILcdModel aModel)
canCreateLayer()
method
returns true for the given model.createLayers
in interface ILspLayerFactory
aModel
- the model for which a layer should be createdpublic boolean canCreateLayers(ILcdModel aModel)
canCreateLayer()
method also returns true for the given model.canCreateLayers
in interface ILspLayerFactory
aModel
- the model for which a layer should be created