Creates a new PointListTranslateHandle.
Protected
activeThe index of the active handle.
The active handle is the handle that is currently handling gesture events. It takes priority over other handles, as long as it is handling events. Once it stops handling events (when it returns HandleEventResult.EVENT_IGNORED), the composite will forward events to other handles, which can become active.
-1 if no handle is currently active.
Protected
eventedThe EventedSupport used to emit events.
Typically, handles use emitEditShapeEvent to emit "EditShape" events. This is only used in advanced cases, for example when compositing multiple handles.
The handle's icon style, as defined at construction time.
Protected
handlesThe list of handles that this CompositeEditHandle delegates to.
Note that the setter has side effects. Do not modify the list of handles in-place (e.g. push()
new
handles to the array after the setter has been called).
Creates translate handles for the handle's pointList.
The default implementation creates a SinglePointTranslateHandle for every point in the point list.
Protected
emitEmits an "EditShape"
event.
Typically, a handle emits this right after changing the shape.
The shape to emit an edit event for
The status of the edit. Typically, this is IN_PROGRESS while the handle is being dragged / changed, and EditShapeStatus.FINISHED when the drag ends.
Finds the handles to interact with, based on a given input event.
The event to find handles for
The edit context
handles that are close to the mouse cursor / finger.
Returns the mouse cursor to show.
If there is an active handle, its cursor is returned. Otherwise, the first interaction handle's cursor is used.
Invalidates this edit handle.
This will cause onDraw and onDrawLabel to be called again.
Use this if you need to update the visualization of the handle. For example, the handle has changed style and onDraw needs to be re-evaluated.
Called when a ContextMenu is populated.
This calls onCreateContextMenu for all delegate handles.
Draws handle labels on the map.
EditHandle in the list of handles.
Handles the given context.
It forwards the event to all interaction handles. If one the interaction handles then handles the event, that handle becomes the active handle until it deactivates (returns HandleEventResult.REQUEST_DEACTIVATION or ignores an event).
Indicates whether the feature being created or edited, should be painted by the controller.
By default, if one of the delegate handles' shouldPaintFeature returns true
,
this also returns true
. Otherwise false
is returned.
Checks if the handles should be updated.
By default, this returns true
if the shape's point count is different
from the current amount of handles. Ie. only when the size of the point list changes, new
SinglePointTranslateHandle need to be created.
If you create a different number of translate handles, then this check should reflect that.
For example, if you disallow deletion of the first and last point, this method should check if the number of handles
is different from shape.pointCount - 2
Called when (another) handle changes the feature or shape, as indicated by the "EditShape" event.
The default implementation calls createTranslateHandles, if shouldUpdateHandles returns true
.
An event that is emitted whenever this handle changes the shape of a feature.
EditShape
An event that is emitted whenever this handle is invalidated.
Invalidated
A handle to translate points in a point list (Polyline).
It composes a list of SinglePointTranslateHandle. By default, a SinglePointTranslateHandle is placed at every point of the point list.
See
PointListEditor
Since
2022.1