public class MoveInputMode extends Object implements IInputMode
IInputMode
implementation that can be used to move something in the canvas using the mouse.
This implementation uses the HitTestable
to determine where the user can begin dragging the
selection. It will then use the PositionHandler
to delegate the actual work of moving the
elements to.
This mode is Exclusive
by default.
Constructor and Description |
---|
MoveInputMode()
Initializes a new instance of the
MoveInputMode class. |
Modifier and Type | Method and Description |
---|---|
void |
addDragCanceledListener(IEventHandler<InputModeEventArgs> dragCanceledEvent)
Adds the given listener for the
DragCanceled event that occurs when the drag has been canceled. |
void |
addDragCancelingListener(IEventHandler<InputModeEventArgs> dragCancelingEvent)
Adds the given listener for the
DragCanceling event that occurs before the drag will be canceled. |
void |
addDragFinishedListener(IEventHandler<InputModeEventArgs> dragFinishedEvent)
Adds the given listener for the
DragFinished event that occurs once the drag has been finished. |
void |
addDragFinishingListener(IEventHandler<InputModeEventArgs> dragFinishingEvent)
Adds the given listener for the
DragFinishing event that occurs before the drag will be finished. |
void |
addDraggedListener(IEventHandler<InputModeEventArgs> draggedEvent)
Adds the given listener for the
Dragged event that occurs at the end of every drag. |
void |
addDraggingListener(IEventHandler<InputModeEventArgs> draggingEvent)
Adds the given listener for the
Dragging event that occurs at the start of every drag. |
void |
addDragStartedListener(IEventHandler<InputModeEventArgs> dragStartedEvent)
Adds the given listener for the
DragStarted event that occurs once the drag is initialized and has started. |
void |
addDragStartingListener(IEventHandler<InputModeEventArgs> dragStartingEvent)
Adds the given listener for the
DragStarting event that occurs once the drag is starting. |
void |
addQueryPositionHandlerListener(IEventHandler<QueryPositionHandlerEventArgs> queryPositionHandlerEvent)
Adds the given listener for the
QueryPositionHandler event that occurs when a drag is recognized for the
MoveInputMode . |
protected void |
arm()
Callback that is called when this mode is "armed".
|
void |
cancel()
Cancels the editing of this mode.
|
protected IInputModeContext |
createPositionHandlerInputModeContext()
Creates an
IInputModeContext for use with the IPositionHandler interface for the upcoming drag
operation. |
protected void |
disarm()
Callback that is called when this mode is "disarmed".
|
void |
doStartDrag(PointD location)
Simulates the start of a drag and puts the state machine into the dragging state.
|
IEnumerable<IModelItem> |
getAffectedItems()
Gets an immutable snapshot of the
IModelItem s affected by the currently active gesture. |
IEventRecognizer |
getCancelRecognizer()
Gets the "cancel" recognizer.
|
protected ConcurrencyController |
getController()
Returns the installed
Controller . |
IEventRecognizer |
getDisableSnappingRecognizer()
Gets event recognizer that recognizes when the user temporarily disables snapping.
|
IEventRecognizer |
getDraggedRecognizer()
Gets the "dragged" recognizer.
|
IEventRecognizer |
getDraggedRecognizerTouch()
Gets the "dragged" recognizer for touch events.
|
IEventRecognizer |
getEnableSnappingRecognizer()
Gets event recognizer that recognizes when the user reenables temporarily disabled snapping.
|
IHitTestable |
getHitTestable()
Gets the
IHitTestable that will be used by this mode to determine where the user may start dragging. |
IEventRecognizer |
getHoverRecognizer()
Gets the "hovering" state recognizer.
|
PointD |
getInitialLocation()
Returns the initial position where the dragging was initiated.
|
IInputModeContext |
getInputModeContext()
Returns the context instance this mode is currently installed in or
null if this instance is not installed. |
Cursor |
getMoveCursor()
Gets the cursor to use during the move.
|
IPositionHandler |
getPositionHandler()
Gets the
IPositionHandler that will be used as fallback to handle that actual movement of the elements during
the drag. |
IEventRecognizer |
getPressedRecognizer()
Gets the "pressed" state recognizer.
|
IEventRecognizer |
getPressedRecognizerTouch()
Gets the "pressed" recognizer for touch events.
|
int |
getPriority()
The priority of this input mode.
|
IEventRecognizer |
getReleasedRecognizer()
Gets the "released" recognizer.
|
IEventRecognizer |
getReleasedRecognizerTouch()
Gets the "released" recognizer for touch events.
|
SnapContext |
getSnapContext()
The
SnapContext which manages snapping model items to certain coordinates (for instance, other
items). |
void |
install(IInputModeContext context,
ConcurrencyController controller)
Installs this mode into the given context that is provided by the canvas.
|
boolean |
isDragging()
Gets a value indicating whether a drag operation is currently in progress.
|
boolean |
isEnabled()
Gets the enabled state of this input mode.
|
boolean |
isExclusive()
Gets a value indicating whether this mode will be the only one running when it has the mutex.
|
protected boolean |
isValidStartLocation(PointD location)
Determines whether the given location is a valid start location for the move gesture.
|
protected void |
onCanceled()
Called after
cancel() has been called. |
protected void |
onConcurrencyControllerActivated()
|
protected void |
onConcurrencyControllerDeactivated()
|
protected void |
onDragCanceled(InputModeEventArgs inputModeEventArgs)
Triggers the
DragCanceled event. |
protected void |
onDragCanceling(InputModeEventArgs inputModeEventArgs)
Triggers the
DragCanceling event. |
protected void |
onDragFinished(InputModeEventArgs inputModeEventArgs)
Callback triggered once the drag has been finalized.
|
protected void |
onDragFinishing(InputModeEventArgs inputModeEventArgs)
Callback triggered before the drag will be finalized.
|
protected void |
onDragged(InputModeEventArgs inputModeEventArgs)
Callback triggered at the end of each drag.
|
protected void |
onDragging(InputModeEventArgs inputModeEventArgs)
Callback triggered at the start of each drag.
|
protected void |
onDragStarted(InputModeEventArgs inputModeEventArgs)
Triggers the
DragStarted event. |
protected void |
onDragStarting(InputModeEventArgs inputModeEventArgs)
Triggers the
DragStarting event. |
protected void |
onQueryPositionHandler(QueryPositionHandlerEventArgs args)
Raises the
QueryPositionHandler event. |
protected void |
onStopped()
Called after
stop() has been called. |
void |
removeDragCanceledListener(IEventHandler<InputModeEventArgs> dragCanceledEvent)
Removes the given listener for the
DragCanceled event that occurs when the drag has been canceled. |
void |
removeDragCancelingListener(IEventHandler<InputModeEventArgs> dragCancelingEvent)
Removes the given listener for the
DragCanceling event that occurs before the drag will be canceled. |
void |
removeDragFinishedListener(IEventHandler<InputModeEventArgs> dragFinishedEvent)
Removes the given listener for the
DragFinished event that occurs once the drag has been finished. |
void |
removeDragFinishingListener(IEventHandler<InputModeEventArgs> dragFinishingEvent)
Removes the given listener for the
DragFinishing event that occurs before the drag will be finished. |
void |
removeDraggedListener(IEventHandler<InputModeEventArgs> draggedEvent)
Removes the given listener for the
Dragged event that occurs at the end of every drag. |
void |
removeDraggingListener(IEventHandler<InputModeEventArgs> draggingEvent)
Removes the given listener for the
Dragging event that occurs at the start of every drag. |
void |
removeDragStartedListener(IEventHandler<InputModeEventArgs> dragStartedEvent)
Removes the given listener for the
DragStarted event that occurs once the drag is initialized and has started. |
void |
removeDragStartingListener(IEventHandler<InputModeEventArgs> dragStartingEvent)
Removes the given listener for the
DragStarting event that occurs once the drag is starting. |
void |
removeQueryPositionHandlerListener(IEventHandler<QueryPositionHandlerEventArgs> queryPositionHandlerEvent)
Removes the given listener for the
QueryPositionHandler event that occurs when a drag is recognized for the
MoveInputMode . |
void |
setCancelRecognizer(IEventRecognizer value)
Sets the "cancel" recognizer.
|
void |
setDisableSnappingRecognizer(IEventRecognizer value)
Sets event recognizer that recognizes when the user temporarily disables snapping.
|
void |
setDraggedRecognizer(IEventRecognizer value)
Sets the "dragged" recognizer.
|
void |
setDraggedRecognizerTouch(IEventRecognizer value)
Sets the "dragged" recognizer for touch events.
|
void |
setEnabled(boolean value)
Sets the enabled state of this input mode.
|
void |
setEnableSnappingRecognizer(IEventRecognizer value)
Sets event recognizer that recognizes when the user reenables temporarily disabled snapping.
|
void |
setExclusive(boolean value)
Sets a value indicating whether this mode will be the only one running when it has the mutex.
|
void |
setHitTestable(IHitTestable value)
Sets the
IHitTestable that will be used by this mode to determine where the user may start dragging. |
void |
setHoverRecognizer(IEventRecognizer value)
Sets the "hovering" state recognizer.
|
void |
setMoveCursor(Cursor value)
Sets the cursor to use during the move.
|
void |
setPositionHandler(IPositionHandler value)
Sets the
IPositionHandler that will be used as fallback to handle that actual movement of the elements during
the drag. |
void |
setPressedRecognizer(IEventRecognizer value)
Sets the "pressed" state recognizer.
|
void |
setPressedRecognizerTouch(IEventRecognizer value)
Sets the "pressed" recognizer for touch events.
|
void |
setPriority(int value)
The priority of this input mode.
|
void |
setReleasedRecognizer(IEventRecognizer value)
Sets the "released" recognizer.
|
void |
setReleasedRecognizerTouch(IEventRecognizer value)
Sets the "released" recognizer for touch events.
|
void |
setSnapContext(SnapContext value)
The
SnapContext which manages snapping model items to certain coordinates (for instance, other
items). |
boolean |
stop()
Called by the client in order to stop a current editing progress.
|
void |
uninstall(IInputModeContext context)
Uninstalls this mode from the given context.
|
public MoveInputMode()
MoveInputMode
class.public final void addDragCanceledListener(IEventHandler<InputModeEventArgs> dragCanceledEvent)
DragCanceled
event that occurs when the drag has been canceled.dragCanceledEvent
- The listener to add.removeDragCanceledListener(IEventHandler)
public final void addDragCancelingListener(IEventHandler<InputModeEventArgs> dragCancelingEvent)
DragCanceling
event that occurs before the drag will be canceled.dragCancelingEvent
- The listener to add.removeDragCancelingListener(IEventHandler)
public final void addDragFinishedListener(IEventHandler<InputModeEventArgs> dragFinishedEvent)
DragFinished
event that occurs once the drag has been finished.dragFinishedEvent
- The listener to add.removeDragFinishedListener(IEventHandler)
public final void addDragFinishingListener(IEventHandler<InputModeEventArgs> dragFinishingEvent)
DragFinishing
event that occurs before the drag will be finished.dragFinishingEvent
- The listener to add.removeDragFinishingListener(IEventHandler)
public final void addDraggedListener(IEventHandler<InputModeEventArgs> draggedEvent)
Dragged
event that occurs at the end of every drag.draggedEvent
- The listener to add.removeDraggedListener(IEventHandler)
public final void addDraggingListener(IEventHandler<InputModeEventArgs> draggingEvent)
Dragging
event that occurs at the start of every drag.draggingEvent
- The listener to add.removeDraggingListener(IEventHandler)
public final void addDragStartedListener(IEventHandler<InputModeEventArgs> dragStartedEvent)
DragStarted
event that occurs once the drag is initialized and has started.dragStartedEvent
- The listener to add.removeDragStartedListener(IEventHandler)
public final void addDragStartingListener(IEventHandler<InputModeEventArgs> dragStartingEvent)
DragStarting
event that occurs once the drag is starting.dragStartingEvent
- The listener to add.removeDragStartingListener(IEventHandler)
public final void addQueryPositionHandlerListener(IEventHandler<QueryPositionHandlerEventArgs> queryPositionHandlerEvent)
QueryPositionHandler
event that occurs when a drag is recognized for the
MoveInputMode
.
If the event args are Handled
, the IPositionHandler
that is
carried with the event args is used to actually move the items. Otherwise the pre-set PositionHandler
property is used.
queryPositionHandlerEvent
- The listener to add.removeQueryPositionHandlerListener(IEventHandler)
protected void arm()
This happens when the mouse hovers
over the item(s) to move. This implementation sets the
mouse cursor to MoveCursor
.
public void cancel()
This implementation releases
the mutex if it is currently owned by this
instance and calls onCanceled()
.
cancel
in interface IInputMode
onCanceled()
protected IInputModeContext createPositionHandlerInputModeContext()
IInputModeContext
for use with the IPositionHandler
interface for the upcoming drag
operation.IInputModeContext
.protected void disarm()
This happens when the mouse stops hovering over the item(s). This implementation resets the mouse cursor again.
public void doStartDrag(PointD location)
Subsequent moves of input devices will behave as if the dragging has been successfully initiated at location
.
location
- The location where the drag had been initialized.public final IEnumerable<IModelItem> getAffectedItems()
IModelItem
s affected by the currently active
gesture.
When the gesture is starting
and the PositionHandler
is initialized
, the implementation
can register
the affected item(s) through the IModelItemCollector
instance that is bound to the context
available via its
ILookup.lookup(Class)
.
Client code can register with the DragStarted
event, as well as the DragFinished
event to get notified of the elements that may be or have been affected respectively by this input mode.
public final IEventRecognizer getCancelRecognizer()
This recognizer recognizes a cancel action during the move.
setCancelRecognizer(IEventRecognizer)
protected final ConcurrencyController getController()
Controller
.public final IEventRecognizer getDisableSnappingRecognizer()
IEventRecognizer.SHORTCUT_DOWN
getEnableSnappingRecognizer()
,
setDisableSnappingRecognizer(IEventRecognizer)
public final IEventRecognizer getDraggedRecognizer()
This recognizer instance determines when the user is moving the selection
setDraggedRecognizer(IEventRecognizer)
public final IEventRecognizer getDraggedRecognizerTouch()
This recognizer instance determines when the user is moving the selection
setDraggedRecognizerTouch(IEventRecognizer)
public final IEventRecognizer getEnableSnappingRecognizer()
IEventRecognizer.SHORTCUT_UP
setEnableSnappingRecognizer(IEventRecognizer)
public final IHitTestable getHitTestable()
IHitTestable
that will be used by this mode to determine where the user may start dragging.setHitTestable(IHitTestable)
public final IEventRecognizer getHoverRecognizer()
This recognizer instance will be used to determine whether the user is hovering over an item where pressing can
initialize a move operation. The default implementation uses the isValidStartLocation(PointD)
method to
determine whether the mode can be initialized, here.
setHoverRecognizer(IEventRecognizer)
public final PointD getInitialLocation()
public final IInputModeContext getInputModeContext()
IInputMode
null
if this instance is not installed.
Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context
that has this instance set as the ParentInputMode
should be used.
getInputModeContext
in interface IInputMode
public final Cursor getMoveCursor()
setMoveCursor(Cursor)
public final IPositionHandler getPositionHandler()
IPositionHandler
that will be used as fallback to handle that actual movement of the elements during
the drag.
Note that the IPositionHandler
retrieved by the QueryPositionHandler
event has priority before this property. Only if the event is not Handled
this property is used.
setPositionHandler(IPositionHandler)
public final IEventRecognizer getPressedRecognizer()
This recognizer instance will be used to determine when the user begins to move the selection.
setPressedRecognizer(IEventRecognizer)
public final IEventRecognizer getPressedRecognizerTouch()
This recognizer instance determines when the user begins the move selection operation.
setPressedRecognizerTouch(IEventRecognizer)
public final int getPriority()
IInputMode
The priority will influence the order in which the modes will be installed
into the canvas control. The lower the priority value, the earlier it will be installed. If two modes are installed
using the same priority value, the first one will be installed earlier.
getPriority
in interface IInputMode
public final IEventRecognizer getReleasedRecognizer()
This instance determines when the user has finished the move.
setReleasedRecognizer(IEventRecognizer)
public final IEventRecognizer getReleasedRecognizerTouch()
This instance determines when the user has finished the move using touch.
setReleasedRecognizerTouch(IEventRecognizer)
public final SnapContext getSnapContext()
SnapContext
which manages snapping model items to certain coordinates (for instance, other
items).
If set to null
(the default) this input mode tries to obtain the SnapContext
from the
IInputModeContext
. To explicitly disable snapping, a SnapContext
implementation
that does nothing has to be set to this instance.
setSnapContext(SnapContext)
public void install(IInputModeContext context, ConcurrencyController controller)
In general a mode can only be installed into a single canvas at all times.
This method is called to initialize this instance. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.
Overriding implementations should call the base implementation, first.
install
in interface IInputMode
context
- The context that this instance shall be installed into. The same instance will be passed to this instance during
IInputMode.uninstall(IInputModeContext)
. A reference to the context may be kept and queried during the time
the mode is installed.controller
- The Controller
for this mode.IInputMode.uninstall(IInputModeContext)
public final boolean isDragging()
public boolean isEnabled()
Clients can use this property to disable or reenable this instance. This will set the Enabled
property of the installed Controller
so a disabled instance should never try to acquire the
input mutex.
setEnabled(boolean)
public final boolean isExclusive()
The value of this property will be delegated to the Exclusive
property of
the Controller
.
If this mode is marked as exclusive and has the mutex, all other modes added
to the same MultiplexingInputMode
will be deactivated. Otherwise it will always run
concurrently with all other modes.
setExclusive(boolean)
protected boolean isValidStartLocation(PointD location)
This implementation delegates to the HitTestable
. During this callback it is possible to reset
or reconfigure the PositionHandler
.
location
- The location in the world coordinate system.true
if at the given location it is valid to start the move gesture; otherwise, false
.protected void onCanceled()
cancel()
has been called.
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation does nothing.
protected void onConcurrencyControllerActivated()
Active
property of the installed ConcurrencyController
has been set to true
.
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
protected void onConcurrencyControllerDeactivated()
Active
property of the installed ConcurrencyController
has been set to false
.
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
protected void onDragCanceled(InputModeEventArgs inputModeEventArgs)
DragCanceled
event.inputModeEventArgs
- The event argument that contains context information.protected void onDragCanceling(InputModeEventArgs inputModeEventArgs)
DragCanceling
event.inputModeEventArgs
- The event argument that contains context information.protected void onDragFinished(InputModeEventArgs inputModeEventArgs)
This method triggers the DragFinished
event.
inputModeEventArgs
- The event argument that contains context information.protected void onDragFinishing(InputModeEventArgs inputModeEventArgs)
This method triggers the DragFinishing
event.
inputModeEventArgs
- The event argument that contains context information.protected void onDragged(InputModeEventArgs inputModeEventArgs)
This method triggers the Dragged
event.
inputModeEventArgs
- The event argument that contains context information.protected void onDragging(InputModeEventArgs inputModeEventArgs)
This method triggers the Dragging
event.
inputModeEventArgs
- The event argument that contains context information.protected void onDragStarted(InputModeEventArgs inputModeEventArgs)
DragStarted
event.inputModeEventArgs
- The event argument that contains context information.protected void onDragStarting(InputModeEventArgs inputModeEventArgs)
DragStarting
event.inputModeEventArgs
- The event argument that contains context information.protected void onQueryPositionHandler(QueryPositionHandlerEventArgs args)
QueryPositionHandler
event.args
- The QueryPositionHandlerEventArgs
instance containing the event data.protected void onStopped()
stop()
has been called.
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
public final void removeDragCanceledListener(IEventHandler<InputModeEventArgs> dragCanceledEvent)
DragCanceled
event that occurs when the drag has been canceled.dragCanceledEvent
- The listener to remove.addDragCanceledListener(IEventHandler)
public final void removeDragCancelingListener(IEventHandler<InputModeEventArgs> dragCancelingEvent)
DragCanceling
event that occurs before the drag will be canceled.dragCancelingEvent
- The listener to remove.addDragCancelingListener(IEventHandler)
public final void removeDragFinishedListener(IEventHandler<InputModeEventArgs> dragFinishedEvent)
DragFinished
event that occurs once the drag has been finished.dragFinishedEvent
- The listener to remove.addDragFinishedListener(IEventHandler)
public final void removeDragFinishingListener(IEventHandler<InputModeEventArgs> dragFinishingEvent)
DragFinishing
event that occurs before the drag will be finished.dragFinishingEvent
- The listener to remove.addDragFinishingListener(IEventHandler)
public final void removeDraggedListener(IEventHandler<InputModeEventArgs> draggedEvent)
Dragged
event that occurs at the end of every drag.draggedEvent
- The listener to remove.addDraggedListener(IEventHandler)
public final void removeDraggingListener(IEventHandler<InputModeEventArgs> draggingEvent)
Dragging
event that occurs at the start of every drag.draggingEvent
- The listener to remove.addDraggingListener(IEventHandler)
public final void removeDragStartedListener(IEventHandler<InputModeEventArgs> dragStartedEvent)
DragStarted
event that occurs once the drag is initialized and has started.dragStartedEvent
- The listener to remove.addDragStartedListener(IEventHandler)
public final void removeDragStartingListener(IEventHandler<InputModeEventArgs> dragStartingEvent)
DragStarting
event that occurs once the drag is starting.dragStartingEvent
- The listener to remove.addDragStartingListener(IEventHandler)
public final void removeQueryPositionHandlerListener(IEventHandler<QueryPositionHandlerEventArgs> queryPositionHandlerEvent)
QueryPositionHandler
event that occurs when a drag is recognized for the
MoveInputMode
.
If the event args are Handled
, the IPositionHandler
that is
carried with the event args is used to actually move the items. Otherwise the pre-set PositionHandler
property is used.
queryPositionHandlerEvent
- The listener to remove.addQueryPositionHandlerListener(IEventHandler)
public final void setCancelRecognizer(IEventRecognizer value)
This recognizer recognizes a cancel action during the move.
value
- The "cancel" recognizer.getCancelRecognizer()
public final void setDisableSnappingRecognizer(IEventRecognizer value)
value
- The instance to use for disabling snapping. The default is IEventRecognizer.SHORTCUT_DOWN
getEnableSnappingRecognizer()
,
getDisableSnappingRecognizer()
public final void setDraggedRecognizer(IEventRecognizer value)
This recognizer instance determines when the user is moving the selection
value
- The "dragged" recognizer.getDraggedRecognizer()
public final void setDraggedRecognizerTouch(IEventRecognizer value)
This recognizer instance determines when the user is moving the selection
value
- The "dragged" recognizer specifically for touch events.getDraggedRecognizerTouch()
public void setEnabled(boolean value)
Clients can use this property to disable or reenable this instance. This will set the Enabled
property of the installed Controller
so a disabled instance should never try to acquire the
input mutex.
value
- The Enabled to set.isEnabled()
public final void setEnableSnappingRecognizer(IEventRecognizer value)
value
- The instance to use for reenabling snapping. The default is IEventRecognizer.SHORTCUT_UP
getEnableSnappingRecognizer()
public final void setExclusive(boolean value)
The value of this property will be delegated to the Exclusive
property of
the Controller
.
If this mode is marked as exclusive and has the mutex, all other modes added
to the same MultiplexingInputMode
will be deactivated. Otherwise it will always run
concurrently with all other modes.
value
- The Exclusive to set.isExclusive()
public final void setHitTestable(IHitTestable value)
IHitTestable
that will be used by this mode to determine where the user may start dragging.value
- The HitTestable to set.getHitTestable()
public final void setHoverRecognizer(IEventRecognizer value)
This recognizer instance will be used to determine whether the user is hovering over an item where pressing can
initialize a move operation. The default implementation uses the isValidStartLocation(PointD)
method to
determine whether the mode can be initialized, here.
value
- The "hover" recognizer.getHoverRecognizer()
public final void setMoveCursor(Cursor value)
value
- The MoveCursor to set.getMoveCursor()
public final void setPositionHandler(IPositionHandler value)
IPositionHandler
that will be used as fallback to handle that actual movement of the elements during
the drag.
Note that the IPositionHandler
retrieved by the QueryPositionHandler
event has priority before this property. Only if the event is not Handled
this property is used.
value
- The PositionHandler to set.getPositionHandler()
public final void setPressedRecognizer(IEventRecognizer value)
This recognizer instance will be used to determine when the user begins to move the selection.
value
- The "pressed" recognizer.getPressedRecognizer()
public final void setPressedRecognizerTouch(IEventRecognizer value)
This recognizer instance determines when the user begins the move selection operation.
value
- The "pressed" recognizer specifically for touch events.getPressedRecognizerTouch()
public final void setPriority(int value)
The priority will influence the order in which the modes will be installed
into the canvas control. The lower the priority value, the earlier it will be installed. If two modes are installed
using the same priority value, the first one will be installed earlier.
value
- The Priority to set.getPriority()
public final void setReleasedRecognizer(IEventRecognizer value)
This instance determines when the user has finished the move.
value
- The "released" recognizer.getReleasedRecognizer()
public final void setReleasedRecognizerTouch(IEventRecognizer value)
This instance determines when the user has finished the move using touch.
value
- The "released" recognizer specifically for touch events.getReleasedRecognizerTouch()
public final void setSnapContext(SnapContext value)
SnapContext
which manages snapping model items to certain coordinates (for instance, other
items).
If set to null
(the default) this input mode tries to obtain the SnapContext
from the
IInputModeContext
. To explicitly disable snapping, a SnapContext
implementation
that does nothing has to be set to this instance.
value
- The SnapContext to set.getSnapContext()
public boolean stop()
IInputMode
This should stop the current edit, if one is in progress and possibly commit all of the changes. If stopping is not
possible, this method can return false
stop
in interface IInputMode
true
if and only if the editing has been stopped or there was no edit in progressIInputMode.cancel()
public void uninstall(IInputModeContext context)
This code should clean up all changes made to the canvas in the IInputMode.install(IInputModeContext, ConcurrencyController)
method. After a mode has been uninstalled it can be installed again into the same or another canvas.
Overriding implementations should call the base implementation after their own code.
uninstall
in interface IInputMode
context
- The context to deregister from. This is the same instance that had been passed to IInputMode.install(IInputModeContext, ConcurrencyController)
during installation.