Objects that represents a (potential) drag.
Objects that represents a (potential) drag. When instantiated,
it installs itself on the parent component of firstEvent
and
automatically removes itself when the mouse is released.
A drag is only formally started once dragStarted
returns true
.
It will then update the drag state by calling repeatedly into
dragToParam
and dispatching appropriate events.
A drag can be aborted by pressing the Escape key.
The mouse cursor used when the tool is active.
The mouse cursor used when the tool is active.
The icon to use in a tool bar.
The icon to use in a tool bar.
The human readable name of the tool.
The human readable name of the tool.
Called after the end of a mouse drag gesture.
Called after the end of a mouse drag gesture. If this constitutes a valid edit, the method should return the resulting undoable edit.
the last editing state
the cursor that might be needed to construct the undoable edit
either Some
edit or None
if the action does not constitute an
edit or the edit parameters are invalid.
Determines if the drag operations should be started or not.
Determines if the drag operations should be started or not. The default behavior is to wait until the mouse is dragged by around four pixels. Sub-classes may override this, for example to have the drag start immediately without threshold.
true
if the parameter data signalize that a drag has started,
false
if it is not (yet) sufficient.
Applies standard mouse selection techniques regarding regions.
Applies standard mouse selection techniques regarding regions.
- If no modifier is hold, clicking outside of a region deselects all currently selected regions. - Clicking on an already selected region has no effect. - Clicking on a unselected region, will clear the selection and only select the new region. - Holding shift while clicking will add or remove regions to the list of selected regions.
Abstract method to be implemented by sub-classes.
Abstract method to be implemented by sub-classes. Called when the mouse is pressed
the event corresponding to the press
the model position corresponding to the vertical mouse coordinate.
the frame position corresponding to the horizontal mouse coordinate
Some
timeline object that is beneath the mouse
position or None
if the mouse is pressed over
an empty part of the timeline.
Implemented by adding mouse listeners to the component.
Implemented by adding mouse listeners to the component.
Implemented by removing listeners from component.
Implemented by removing listeners from component.
Most common implementation of a timeline tool, based on region selection and mouse dragging. It implements
handleSelect
by instantiating aDrag
object. Double-clicks result in the abstract methoddialog
being called. Sub-classes may choose to provide a custom dialog for double clicks by and thus may returnSome
data if the dialog is positively confirmed.