Class TLcyCompositeLayerMeasureProviderFactory
- All Implemented Interfaces:
ILcdLayerMeasureProviderFactory
,Iterable<ILcdLayerMeasureProviderFactory>
Composite implementation (see composite design pattern) of ILcdLayerMeasureProviderFactory
. It
keeps a list of associated ILcdLayerMeasureProviderFactory
instances: one can add and remove other
ILcdLayerMeasureProviderFactory
instances to this ILcdLayerMeasureProviderFactory
.
When creating a new TLcyCompositeLayerMeasureProviderFactory
using the default
constructor (see TLcyCompositeLayerMeasureProviderFactory()
), the created instance will
only work on/with the ILcdLayerMeasureProviderFactorys registered
on this composite instance (see addLayerMeasureProviderFactory(com.luciad.util.measure.ILcdLayerMeasureProviderFactory)
and removeLayerMeasureProviderFactory(com.luciad.util.measure.ILcdLayerMeasureProviderFactory)
).
When creating a new TLcyCompositeLayerMeasureProviderFactory
using the constructor
specifying an ILcyLucyEnv
instance (see TLcyCompositeLayerMeasureProviderFactory(com.luciad.lucy.ILcyLucyEnv)
), the created instance will
work on the Lucy back-end services. It will use
all registered ILcdLayerMeasureProviderFactory
instances of the
Lucy back-end, adding and/or removing an ILcdLayerMeasureProviderFactory
will
add/remove the ILcdLayerMeasureProviderFactory
as service from Lucy, ... .
This class can for example be used to retrieve measures for a view:
TLcyCompositeLayerMeasureProviderFactory factory = new TLcyCompositeLayerMeasureProviderFactory(lucyEnv);
TLcdGXYViewMeasureProvider measureProvider = new TLcdGXYViewMeasureProvider(view, null, Collections.singletonList(factory));
ALcdMeasureProvider.Parameters parameters = ALcdMeasureProvider.Parameters.newBuilder().build();
List<TLcdISO19103Measure[]> measures = measureProvider.retrieveMeasuresAt(point, pointReference, parameters);
- Since:
- 2015.0
-
Field Summary
Fields inherited from class com.luciad.lucy.util.TLcyGenericComposite
PRIORITY_DEFAULT, PRIORITY_FALLBACK
-
Constructor Summary
ConstructorDescriptionDefault constructor.Construct aTLcyCompositeLayerMeasureProviderFactory
working on the Lucy back-end. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayerMeasureProviderFactory
(ILcdLayerMeasureProviderFactory aLayerMeasureProviderFactory) Adds the givenILcdLayerMeasureProviderFactory
to this composite measure provider factory.void
addLayerMeasureProviderFactory
(ILcdLayerMeasureProviderFactory aLayerMeasureProviderFactory, int aPriority) Adds the givenILcdLayerMeasureProviderFactory
to this composite measure provider factory, with the given priority.createMeasureProvider
(ILcdLayer aLayer, ILcdView aView) Creates a new measure provider, based on the given layer and view, ornull
if no measure provider can be created.getList()
Returns an unmodifiableList
containing all registered instances ofILcdLayerMeasureProviderFactory
.void
removeLayerMeasureProviderFactory
(ILcdLayerMeasureProviderFactory aLayerMeasureProviderFactory) Removes the givenILcdLayerMeasureProviderFactory
from this composite measure provider factory.Methods inherited from class com.luciad.lucy.util.TLcyGenericComposite
add, add, getPriority, iterator, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TLcyCompositeLayerMeasureProviderFactory
public TLcyCompositeLayerMeasureProviderFactory()Default constructor. No
ILcdLayerMeasureProviderFactory
s are associated.The created instance will only work on the
ILcdLayerMeasureProviderFactory
instances registered to it. If you want to use all registeredILcdLayerMeasureProviderFactory
instances of the Lucy back-end, useTLcyCompositeLayerMeasureProviderFactory(com.luciad.lucy.ILcyLucyEnv)
instead.- See Also:
-
TLcyCompositeLayerMeasureProviderFactory
Construct a
TLcyCompositeLayerMeasureProviderFactory
working on the Lucy back-end.It will use all
ILcdLayerMeasureProviderFactory
instances registered to the back-end, and adding and/or removingILcdLayerMeasureProviderFactory
s to/from thisILcdLayerMeasureProviderFactory
will respectively add/remove it as service from the back-end.If you want to create a
TLcyCompositeLayerMeasureProviderFactory
which does not use the back-end, useTLcyCompositeLayerMeasureProviderFactory()
instead.- Parameters:
aLucyEnv
- The Lucy back-end.- See Also:
-
-
Method Details
-
createMeasureProvider
Description copied from interface:ILcdLayerMeasureProviderFactory
Creates a new measure provider, based on the given layer and view, ornull
if no measure provider can be created.- Specified by:
createMeasureProvider
in interfaceILcdLayerMeasureProviderFactory
- Parameters:
aLayer
- the layer for which to create a measure provideraView
- the view for which to create a measure provider- Returns:
- a measure provider, or
null
if no measure provider can be created for the given layer and view.
-
addLayerMeasureProviderFactory
public void addLayerMeasureProviderFactory(ILcdLayerMeasureProviderFactory aLayerMeasureProviderFactory) Adds the given
ILcdLayerMeasureProviderFactory
to this composite measure provider factory.If the constructor specifying an
ILcyLucyEnv
is used, theILcdLayerMeasureProviderFactory
will be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)
). When callingILcyLucyEnv.getServices(Class)
afterwards,aLayerMeasureProviderFactory
will only be included in the returned list when the requested class wasILcdLayerMeasureProviderFactory.class
.
Note: if you want to remove the registeredILcdLayerMeasureProviderFactory
afterwards, useremoveLayerMeasureProviderFactory
and notILcyLucyEnv.removeService(Object)
.- Parameters:
aLayerMeasureProviderFactory
- the measure provider factory to add- See Also:
-
addLayerMeasureProviderFactory
public void addLayerMeasureProviderFactory(ILcdLayerMeasureProviderFactory aLayerMeasureProviderFactory, int aPriority) Adds the given
ILcdLayerMeasureProviderFactory
to this composite measure provider factory, with the given priority.If the constructor specifying an
ILcyLucyEnv
is used, theILcdLayerMeasureProviderFactory
will be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)
). When callingILcyLucyEnv.getServices(Class)
afterwards,aLayerMeasureProviderFactory
will only be included in the returned list when the requested class wasILcdLayerMeasureProviderFactory.class
.
Note: if you want to remove the registeredILcdLayerMeasureProviderFactory
afterwards, useremoveLayerMeasureProviderFactory
and notILcyLucyEnv.removeService(Object)
.- Parameters:
aLayerMeasureProviderFactory
- the measure provider factory to addaPriority
- the priority- See Also:
-
removeLayerMeasureProviderFactory
public void removeLayerMeasureProviderFactory(ILcdLayerMeasureProviderFactory aLayerMeasureProviderFactory) Removes the given
ILcdLayerMeasureProviderFactory
from this composite measure provider factory. If the givenILcdLayerMeasureProviderFactory
was never added before, nothing happens.If the constructor specifying an
ILcyLucyEnv
is used, theILcdLayerMeasureProviderFactory
will be removed as service from the Lucy back-end (seeILcyLucyEnv.removeService(Object)
).
Note: it is only possible to removeILcdLayerMeasureProviderFactory
instances which were registered using theaddLayerMeasureProviderFactory(com.luciad.util.measure.ILcdLayerMeasureProviderFactory)
method.- Parameters:
aLayerMeasureProviderFactory
- AILcdLayerMeasureProviderFactory
to remove.- See Also:
-
getList
Returns an unmodifiable
List
containing all registered instances ofILcdLayerMeasureProviderFactory
.- Overrides:
getList
in classTLcyGenericComposite<ILcdLayerMeasureProviderFactory>
- Returns:
- an unmodifiable
List
containing all registered instances ofILcdLayerMeasureProviderFactory
.
-