public final class FeatureHandlesProvider extends Object implements AutoCloseable, IFeatureHandlesProvider
It can create a handles for features by:
creating
a handle to translate the entire feature
delegating
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.
Modifier and Type | Class and Description |
---|---|
static interface |
FeatureHandlesProvider.IHandleFactory
Allows you to specify the translate handle that is used by this handles provider.
|
Constructor and Description |
---|
FeatureHandlesProvider()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canProvide(Observable<Feature> feature,
FeatureEditContext context)
Indicates if this handles provider can create handles for the given
Feature . |
void |
close() |
protected void |
finalize() |
IGeometryHandlesProvider |
getGeometryHandlesProvider() |
FeatureHandlesProvider.IHandleFactory |
getHandleFactory() |
IEditHandles |
provide(Observable<Feature> feature,
FeatureEditContext context,
IFeatureEditCallback featureEditCallback)
Returns handles for the given feature.
|
void |
setGeometryHandlesProvider(IGeometryHandlesProvider handlesProvider)
Sets the
IGeometryHandlesProvider that is used. |
void |
setHandleFactory(FeatureHandlesProvider.IHandleFactory handleFactory)
Sets the
IHandleFactory that is used by this handles provider to create a new translate handle. |
public void close()
close
in interface AutoCloseable
public boolean canProvide(@NotNull Observable<Feature> feature, @NotNull FeatureEditContext context)
Feature
.canProvide
in interface IFeatureHandlesProvider
feature
- an observable Feature
.context
- the context. Contains additional information about the edited feature.Feature
.@Nullable public IEditHandles provide(@NotNull Observable<Feature> feature, @NotNull FeatureEditContext context, @NotNull IFeatureEditCallback featureEditCallback)
If this provider doesn't support the given feature, it can return null
.
provide
in interface IFeatureHandlesProvider
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 the Feature
has changed.null
.@NotNull public FeatureHandlesProvider.IHandleFactory getHandleFactory()
public void setHandleFactory(@NotNull FeatureHandlesProvider.IHandleFactory handleFactory)
IHandleFactory
that is used by this handles provider to create a new translate handle.
If this method is not called, a default handle factory is used. You can change the behavior of this default handle factory by:
retrieving it
IHandleFactory
implementation, by delegating to the default factory
handleFactory
- a handle factory@NotNull public IGeometryHandlesProvider getGeometryHandlesProvider()
IGeometryHandlesProvider
that is used.setGeometryHandlesProvider
public void setGeometryHandlesProvider(@NotNull IGeometryHandlesProvider handlesProvider)
IGeometryHandlesProvider
that is used.
If this method is not called, or if null
is passed, a default
implementation is used.
handlesProvider
- the IGeometryHandlesProvider
to use. Can be null
.