Class TLspPointTranslationHandle
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.TLspPointTranslationHandle
Base implementation of a handle that allows a point to be moved/dragged around.
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 produces move operations objects where the result
is set to the model coordinates of the position where the handle was dragged.
This handle can be used for all kinds of purposes, like moving the point of a
point list, moving
a control point of an arc, or
changing the height of an extruded shape.- 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
ConstructorsConstructorDescriptionTLspPointTranslationHandle(Object aDomainObject, ILcdPoint aPoint, ILcdModelReference aPointReference) Constructs a point handle for the given editor that can be dragged or moved around with the mouse. -
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 TLspEditHandleResultcreateEditHandleResult(ILcdPoint aViewPoint, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) Creates a new edit handle result for the given view point.protected TLspEditHandleResultFXcreateEditHandleResultFX(ILcdPoint aViewPoint, Event aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) JavaFX equivalent ofcreateEditHandleResult(ILcdPoint, AWTEvent, ELspInteractionStatus, TLspEditContext).getPoint()Returns the point that is set using this handle.Returns the reference in which the handle point is defined.Returns a style target provider that can generate geometry for the given visual editing component type, or an empty list if no geometry can be generated for the given type.protected booleanSpecifies if the terrain height is included when transforming the handle's model point to world coordinates.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).protected TLspEditHandleResultprocess(AWTEvent aEvent, TLspEditContext aEditContext) Process the given event.protected TLspEditHandleResultFXprocess(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofprocess(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, isActiveMethods 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, setCursor, setCursorFX, setPriority
-
Constructor Details
-
TLspPointTranslationHandle
public TLspPointTranslationHandle(Object aDomainObject, ILcdPoint aPoint, ILcdModelReference aPointReference) Constructs a point handle for the given editor that can be dragged or moved around with the mouse.- Parameters:
aDomainObject- the domain object to be editedaPoint- the point associated with this handle. This point is always re-evaluated, so changing this point internally also modifies this handle. This makes it easy to tie this handle to a point in a pointlist for example.aPointReference- the reference of the given point, ornullif this point is interpreted in view coordinates.
-
-
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 on the firstMOUSE_PRESSEDevent, translated on subsequentMOUSE_DRAGGEDevents, and deactivated after receiving aMOUSE_RELEASEDevent. Iffalse, this handle is is activated after an initial chain ofMOUSE_PRESSEDandMOUSE_RELEASEDevents (i.e. a first mouse click), translated on all subsequentMOUSE_MOVEDevents, and deactivated on a second chain ofMOUSE_PRESSEDandMOUSE_RELEASEDevents. (i.e. a second click). 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.
-
getPoint
Returns the point that is set using this handle. This point is always re-evaluated, so changing this point internally also modifies this handle. This makes it easy to tie this handle to a point in a pointlist for example.- Returns:
- the point that is set using this handle.
-
getPointReference
Returns the reference in which the handle point is defined.- Returns:
- the reference in which the handle point is defined
-
isMoveOnTerrain
protected boolean isMoveOnTerrain()Specifies if the terrain height is included when transforming the handle's model point to world coordinates. If so, the handle will follow the terrain. By default, this method returnstrue.- Returns:
trueif this handle uses the view's height provider to add terrain height to the transformed model point,falseotherwise
-
createEditHandleResult
protected TLspEditHandleResult createEditHandleResult(ILcdPoint aViewPoint, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) Creates a new edit handle result for the given view point. By default this method will create a move descriptor containing the given X and Y coordinates, transformed to the point reference of this handle. Ornull, if the given coordinates could not be transformed. By default, this method uses anXY Constraint.- Parameters:
aViewPoint- the view point from the event which triggered the call to this method.aProcessedEvent- the processed event.aInteractionStatus- the interaction status.aEditContext- the edit context.- Returns:
- an edit handle result.
-
createEditHandleResultFX
protected TLspEditHandleResultFX createEditHandleResultFX(ILcdPoint aViewPoint, Event aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) JavaFX equivalent ofcreateEditHandleResult(ILcdPoint, AWTEvent, ELspInteractionStatus, TLspEditContext).- Since:
- 2020.0
-
getStyleTargetProviders
Returns a style target provider that can generate geometry for the given visual editing component type, or an empty list if no geometry can be generated for the given type.TLspEditHandleStylerallows you to register different styles for each visual component type. By default, this method returns a style target provider that returns the point associated with this handle if the given type is aPOINTtype. Otherwise and empty list is returned.- Specified by:
getStyleTargetProvidersin classALspHandle- Parameters:
aType- avisual editing component type- Returns:
- a list of style target providers, or an empty list if no style targets can be created for the given
visual editing component type
-
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.trueis this handle is active or if the given event points to a location near this handle.- 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
-
onActivate
Called when this handle is activated (aftercanActivatehas returnedtrue. By default this method generates a edit handle result containing no operations, with the interaction statusIN_PROGRESS.- 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 generates a edit handle result containingMOVEoperation, or no operations, depending on location the given AWT event points to. The interaction status is set toFINISHED.- 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
-
process
Process the given event. This method is only called when the handle is active and processing is requested. By default this method generates a edit handle result containingMOVEoperation. The interaction status is set toIN_PROGRESS.- Specified by:
processin classALsp3StepEditHandle- 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).- Overrides:
processin classALsp3StepEditHandle- 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. By default, this method returnstrueon a mouse press or mouse click (depending on the translation mode) that happened within the view distance threshold set.- 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 returnstrueif a mouse release or click happened (depending on the translation mode set).- 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 or move happened (depending on the translation mode set).- 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
-