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,
onActivateis 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,
processis 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,
onDeactivateis called, and the handle becomes inactive (isActivereturnsfalse).
- 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
ConstructorsModifierConstructorDescriptionprotectedALsp3StepEditHandle(Object aGeometry) Creates a newALsp3StepEditHandlefor the given object. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancanActivate(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the handle can be activated.protected booleancanActivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanActivate(AWTEvent, TLspEditContext).protected abstract booleancanDeactivate(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the handle can be deactivated.protected booleancanDeactivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanDeactivate(AWTEvent, TLspEditContext).protected abstract booleancanProcess(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the given event should be processed.protected booleancanProcess(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 booleanisActive()Checks whether this handle is active.protected abstract TLspEditHandleResultonActivate(AWTEvent aEvent, TLspEditContext aEditContext) Called when this handle is activated (aftercanActivatehas returnedtrue.protected TLspEditHandleResultFXonActivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofonActivate(AWTEvent, TLspEditContext).protected abstract TLspEditHandleResultonDeactivate(AWTEvent aEvent, TLspEditContext aEditContext) Performs some action with the event after the handle is deactivated.protected TLspEditHandleResultFXonDeactivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofonDeactivate(AWTEvent, TLspEditContext).protected abstract TLspEditHandleResultprocess(AWTEvent aEvent, TLspEditContext aEditContext) Process the given event.protected TLspEditHandleResultFXprocess(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofprocess(AWTEvent, TLspEditContext).Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspEditHandle
getGeometry, requestsFocus, requestsFocusMethods inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
getCursor, getCursorFX, getPriority, getProperties, getStyleTargetProviders, setCursor, setCursorFX, setPriority
-
Constructor Details
-
ALsp3StepEditHandle
Creates a newALsp3StepEditHandlefor 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 returnstruein betweencanActivatereturningtrue, andonDeactivatebeing called. Otherwise this method returnsfalse.- Specified by:
isActivein 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 anullevent 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 aTLspEditHandleResultwithout any edit operations, and an unconsumedAWTEvent. An unconsumedAWTEventmeans that it should contain the original, unmodifiedaEventparameter 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,
onActivateis called. - Processing: If a handle is active, the handle checks if it can process an event. If so,
processis 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,
onDeactivateis called, and the handle becomes inactive (isActivereturnsfalse).
- Specified by:
handleAWTEventin 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:
handleFXEventin 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 (aftercanActivatehas 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,isActivewill returntrueandonActivateis called next.- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should be activated as a result of the given event,falseotherwise- See Also:
-
canActivate
JavaFX equivalent ofcanActivate(AWTEvent, TLspEditContext).- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should be activated as a result of the given event,falseotherwise- Since:
- 2020.0
-
canDeactivate
Checks whether the handle can be deactivated. If this method returnstrue,isActivewill returnfalseandonDeactivateis called next.- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should be deactivated as a result of the given event,falseotherwise- See Also:
-
canDeactivate
JavaFX equivalent ofcanDeactivate(AWTEvent, TLspEditContext).- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should be deactivated as a result of the given event,falseotherwise- Since:
- 2020.0
-
canProcess
Checks whether the given event should be processed. If this method returnstrue,processis called next.- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should process this event,falseotherwise.- See Also:
-
canProcess
JavaFX equivalent ofcanProcess(AWTEvent, TLspEditContext).- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should process this event,falseotherwise.- Since:
- 2020.0
-