Class ALspEditHandle
java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspEditHandle
- Direct Known Subclasses:
ALsp3StepEditHandle
,ALspCreateHandle
,TLspPointSetHandle
An edit handle is a widget that manipulates a domain object or some part of that object. An
ILspEditor
is responsible
for providing the appropriate handles for a particular object. A handle should be able to
capture user input from the handleAWTEvent
method (mouse, keyboard, ...)
and convert it into an edit handle result, containing zero
or more edit operations.
An edit handle can have focus. The edit controller can respond to this
by forwarding event objects to this handle by calling handleAWTEvent
. At the
same time, the handle can be visualized differently, and the handle's cursor can be shown to indicate that the handle can be used to interact with.
Each handle generally corresponds to the geometry of an object for which the handle will generate
edit operations. As an example, an editor might edit a four-sided polygon with five
handles: four to move each of the individual vertices of the polygon, and a fifth one to move
the polygon as a whole. A handle is not allowed to modify its corresponding object geometry directly -- that
responsibility lies with the ILspEditor
.- Since:
- 2012.0
- See Also:
-
Field Summary
Fields inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
PRIORITY_2D_CONTOUR, PRIORITY_2D_POINT, PRIORITY_2D_SHAPE, PRIORITY_3D_CONTOUR, PRIORITY_3D_POINT, PRIORITY_3D_SHAPE, PRIORITY_MULTIPLE_SHAPES
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALspEditHandle
(Object aGeometry) Creates a new edit handle, given the geometry that it is going to edit. -
Method Summary
Modifier and TypeMethodDescriptionReturns the geometry that is being edited with this edit handleabstract TLspEditHandleResult
handleAWTEvent
(AWTEvent aEvent, TLspEditContext aEditContext) Handle the given input event for the given edit context.handleFXEvent
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofhandleAWTEvent(AWTEvent, TLspEditContext)
.boolean
requestsFocus
(AWTEvent aEvent, TLspEditContext aEditContext) Indicates whether this handle requests focus for the given event.boolean
requestsFocus
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofrequestsFocus(AWTEvent, TLspEditContext)
.Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
getCursor, getCursorFX, getPriority, getProperties, getStyleTargetProviders, isActive, setCursor, setCursorFX, setPriority
-
Constructor Details
-
ALspEditHandle
Creates a new edit handle, given the geometry that it is going to edit.- Parameters:
aGeometry
- the geometry that is edited by this handle. Null is allowed, for instance if editing doesn't involve geometry directly.
-
-
Method Details
-
getGeometry
Returns the geometry that is being edited with this edit handle- Returns:
- the geometry that is being edited with this edit handle
-
handleAWTEvent
Handle the given input event for the given edit context. The edit handle can choose the operation to perform based on the type and state of the input event. When the edit handle has processed the input event, this method will return a edit handle result containing anull
event to indicate that the event has been consumed. Note that sometimes an event might be partially consumed (which is often the case with touch events), in which case this method will return an edit handle result with an altered version of the given input event. If incoming event should be ignored, this method should return aTLspEditHandleResult
without any edit operations, and an unconsumedAWTEvent
. An unconsumedAWTEvent
means that it should contain the original, unmodifiedaEvent
parameter passed to this method. This result indicates that the event was not consumed, and that some other object needs to consume the event instead. As a side effect, a handle is allowed to activate or deactivate itself as a result of processing an input event.- Parameters:
aEvent
- the input eventaEditContext
- the edit context, containing, amongst others, information about the layer for which this handle is operating, the view, the object for which this handle was created, the geometry that this handle was created for, the paint representation in which geometry exists, and the sensitivity with which the event should be handled- Returns:
- an edit handle result containing a collection of operations to perform, and the
(partially) consumed event object. The handle result itself should not be
null
. - See Also:
-
handleFXEvent
JavaFX equivalent ofhandleAWTEvent(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the input eventaEditContext
- the edit context, containing, amongst others, information about the layer for which this handle is operating, the view, the object for which this handle was created, the geometry that this handle was created for, the paint representation in which geometry exists, and the sensitivity with which the event should be handled- Returns:
- an edit handle result containing a collection of operations to perform, and the
(partially) consumed event object. The handle result itself should not be
null
. - Since:
- 2020.0
-
requestsFocus
Indicates whether this handle requests focus for the given event. The edit controller can respond to this by forwarding event objects to this handle by callinghandleAWTEvent
. However, this is not ensured, because another handle may have precedence over this handle and also request focus. Precedence is primarily determined by thehandle priority
.The default implementation returns
true
if the handle is active. Subclasses can override this method for custom behavior. An example would be to request focus when the mouse hovers over a visual handle component.- Parameters:
aEvent
- the AWTEvent that might result in a focus requestaEditContext
- the edit context, containing, amongst others, information about the layer for which this handle is operating, the view, the object for which this handle was created, the geometry that this handle was created for, the paint representation in which geometry exists, and the sensitivity with which the event should be handled- Returns:
true
if this handle requests focus for the given event,false
otherwise.- See Also:
-
requestsFocus
JavaFX equivalent ofrequestsFocus(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the AWTEvent that might result in a focus requestaEditContext
- the edit context, containing, amongst others, information about the layer for which this handle is operating, the view, the object for which this handle was created, the geometry that this handle was created for, the paint representation in which geometry exists, and the sensitivity with which the event should be handled- Returns:
true
if this handle requests focus for the given event,false
otherwise.- Since:
- 2020.0
-