Interface PolylineRingHandlesProvider.IHandleFactory
- Enclosing class:
PolylineRingHandlesProvider
It allows you to
- replace handles with other handle implementations
- (dynamically) disable or re-enable specific handles
Additional handles can not be added using this factory. The way to do this is to wrap the IEditHandles
provided by PolylineRingHandlesProvider
, and to insert additional handles in the IEditHandles#getList
method.
-
Method Summary
Modifier and TypeMethodDescriptioncreateInsertPointHandle
(Observable<@Nullable PolylineRing> polylineRing, long insertIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to insert a new point in aPolylineRing
.createMovePointHandle
(Observable<@Nullable PolylineRing> polylineRing, long pointIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to move a point of thePolylineRing
.createRemovePointHandle
(Observable<@Nullable PolylineRing> polylineRing, long pointIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to remove a point of thePolylineRing
.boolean
isInsertPointHandleValid
(IEditHandle insertPointHandle, Observable<PolylineRing> polylineRing, long insertIndex, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.boolean
isMovePointHandleValid
(IEditHandle movePointHandle, Observable<@Nullable PolylineRing> polylineRing, long pointIndex, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.boolean
isRemovePointHandleValid
(IEditHandle removePointHandle, Observable<PolylineRing> polylineRing, long pointIndex, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.
-
Method Details
-
createMovePointHandle
@Nullable IEditHandle createMovePointHandle(@NotNull Observable<@Nullable PolylineRing> polylineRing, long pointIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to move a point of thePolylineRing
.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polylineRing
- theGeometry
that is being editedpointIndex
- the index of the point to moveeditAction
- the move-point edit action, to be used by the handle. If aconstraint
was configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChange
parameter with onemoved point index
.context
- the context- Returns:
- a new handle, or
null
if no handle should be used
-
isMovePointHandleValid
boolean isMovePointHandleValid(@NotNull IEditHandle movePointHandle, @NotNull Observable<@Nullable PolylineRing> polylineRing, long pointIndex, @NotNull FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.This method is called whenever the edited geometry changes and allows the factory to dynamically disable or re-create specific edit handles. When this method returns false, the handle is removed and
createMovePointHandle
is called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnull
in that method.- Parameters:
movePointHandle
- the handlepolylineRing
- theGeometry
that is being editedpointIndex
- the index of the pointcontext
- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-
createRemovePointHandle
@Nullable IEditHandle createRemovePointHandle(@NotNull Observable<@Nullable PolylineRing> polylineRing, long pointIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to remove a point of thePolylineRing
.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polylineRing
- theGeometry
that is being editedpointIndex
- the index of the point to removeeditAction
- the remove-point edit action, to be used by the handle. If aconstraint
was configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChange
parameter with oneremoved point index
.context
- the context- Returns:
- a new handle, or
null
if no handle should be used
-
isRemovePointHandleValid
boolean isRemovePointHandleValid(@NotNull IEditHandle removePointHandle, @NotNull Observable<PolylineRing> polylineRing, long pointIndex, @NotNull FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.This method is called whenever the edited geometry changes and allows the factory to dynamically disable or re-create specific edit handles. When this method returns false, the handle is removed and
createRemovePointHandle
is called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnull
in that method.- Parameters:
removePointHandle
- the handlepolylineRing
- theGeometry
that is being editedpointIndex
- the index of the pointcontext
- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-
createInsertPointHandle
@Nullable IEditHandle createInsertPointHandle(@NotNull Observable<@Nullable PolylineRing> polylineRing, long insertIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to insert a new point in aPolylineRing
.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polylineRing
- theGeometry
that is being editedinsertIndex
- the index at which to insert a point in thePolyline
. After the point is inserted, the new point will have this index. Values are within[1, pointCount]
.editAction
- the edit action that inserts the point. If aconstraint
was configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChange
parameter with oneinserted point index
.context
- the context- Returns:
- a new handle, or
null
if no handle should be used
-
isInsertPointHandleValid
boolean isInsertPointHandleValid(@NotNull IEditHandle insertPointHandle, @NotNull Observable<PolylineRing> polylineRing, long insertIndex, @NotNull FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.This method is called whenever the edited geometry changes and allows the factory to dynamically disable or re-create specific edit handles. When this method returns false, the handle is removed and
createInsertPointHandle
is called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnull
in that method.- Parameters:
insertPointHandle
- the handlepolylineRing
- theGeometry
that is being editedinsertIndex
- the insertion indexcontext
- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-