Gets or sets the name of this tool.
The default name is an empty string,
but the constructor for each instance of a subclass of Tool will initialize it appropriately.
For example, the name of the DragSelectingTool is "DragSelecting".
This predicate is used by the ToolManager to decide if this tool can be started mode-lessly
by mouse and touch events.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
Called by ToolManager#doMouseDown and ToolManager#doMouseMove,
this method determines whether or not to allow pinch zooming from a multi-touch event.
By default this predicate just returns true.
This method may be overridden.
Please read the Introduction page on Extensions for how to override methods and how to call this base method.
@expose
@return {boolean}
@see #standardPinchZoomStart
@see #standardPinchZoomMove
@since 1.5
The Diagram calls this method after setting Diagram#currentTool,
to make the new tool active.
This should set #isActive to true.
Overrides of this method might call #startTransaction,
if this tool's activity involves modification of the model.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
The diagram will call this method when the user wishes to cancel the
current tool's operation.
Typically this is called when the user hits the ESCAPE key.
This should restore the original state of what was modified by this tool, and then it should call #stopTool.
This method is not responsible for cleaning up any side-effects that should be performed
by #doDeactivate and/or #doStop, which will always be called whether the tool stops normally or abnormally.
The Diagram calls this method on the old tool when
Diagram#currentTool is set to a new tool.
This needs to set #isActive to false.
Overrides of this method might call #stopTransaction,
if this tool's activity involves modification of the model.
The diagram will call this method upon a key down event.
By default this just calls #doCancel if the key is the ESCAPE key.
Implementations of this method can look at Diagram#lastInput to get the key.
The diagram will call this method upon a mouse down event.
This is normally overridden for mouse-down tools;
it is not called for mouse-move or mouse-up tools.
However it may also be called when the tool is run in a modal fashion,
when code explicitly sets the diagram's Diagram#currentTool.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
The diagram will call this method upon a mouse move event.
This is normally overridden for mouse-move tools;
it is not called for mouse-up tools.
However it may also be called when the tool is run in a modal fashion,
when code explicitly sets the diagram's Diagram#currentTool.
An override of this method usually does nothing when #isActive is false.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
The diagram will call this method upon a mouse up event.
This is normally overridden for mouse-up tools.
An override of this method usually does nothing when #isActive is false,
except for calling #stopTool.
Tools normally stop upon a mouse up, by calling #stopTool.
If you want to handle multiple mouse down-up gestures in one tool activation,
you will need to override this method to only stop the tool when you want.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
The diagram will call this method as the mouse wheel is rotated.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
The Diagram calls this method when this tool becomes the current tool; you should not call this method.
Tool implementations should perform their per-use initialization here, such
as setting up internal data structures, or capturing the mouse.
Implementations of this method can look at Diagram#lastInput to get the mouse
event and input state.
The Diagram calls this method when this tool stops being the current tool; you should not call this method.
Tool implementations should perform their per-use cleanup here,
such as releasing mouse capture.
This is called a certain delay after a call to #standardWaitAfter if there
has not been any call to #cancelWaitAfter.
The ToolManager overrides this method in order to implement support for mouse-hover behavior and tooltips.
This convenience function finds the front-most GraphObject
that is at a given point and that is an element of an Adornment
that is of a given category.
The tool handle must be an immediate element of the Adornment,
not a GraphObject that is nested within Panels within the Adornment.
Return true when the last mouse point is far enough away from the first mouse down point
to constitute a drag operation instead of just a potential click.
Implement the standard behavior for mouse clicks,
searching for and calling click handler functions on GraphObjects
or on Diagram,
and raising the corresponding DiagramEvent.
Implement the standard behavior for mouse enter, over, and leave events,
where the mouse is moving but no button is pressed.
This should be called by mouse move event handlers when wanting to
detect and invoke mouse enter/over/leave event handlers.
This is called to start a new timer to call #doWaitAfter after a given delay.
It first cancels any previously running "WaitAfter" timer, by calling #cancelWaitAfter.
If the Diagram#currentTool is this tool,
stop this tool and start the Diagram#defaultTool
by making it be the new current tool.
The implementation of various tool methods can call this method to stop the current tool.
This will call #doStop -- you should not call that method directly.
The diagram asks each tool to update any adornments the tool might
use for a given part.
If the tool uses its own tool handles,
this should display them or hide them as appropriate.
Typically this should only show them if the part is selected.