Package com.luciad.edit.features
Class FeatureHandlesProvider
java.lang.Object
com.luciad.edit.features.FeatureHandlesProvider
- All Implemented Interfaces:
IFeatureHandlesProvider
,AutoCloseable
public final class FeatureHandlesProvider
extends Object
implements AutoCloseable, IFeatureHandlesProvider
Default handles provider for features.
It can create a handles for features by:
creating
a handle to translate the entire featuredelegating
to a geometry handles provider.
The delegate geometry handles are created using an IGeometryHandlesProvider
. The geometry is extracted from the feature using the IFeatureGeometryProvider
that is provided
by the feature layer. This IFeatureGeometryProvider
can be configured
in the feature layer.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Allows you to specify the translate handle that is used by this handles provider. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canProvide
(Observable<@NotNull Feature> feature, FeatureEditContext context) Indicates if this handles provider can create handles for the givenFeature
.void
close()
protected void
finalize()
Returns theIGeometryHandlesProvider
that is used.Returns the handle factory used by the handles provider.provide
(Observable<@NotNull Feature> feature, FeatureEditContext context, IFeatureEditCallback featureEditCallback) Returns handles for the given feature.void
setGeometryHandlesProvider
(IGeometryHandlesProvider handlesProvider) Sets theIGeometryHandlesProvider
that is used.void
setHandleFactory
(FeatureHandlesProvider.IHandleFactory handleFactory) Sets the handle factory used by the handles provider.
-
Constructor Details
-
FeatureHandlesProvider
public FeatureHandlesProvider()Creates a new instance.
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
canProvide
public boolean canProvide(@NotNull Observable<@NotNull Feature> feature, @NotNull FeatureEditContext context) Indicates if this handles provider can create handles for the givenFeature
.- Specified by:
canProvide
in interfaceIFeatureHandlesProvider
- Parameters:
feature
- an observableFeature
.context
- the context. Contains additional information about the edited feature.- Returns:
- if this handles provider can create handles for the given
Feature
.
-
provide
@Nullable public IEditHandles provide(@NotNull Observable<@NotNull Feature> feature, @NotNull FeatureEditContext context, @NotNull IFeatureEditCallback featureEditCallback) Returns handles for the given feature.If this provider doesn't support the given feature, it can return
null
.- Specified by:
provide
in interfaceIFeatureHandlesProvider
- Parameters:
feature
- the observable feature for which to create handles.context
- the context. Contains additional information about the edited feature.featureEditCallback
- a callback that notifies the caller when theFeature
has changed.- Returns:
- handles for the given feature. If this provider doesn't support the given feature, it can return
null
.
-
getHandleFactory
Returns the handle factory used by the handles provider.- Returns:
- the handle factory used by the handles provider.
-
setHandleFactory
Sets the handle factory used by the handles provider.If this method is not called, a default handle factory is used. You can change the behavior of this default handle factory by:
- wrapping it with your own
IHandleFactory
implementation, by delegating to the default factory - omitting/replacing the handle that is returned
- Parameters:
handleFactory
- a handle factory
- wrapping it with your own
-
getGeometryHandlesProvider
Returns theIGeometryHandlesProvider
that is used.- Returns:
- the
IGeometryHandlesProvider
that is used. - See Also:
-
setGeometryHandlesProvider
Sets theIGeometryHandlesProvider
that is used.If this method is not called, or if
null
is passed, adefault
implementation is used.- Parameters:
handlesProvider
- theIGeometryHandlesProvider
to use. Can benull
.
-