Class ALspObjectTranslationHandle
java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspEditHandle
com.luciad.view.lightspeed.editor.handle.ALsp3StepEditHandle
com.luciad.view.lightspeed.editor.handle.ALspObjectTranslationHandle
- Direct Known Subclasses:
TLspObjectHeightTranslationHandle,TLspObjectTranslationHandle
Implementation of a handle that is activated when an object is touched. This handle is similar
to a
point drag handle, except that it works on objects instead
of points.
This handle has two translate modes: either by dragging the mouse, or by moving it in between
two clicks. See setTranslateOnDrag. When true,
the handle is activated/deactivated using mouse press and release events and changed using mouse
dragged events. Otherwise, the handle is activated/deactivated using mouse clicks and changed
by moving the mouse when active.
When using touch events, this handle is activated on DOWN events, processes
MOVED events, and is deactivated on UP events.
This handle can be used for all kinds of purposes, like moving a whole object, or adjusting the
height of an object.- 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
ConstructorsModifierConstructorDescriptionprotectedALspObjectTranslationHandle(Object aDomainObject) Creates a new touch handle for the given editor. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanActivate(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the handle can be activated.protected booleancanActivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanActivate(AWTEvent, TLspEditContext).protected booleancanDeactivate(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the handle can be deactivated.protected booleancanDeactivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanDeactivate(AWTEvent, TLspEditContext).protected booleancanProcess(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the given event should be processed.protected booleancanProcess(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcanProcess(AWTEvent, TLspEditContext).protected booleanisObjectTouched(int aX, int aY, TLspEditContext aEditContext) Returns whether the edited object is touched.booleanReturns if this handle is translated when dragging the mouse, or when moving it.protected 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 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).booleanrequestsFocus(AWTEvent aEvent, TLspEditContext aEditContext) Indicates whether this handle requests focus for the given event.booleanrequestsFocus(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofrequestsFocus(AWTEvent, TLspEditContext).voidsetTranslateOnDrag(boolean aIsTranslateOnDrag) Sets if this handle is translated when dragging the mouse, or when moving it.Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALsp3StepEditHandle
handleAWTEvent, handleFXEvent, isActive, process, processMethods inherited from class com.luciad.view.lightspeed.editor.handle.ALspEditHandle
getGeometryMethods inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
getCursor, getCursorFX, getPriority, getProperties, getStyleTargetProviders, setCursor, setCursorFX, setPriority
-
Constructor Details
-
ALspObjectTranslationHandle
Creates a new touch handle for the given editor.- Parameters:
aDomainObject- the object this handle was created for
-
-
Method Details
-
isTranslateOnDrag
public boolean isTranslateOnDrag()Returns if this handle is translated when dragging the mouse, or when moving it.- Returns:
- if this handle is translated when dragging the mouse, or when moving it.
- See Also:
-
setTranslateOnDrag
public void setTranslateOnDrag(boolean aIsTranslateOnDrag) Sets if this handle is translated when dragging the mouse, or when moving it. Iftrue, the handle is activated using aMOUSE_PRESSEDevent, translated using aMOUSE_DRAGGEDevent, and deactivated using aMOUSE_RELEASEDevent. Iffalse, this handle is activate using aMOUSE_RELEASEDevent, translated using aMOUSE_MOVEDevent, and deactivated using aMOUSE_RELEASEDevent. When using touch events, the only difference is that when this setting is set tofalse, this handle doesn't need aDOWNevent to be activated. This setting is typically set totrueduring editing, and tofalseduring creation. By default,isTranslateOnDragreturnstrue- Parameters:
aIsTranslateOnDrag- if this handle is translated when dragging the mouse, or when moving it.
-
isObjectTouched
Returns whether the edited object is touched. The default implementation queries the layer of the edited object using a touch query, using the paint representation specified at construction time.- Parameters:
aX- the x coordinate in the viewaY- the y coordinate in the viewaEditContext- the edit context- Returns:
trueif the object is touched
-
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
By default, this method returnstrueif 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.truewhen this handle is active, or if the edited object is touched.- Overrides:
requestsFocusin classALspEditHandle- 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:
trueif this handle requests focus for the given event,falseotherwise.- See Also:
-
requestsFocus
JavaFX equivalent ofrequestsFocus(AWTEvent, TLspEditContext).- Overrides:
requestsFocusin classALspEditHandle- 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:
trueif this handle requests focus for the given event,falseotherwise.- Since:
- 2020.0
-
canActivate
Checks whether the handle can be activated. If this method returnstrue,isActivewill returntrueandonActivateis called next. By default, this method returnstruewhen the input event is a mouse pressed/click event (depending on the translation mode, and when the object is touched as indicated byisObjectTouched.- Specified by:
canActivatein classALsp3StepEditHandle- 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).- Overrides:
canActivatein classALsp3StepEditHandle- 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. By default, this method returnstruewhen the input event is a mouse release/click event (depending on the translation mode).- Specified by:
canDeactivatein classALsp3StepEditHandle- 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).- Overrides:
canDeactivatein classALsp3StepEditHandle- 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. By default, this method returnstrueif a mouse drag/move happened (depending on the translation mode).- Specified by:
canProcessin classALsp3StepEditHandle- 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).- Overrides:
canProcessin classALsp3StepEditHandle- Parameters:
aEvent- the event that should be handledaEditContext- the edit context- Returns:
trueif the handle should process this event,falseotherwise.- Since:
- 2020.0
-
onActivate
Called when this handle is activated (aftercanActivatehas returnedtrue. By default, this method returns a edit handle result without operations and interaction statusIN_PROGRESS. Override this method to provide custom behavior. In that case, also make sure to call the super method.- Specified by:
onActivatein classALsp3StepEditHandle- 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).- Overrides:
onActivatein classALsp3StepEditHandle- 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. By default, this method returns a edit handle result without operations and interaction statusFINISHED. Override this method to provide custom behavior. In that case, also make sure to call the super method.- Specified by:
onDeactivatein classALsp3StepEditHandle- 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).- Overrides:
onDeactivatein classALsp3StepEditHandle- 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
-