Class ALsp3StepEditHandle
java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspEditHandle
com.luciad.view.lightspeed.editor.handle.ALsp3StepEditHandle
- Direct Known Subclasses:
ALspObjectTranslationHandle
,ALspOutlineResizeHandle
,TLspPointTranslationHandle
Convenience handle class that separates the handling of AWT events into 3 steps.
These steps include:
- Activation: First the handle checks if the handle can be activated.
If so,
onActivate
is called. When a handle is active, the subsequent events will be passed to it. A handle remains active until it is deactivated byonDeactivate
. - Processing: If a handle is active, the handle checks if it can process an event. If so,
process
is called. This step is typically performed for multiple events. When an event is processed, it returns aTLspEditHandleResult
, which contains the partially processed event, and a list of edit operations to perform. - Deactivation: If a handle is active the handle checks if it can be deactivated. If so,
onDeactivate
is called, and the handle becomes inactive (isActive
returnsfalse
).
- Since:
- 2012.0
-
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
ALsp3StepEditHandle
(Object aGeometry) Creates a newALsp3StepEditHandle
for the given object. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
canActivate
(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the handle can be activated.protected boolean
canActivate
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanActivate(AWTEvent, TLspEditContext)
.protected abstract boolean
canDeactivate
(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the handle can be deactivated.protected boolean
canDeactivate
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanDeactivate(AWTEvent, TLspEditContext)
.protected abstract boolean
canProcess
(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the given event should be processed.protected boolean
canProcess
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanProcess(AWTEvent, TLspEditContext)
.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)
.final boolean
isActive()
Checks whether this handle is active.protected abstract TLspEditHandleResult
onActivate
(AWTEvent aEvent, TLspEditContext aEditContext) Called when this handle is activated (aftercanActivate
has returnedtrue
.protected TLspEditHandleResultFX
onActivate
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofonActivate(AWTEvent, TLspEditContext)
.protected abstract TLspEditHandleResult
onDeactivate
(AWTEvent aEvent, TLspEditContext aEditContext) Performs some action with the event after the handle is deactivated.protected TLspEditHandleResultFX
onDeactivate
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofonDeactivate(AWTEvent, TLspEditContext)
.protected abstract TLspEditHandleResult
process
(AWTEvent aEvent, TLspEditContext aEditContext) Process the given event.protected TLspEditHandleResultFX
process
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofprocess(AWTEvent, TLspEditContext)
.Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspEditHandle
getGeometry, requestsFocus, requestsFocus
Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
getCursor, getCursorFX, getPriority, getProperties, getStyleTargetProviders, setCursor, setCursorFX, setPriority
-
Constructor Details
-
ALsp3StepEditHandle
Creates a newALsp3StepEditHandle
for the given object.- Parameters:
aGeometry
- the geometry that is edited by this handle. Null is allowed, for instance if editing doesn't involve geometry directly.
-
-
Method Details
-
isActive
public final boolean isActive()Checks whether this handle is active. When a handle is active, it will be the first candidate to receive events. If a handle is inactive, it might still receive events (possibly making it active) if all other active handles didn't process an event. This method returnstrue
in betweencanActivate
returningtrue
, andonDeactivate
being called. Otherwise this method returnsfalse
.- Specified by:
isActive
in classALspHandle
- Returns:
- true if active, false otherwise
-
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. This method performs the handling of AWT events into 3 steps.- Activation: First the handle checks if the handle can be activated.
If so,
onActivate
is called. - Processing: If a handle is active, the handle checks if it can process an event. If so,
process
is called. This step is typically performed for multiple events. - Deactivation: If a handle is active the handle checks if it can be deactivated. If so,
onDeactivate
is called, and the handle becomes inactive (isActive
returnsfalse
).
- Specified by:
handleAWTEvent
in classALspEditHandle
- 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:
- Activation: First the handle checks if the handle can be activated.
If so,
-
handleFXEvent
JavaFX equivalent ofhandleAWTEvent(AWTEvent, TLspEditContext)
.- Overrides:
handleFXEvent
in classALspEditHandle
- 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
-
onActivate
Called when this handle is activated (aftercanActivate
has returnedtrue
.- Parameters:
aEvent
- the event that caused the handle to be activatedaEditContext
- the edit context- 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:
-
onActivate
JavaFX equivalent ofonActivate(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the event that caused the handle to be activatedaEditContext
- the edit context- 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
-
onDeactivate
Performs some action with the event after the handle is deactivated.- Parameters:
aEvent
- the event that caused the handle to be deactivatedaEditContext
- the edit context- 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:
-
onDeactivate
JavaFX equivalent ofonDeactivate(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the event that caused the handle to be deactivatedaEditContext
- the edit context- 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
-
process
Process the given event. This method is only called when the handle is active and processing is requested.- Parameters:
aEvent
- the event that was processedaEditContext
- the edit context- 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:
-
process
JavaFX equivalent ofprocess(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the event that was processedaEditContext
- the edit context- 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
-
canActivate
Checks whether the handle can be activated. If this method returnstrue
,isActive
will returntrue
andonActivate
is called next.- Parameters:
aEvent
- the event that should be handledaEditContext
- the edit context- Returns:
true
if the handle should be activated as a result of the given event,false
otherwise- See Also:
-
canActivate
JavaFX equivalent ofcanActivate(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the event that should be handledaEditContext
- the edit context- Returns:
true
if the handle should be activated as a result of the given event,false
otherwise- Since:
- 2020.0
-
canDeactivate
Checks whether the handle can be deactivated. If this method returnstrue
,isActive
will returnfalse
andonDeactivate
is called next.- Parameters:
aEvent
- the event that should be handledaEditContext
- the edit context- Returns:
true
if the handle should be deactivated as a result of the given event,false
otherwise- See Also:
-
canDeactivate
JavaFX equivalent ofcanDeactivate(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the event that should be handledaEditContext
- the edit context- Returns:
true
if the handle should be deactivated as a result of the given event,false
otherwise- Since:
- 2020.0
-
canProcess
Checks whether the given event should be processed. If this method returnstrue
,process
is called next.- Parameters:
aEvent
- the event that should be handledaEditContext
- the edit context- Returns:
true
if the handle should process this event,false
otherwise.- See Also:
-
canProcess
JavaFX equivalent ofcanProcess(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the event that should be handledaEditContext
- the edit context- Returns:
true
if the handle should process this event,false
otherwise.- Since:
- 2020.0
-