Interface PolylineHandlesProvider.IHandleFactory
- Enclosing class:
PolylineHandlesProvider
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 PolylineHandlesProvider, and to insert additional handles in the IEditHandles#getList method.
-
Method Summary
Modifier and TypeMethodDescriptioncreateAppendPointHandle(Observable<@Nullable Polyline> polyline, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to insert a new point at the end of aPolyline.createElevationPointHandle(Observable<@Nullable Polyline> polyline, long pointIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to change the elevation of the point of aPolyline.createInsertPointHandle(Observable<@Nullable Polyline> polyline, long insertIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to insert a new point between two existing points of aPolyline.createMovePointHandle(Observable<@Nullable Polyline> polyline, long pointIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to move a point of thePolyline.createPrependPointHandle(Observable<@Nullable Polyline> polyline, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to insert a new point at the start of aPolyline.createRemovePointHandle(Observable<@Nullable Polyline> polyline, long pointIndex, IPointEditAction editAction, FeatureEditContext context) Creates a handle that allows you to remove a point of thePolyline.booleanisAppendPointHandleValid(IEditHandle appendPointHandle, Observable<Polyline> polyline, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.booleanisElevationPointHandleValid(IEditHandle elevationPointHandle, Observable<Polyline> polyline, long pointIndex, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.booleanisInsertPointHandleValid(IEditHandle insertPointHandle, Observable<Polyline> polyline, long insertIndex, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.booleanisMovePointHandleValid(IEditHandle movePointHandle, Observable<Polyline> polyline, long pointIndex, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.booleanisPrependPointHandleValid(IEditHandle prependPointHandle, Observable<Polyline> polyline, FeatureEditContext context) Returns true if the given handle is still valid, or false if it should be removed.booleanisRemovePointHandleValid(IEditHandle removePointHandle, Observable<Polyline> polyline, 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 Polyline> polyline, long pointIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to move a point of thePolyline.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polyline- theGeometrythat is being editedpointIndex- the index of the point to moveeditAction- the move-point edit action, to be used by the handle. If aconstraintwas configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChangeparameter with onemoved point index.context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isMovePointHandleValid
boolean isMovePointHandleValid(@NotNull IEditHandle movePointHandle, @NotNull Observable<Polyline> polyline, 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
createMovePointHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
movePointHandle- the handlepolyline- theGeometrythat 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 Polyline> polyline, long pointIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to remove a point of thePolyline.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polyline- theGeometrythat is being editedpointIndex- the index of the point to removeeditAction- the remove-point edit action, to be used by the handle. If aconstraintwas configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChangeparameter with oneremoved point index.context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isRemovePointHandleValid
boolean isRemovePointHandleValid(@NotNull IEditHandle removePointHandle, @NotNull Observable<Polyline> polyline, 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
createRemovePointHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
removePointHandle- the handlepolyline- theGeometrythat 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.
-
createElevationPointHandle
@Nullable IEditHandle createElevationPointHandle(@NotNull Observable<@Nullable Polyline> polyline, long pointIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to change the elevation of the point of aPolyline.This method is only called when a 3D
Mapis used. While the handle is not already present, this method is called whenever the edited geometry changes.- Parameters:
polyline- theGeometrythat is being editedpointIndex- the index of the point to move/removeeditAction- the move-point edit action, to be used by the handle. If aconstraintwas configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChangeparameter with onemoved point index.context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isElevationPointHandleValid
boolean isElevationPointHandleValid(@NotNull IEditHandle elevationPointHandle, @NotNull Observable<Polyline> polyline, 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
createElevationPointHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
elevationPointHandle- the handlepolyline- theGeometrythat 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 Polyline> polyline, long insertIndex, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to insert a new point between two existing points of aPolyline.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polyline- theGeometrythat 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 lie within[1, pointCount - 1]editAction- the edit action that inserts the point. If aconstraintwas configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChangeparameter with oneinserted point index.context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isInsertPointHandleValid
boolean isInsertPointHandleValid(@NotNull IEditHandle insertPointHandle, @NotNull Observable<Polyline> polyline, 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
createInsertPointHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
insertPointHandle- the handlepolyline- theGeometrythat is being editedinsertIndex- the insertion indexcontext- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-
createPrependPointHandle
@Nullable IEditHandle createPrependPointHandle(@NotNull Observable<@Nullable Polyline> polyline, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to insert a new point at the start of aPolyline.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polyline- theGeometrythat is being editededitAction- the edit action that inserts the point at the start of the polyline. If aconstraintwas configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChangeparameter with oneinserted point indexequal to0.context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isPrependPointHandleValid
boolean isPrependPointHandleValid(@NotNull IEditHandle prependPointHandle, @NotNull Observable<Polyline> polyline, @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
createPrependPointHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
prependPointHandle- the handlepolyline- theGeometrythat is being editedcontext- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-
createAppendPointHandle
@Nullable IEditHandle createAppendPointHandle(@NotNull Observable<@Nullable Polyline> polyline, @NotNull IPointEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to insert a new point at the end of aPolyline.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
polyline- theGeometrythat is being editededitAction- the edit action that inserts the point at the end of the polyline. If aconstraintwas configured on the handles provider, this action applies that constraint when it is executed, providing aPolylineChangeparameter with oneinserted point indexequal topointCount(of the new polyline).context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isAppendPointHandleValid
boolean isAppendPointHandleValid(@NotNull IEditHandle appendPointHandle, @NotNull Observable<Polyline> polyline, @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
createAppendPointHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
appendPointHandle- the handlepolyline- theGeometrythat is being editedcontext- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-