public class TLspPointSetHandle extends ALspEditHandle
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.PRIORITY_2D_CONTOUR, PRIORITY_2D_POINT, PRIORITY_2D_SHAPE, PRIORITY_3D_CONTOUR, PRIORITY_3D_POINT, PRIORITY_3D_SHAPE, PRIORITY_MULTIPLE_SHAPES
Constructor and Description |
---|
TLspPointSetHandle(Object aGeometry,
ILcdPoint aPoint,
ILcdModelReference aPointReference)
Creates a new handle for the given geometry
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected TLspEditHandleResult |
createEditHandleResult(ILcdPoint aViewPoint,
AWTEvent aProcessedEvent,
ELspInteractionStatus aInteractionStatus,
TLspEditContext aEditContext)
Deprecated.
This method has been deprecated in favor of
createEditHandleResult , which performs the same work but offers additional context information on the original event used
to generate the view point. |
protected TLspEditHandleResultFX |
createEditHandleResultFX(ILcdPoint aViewPoint,
javafx.event.Event aOriginalEvent,
javafx.event.Event aProcessedEvent,
ELspInteractionStatus aInteractionStatus,
TLspEditContext aEditContext)
|
ILcdPoint |
getPoint()
Returns the point that is set using this handle.
|
ILcdModelReference |
getPointReference()
Returns the reference in which the handle point is defined.
|
List<ALspStyleTargetProvider> |
getStyleTargetProviders(TLspHandleGeometryType aType)
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.
|
TLspEditHandleResult |
handleAWTEvent(AWTEvent aEvent,
TLspEditContext aEditContext)
Handle the given input event for the given edit context.
|
TLspEditHandleResultFX |
handleFXEvent(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
handleAWTEvent(AWTEvent, TLspEditContext) . |
boolean |
isActive()
Checks whether this handle is active.
|
getGeometry, requestsFocus, requestsFocus
getCursor, getCursorFX, getPriority, getProperties, setCursor, setCursorFX, setPriority
public TLspPointSetHandle(Object aGeometry, ILcdPoint aPoint, ILcdModelReference aPointReference)
aGeometry
- the geometry that is edited by this handle. This value is not used directly
by this handle, other than in the ALspEditHandle.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, or null
if this point
is interpreted in view coordinates.public ILcdPoint getPoint()
public ILcdModelReference getPointReference()
protected TLspEditHandleResult createEditHandleResult(ILcdPoint aViewPoint, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext)
createEditHandleResult
, which performs the same work but offers additional context information on the original event used
to generate the view point.MOVE
with
move descriptor that
contains the given new point as the target point and null
as the start point.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.protected TLspEditHandleResult createEditHandleResult(ILcdPoint aViewPoint, AWTEvent aOriginalEvent, AWTEvent aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext)
MOVE
with
move descriptor that
contains the given new point as the target point and null
as the start point.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.protected TLspEditHandleResultFX createEditHandleResultFX(ILcdPoint aViewPoint, javafx.event.Event aOriginalEvent, javafx.event.Event aProcessedEvent, ELspInteractionStatus aInteractionStatus, TLspEditContext aEditContext)
createEditHandleResult(ILcdPoint, AWTEvent, AWTEvent, ELspInteractionStatus, TLspEditContext)
.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.public boolean isActive()
true
when constructed, and returns
false
after a MOUSE_RELEASED
event (UP
event
for touch).isActive
in class ALspHandle
public TLspEditHandleResult handleAWTEvent(AWTEvent aEvent, TLspEditContext aEditContext)
null
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 a TLspEditHandleResult
without any edit operations, and an unconsumed AWTEvent
. An unconsumed AWTEvent
means that it should contain the original, unmodified aEvent
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.
By default, this method returns a handle result without operations for
MOUSE_PRESSED
, MOUSE_DRAGGED
and MOUSE_CLICKED
events
(DOWN
and MOVED
events for touch). For MOUSE_RELEASED
events (of UP
events in case of touch), it returns a
MOVE
operation,
with the target point of the move descriptor set to the model
position where the mouse was dragged.handleAWTEvent
in class ALspEditHandle
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 handlednull
.ALspHandle.isActive()
public TLspEditHandleResultFX handleFXEvent(javafx.event.Event aEvent, TLspEditContext aEditContext)
handleAWTEvent(AWTEvent, TLspEditContext)
.handleFXEvent
in class ALspEditHandle
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 handlednull
.public List<ALspStyleTargetProvider> getStyleTargetProviders(TLspHandleGeometryType aType)
TLspEditHandleStyler
allows
you to register different styles for each visual component type.
By default, this method returns a style target provider for POINT
types, returning
the point associated with this handle.getStyleTargetProviders
in class ALspHandle
aType
- a visual editing component type
visual editing component type