Package com.luciad.view.lightspeed.layer
Class TLspCompositeLayerFactory
java.lang.Object
com.luciad.view.lightspeed.layer.TLspCompositeLayerFactory
- All Implemented Interfaces:
ILspLayerFactory
Composite implementation of
This will use all layer factories annotated with the
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.
Example usage:
To create a composite instance which uses all default availableILspLayerFactory
instances, you can use:
ILspLayerFactory layerFactory =
new TLspCompositeLayerFactory(TLcdServiceLoader.getInstance(ILspLayerFactory.class));
@LcdService
annotation.- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionCreates 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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateLayers
(ILcdModel aModel) Returns true if there is at least one delegate factory whosecanCreateLayer()
method also returns true for the given model.createLayers
(ILcdModel aModel) Delegates to the first layer factory whosecanCreateLayer()
method returns true for the given model.Returns the list of delegate layer factories contained in this composite.
-
Constructor Details
-
TLspCompositeLayerFactory
public TLspCompositeLayerFactory()Creates a new, empty composite layer factory. This factory will not be able to create layers until delegate layer factories are added to thelayer factory list
. -
TLspCompositeLayerFactory
Creates a new composite layer factory that lazily uses the given Iterable to delegate to.- Parameters:
aLayerFactories
- delegate factories to be added to the composite
-
TLspCompositeLayerFactory
Creates a new composite layer factory containing the supplied delegate factories.- Parameters:
aLayerFactories
- delegate factories to be added to the composite
-
-
Method Details
-
getLayerFactories
Returns the list of delegate layer factories contained in this composite. If the composite does not use an Iterable, delegates can be added or removed by modifying this list.- Returns:
- the list of delegate layer factories in this composite
-
createLayers
Delegates to the first layer factory whosecanCreateLayer()
method returns true for the given model.- Specified by:
createLayers
in interfaceILspLayerFactory
- Parameters:
aModel
- the model for which a layer should be created- Returns:
- a layer created by the selected delegate factory
-
canCreateLayers
Returns true if there is at least one delegate factory whosecanCreateLayer()
method also returns true for the given model.- Specified by:
canCreateLayers
in interfaceILspLayerFactory
- Parameters:
aModel
- the model for which a layer should be created- Returns:
- true if at least one of the delegate factories supports the given model
-