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 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.

  • Constructor Details

    • FeatureHandlesProvider

      public FeatureHandlesProvider()
      Creates a new instance.
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • canProvide

      public boolean canProvide(@NotNull Observable<@NotNull Feature> feature, @NotNull FeatureEditContext context)
      Indicates if this handles provider can create handles for the given Feature.
      Specified by:
      canProvide in interface IFeatureHandlesProvider
      Parameters:
      feature - an observable Feature.
      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 interface IFeatureHandlesProvider
      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 the Feature has changed.
      Returns:
      handles for the given feature. If this provider doesn't support the given feature, it can return null.
    • getHandleFactory

      @NotNull public FeatureHandlesProvider.IHandleFactory getHandleFactory()
      Returns the handle factory used by the handles provider.
      Returns:
      the handle factory used by the handles provider.
    • setHandleFactory

      public void setHandleFactory(@NotNull FeatureHandlesProvider.IHandleFactory handleFactory)
      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
    • getGeometryHandlesProvider

      @NotNull public IGeometryHandlesProvider getGeometryHandlesProvider()
      Returns the IGeometryHandlesProvider that is used.
      Returns:
      the IGeometryHandlesProvider that is used.
      See Also:
    • setGeometryHandlesProvider

      public void setGeometryHandlesProvider(@NotNull IGeometryHandlesProvider handlesProvider)
      Sets the IGeometryHandlesProvider that is used.

      If this method is not called, or if null is passed, a default implementation is used.

      Parameters:
      handlesProvider - the IGeometryHandlesProvider to use. Can be null.