The DragSelectingTool lets the user select multiple parts with a rectangular area. There is a temporary part, the #box, that shows the current area encompassed between the mouse-down point and the current mouse point. The default drag selection box is a magenta rectangle. You can change the #box to customize its appearance -- see its documentation for an example.
You do not normally need to create an instance of this tool because one already exists as the ToolManager#dragSelectingTool, which you can modify.
Gets or sets the Part used as the "rubber-band selection box" that is stretched to follow the mouse, as feedback for what area will be passed to #selectInRect upon a mouse-up.
Gets or sets the time in milliseconds for which the mouse must be stationary before this tool can be started.
Gets the Diagram that owns this tool and for which this tool is handling input events.
Gets or sets whether this tool is started and is actively doing something.
Gets or sets whether this tool can be started by a mouse event.
Gets or sets whether a selectable Part may be only partly or must be completely enclosed by the rectangle given to #selectInRect.
Gets or sets the name of this tool.
Gets or sets the name of the transaction to be committed by #stopTransaction; if null, the transaction will be rolled back.
This tool can run when the diagram allows selection, there has been delay of at least #delay milliseconds after the mouse-down before a mouse-move, there has been a mouse-drag far enough away not to be a click, and there is no selectable part at the mouse-down point.
boolean
This is called to cancel any running "WaitAfter" timer.
any
This just returns a Rect stretching from the mouse-down point to the current mouse point.
Capture the mouse and show the #box.
any
The diagram will call this method when the user wishes to cancel the current tool's operation.
any
Release the mouse and remove any #box.
any
The diagram will call this method upon a key down event.
any
The diagram will call this method upon a key up event.
any
The diagram will call this method upon a mouse down event.
any
Update the #box's position and size according to the value of #computeBoxBounds.
any
Call #selectInRect with the value of a call to #computeBoxBounds.
any
The diagram will call this method as the mouse wheel is rotated.
any
This method is called by the diagram when this tool becomes the current tool; you should not call this method.
any
This method is called by the diagram when this tool stops being the current tool; you should not call this method.
any
This is called a certain delay after a call to #standardWaitAfter if there has not been any call to #cancelWaitAfter.
any
This convenience function finds the front-most GraphObject that is at a given point and that is part of an Adornment that is of a given category.
a Point in document coordinates.
the required Part#category of 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.
Point in view coordinates, defaults to Diagram#firstInput's InputEvent#viewPoint.
Point in view coordinates, defaults to Diagram#lastInput's InputEvent#viewPoint.
boolean
This method is called to select some parts within the area of a given rectangle.
any
Implement the standard behavior for mouse clicks, searching for and calling click handler functions on GraphObjects or on Diagram, and raising the corresponding DiagramEvent.
An optional custom navigation function to find target objects.
An optional custom predicate
any
Implement the standard behavior for mouse enter, over, and leave events, where the mouse is moving but no button is pressed.
any
Implement the standard behavior for selecting parts with the mouse, depending on the control and shift modifier keys.
any
Implement the standard behavior for mouse wheel events.
any
This is called to start a new timer to call #doWaitAfter after a given delay.
in milliseconds
any
Call Diagram#startTransaction with the given transaction name.
a description of the transaction
boolean
If the Diagram#currentTool is this tool, stop this tool and start the Diagram#defaultTool by making it be the new current tool.
any
If #transactionResult is null, call Diagram#rollbackTransaction, otherwise call Diagram#commitTransaction.
boolean
The diagram asks each tool to update any adornments the tool might use for a given part.
any