Class TLspPointSetHandle
java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspEditHandle
com.luciad.view.lightspeed.editor.handle.TLspPointSetHandle
Base implementation of a handle that allows a point to be set with a single click. The handle will
set one single point and will deactivate itself after the mouse has been released, or the touch device
no longer registers the tracked finger.
When using mouse events, this handle consumes a series of
MOUSE_PRESSED,
MOUSE_DRAGGED, MOUSE_RELEASED and MOUSE_CLICKED
events.
When using touch events, this handle is consumes as series of DOWN, MOVED
and UP events.
This handle produces move operations where the target position is set to the model coordinates
of the position where the handle was dragged. The start position is set to null.
This handle is useful for creation. It can for example be used to place the first control point
of an arc.- 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
ConstructorsConstructorDescriptionTLspPointSetHandle(Object aGeometry, ILcdPoint aPoint, ILcdModelReference aPointReference) Creates a new handle for the given geometry -
Method Summary
Modifier and TypeMethodDescriptionprotected TLspEditHandleResultcreateEditHandleResult(ILcdPoint aViewPoint, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) Deprecated.protected TLspEditHandleResultcreateEditHandleResult(ILcdPoint aViewPoint, AWTEvent aOriginalEvent, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) This method is called when a new point has been calculated correctly.protected TLspEditHandleResultFXcreateEditHandleResultFX(ILcdPoint aViewPoint, Event aOriginalEvent, Event aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) 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.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).booleanisActive()Checks whether this handle is active.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, setCursor, setCursorFX, setPriority
-
Constructor Details
-
TLspPointSetHandle
Creates a new handle for the given geometry- Parameters:
aGeometry- the geometry that is edited by this handle. This value is not used directly by this handle, other than in theALspEditHandle.getGeometry()method. Null is an acceptable value.aPoint- 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
-
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
-
createEditHandleResult
protected TLspEditHandleResult createEditHandleResult(ILcdPoint aViewPoint, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) Deprecated.This method has been deprecated in favor ofcreateEditHandleResult, which performs the same work but offers additional context information on the original event used to generate the view point.This method is called when a new point has been calculated correctly. It can be overridden to customize the edit handle result. By default it creates a result of typeMOVEwith move descriptor that contains the given new point as the target point andnullas the start point.- Parameters:
aViewPoint- the view point from the event which triggered the call to this method.aProcessedEvent- the awt event that is the result of having handled the original awt event. This is null if the event was fully consumed, the original event if the event was not consumed, or a new AWTEvent containing a partially consumed state.aInteractionStatus- the interaction status.aEditContext- the edit context.- Returns:
- an edit handle result
-
createEditHandleResult
protected TLspEditHandleResult createEditHandleResult(ILcdPoint aViewPoint, AWTEvent aOriginalEvent, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) This method is called when a new point has been calculated correctly. It can be overridden to customize the edit handle result. By default it creates a result of typeMOVEwith move descriptor that contains the given new point as the target point andnullas the start point.- Parameters:
aViewPoint- the view point from the event which triggered the call to this method.aOriginalEvent- the original eventaProcessedEvent- the awt event that is the result of having handled the original awt event. This is null if the event was fully consumed, the original event if the event was not consumed, or a new AWTEvent containing a partially consumed state.aInteractionStatus- the interaction status.aEditContext- the edit context.- Returns:
- an edit handle result
-
createEditHandleResultFX
protected TLspEditHandleResultFX createEditHandleResultFX(ILcdPoint aViewPoint, Event aOriginalEvent, Event aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext) JavaFX equivalent ofcreateEditHandleResult(ILcdPoint, AWTEvent, AWTEvent, ELspInteractionStatus, TLspEditContext).- Parameters:
aViewPoint- the view point from the event which triggered the call to this method.aOriginalEvent- the original eventaProcessedEvent- the event that is the result of having handled the original event. This is null if the event was fully consumed, the original event if the event was not consumed, or a new Event containing a partially consumed state.aInteractionStatus- the interaction status.aEditContext- the edit context.- Returns:
- an edit handle result
- Since:
- 2020.0
-
isActive
public 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. By default, this method returnstruewhen constructed, and returnsfalseafter aMOUSE_RELEASEDevent (UPevent for touch).- 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. By default, this method returns a handle result without operations forMOUSE_PRESSED,MOUSE_DRAGGEDandMOUSE_CLICKEDevents (DOWNandMOVEDevents for touch). ForMOUSE_RELEASEDevents (ofUPevents in case of touch), it returns aMOVEoperation, with the target point of the move descriptor set to the model position where the mouse was dragged.- 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:
-
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
-
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 forPOINTtypes, returning the point associated with this handle.- 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
-
createEditHandleResult, which performs the same work but offers additional context information on the original event used to generate the view point.