Interface IGeometryHandlesProvider

All Known Implementing Classes:
CompositeGeometryHandlesProvider, PatchHandlesProvider, PointHandlesProvider, PolygonHandlesProvider, PolylineHandlesProvider, PolylineRingHandlesProvider

public interface IGeometryHandlesProvider
This class can provide edit handles for a given Geometry.

The given Geometry is passed to this provider as an Observable. This object allows Editor to communicate geometry changes to the IEditHandles implementations, who can use it to create and update their collection of handles. Editing changes originating from IEditHandles are communicated to the Editor or handles wrappers by calling IGeometryEditCallback. See also the related guide on editing interactions.

This class is typically used in the context of feature editing, when a feature is edited by modifying its geometry.

It has a default implementation that supports many geometries.

See the related guide for an overview of the editing API.

  • Method Details

    • canProvide

      boolean canProvide(@NotNull Observable<@Nullable Geometry> geometry, @NotNull FeatureEditContext context)
      Indicates if this handles provider can create handles for the given geometry.
      Parameters:
      geometry - an observable geometry, cannot be null
      context - the context. Contains additional information about the edited feature, cannot be null.
      Returns:
      if this handles provider can provide handles and a translate action for the given Feature
    • provide

      @NotNull IEditHandles provide(@NotNull Observable<@Nullable Geometry> geometry, @NotNull FeatureEditContext context, @NotNull IGeometryEditCallback geometryEditCallback)
      Returns the handles for the given feature.

      Note: translation of features is handled by IFeatureHandlesProvider. So geometry handles providers should not provide handles to translate a geometry.

      Parameters:
      geometry - the observable geometry for which to provide handles, cannot be null.
      context - the context. Contains additional information about the edited feature, cannot be null.
      geometryEditCallback - a callback that notifies the caller when the Feature has changed, cannot be null.
      Returns:
      handles for the given feature. Never null.
    • provideTranslateAction

      @NotNull ITranslateEditAction provideTranslateAction(@NotNull Observable<@Nullable Geometry> geometry, @NotNull FeatureEditContext context, @NotNull IGeometryEditCallback geometryEditCallback)
      Provides a translate action that can be used by the caller to add translation behavior.

      A translation handle is typically added by an IFeatureHandlesProvider, like for example the FeatureHandlesProvider implementation. It calls this method to retrieve a translate action, and uses it to create a TranslateEditHandle.

      When ITranslateEditAction#translate is called, the returned implementation must:

      Parameters:
      geometry - the observable geometry for which to provide a translate action, cannot be null
      context - the context, cannot be null
      geometryEditCallback - a callback that notifies the caller of this method when a translation has occurred, cannot be null
      Returns:
      a translate action. Never null.