The LinkReshapingTool is used to interactively change the route of a Link. This tool makes use of an Adornment, shown when the adorned Link is selected, that includes some number of reshape handles. This tool conducts a transaction while the tool is active. A successful reshaping will result in a "LinkReshaped" DiagramEvent and a "LinkReshaping" transaction.
You do not normally need to create an instance of this tool because one already exists as the ToolManager#linkReshapingTool, which you can modify.
Allow dragging in any direction.
Allow only horizontal (left-and-right) dragging.
Disallow dragging.
Allow only vertical (up-and-down) dragging.
Gets the Link that is being routed manually.
Gets the Diagram that owns this tool and for which this tool is handling input events.
Gets the GraphObject that is the tool handle being dragged by the user.
Gets or sets a small GraphObject that is copied as a reshape handle at each movable point in the selected link's route.
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 a small GraphObject that is copied as a resegment handle at each mid point in the selected Link's route.
Gets or sets the name of this tool.
Gets the Point that was the original location of the handle that is being dragged to reshape the Link.
Gets the List of Points that was the original route of the Link that is being reshaped.
Gets or sets the name of the transaction to be committed by #stopTransaction; if null, the transaction will be rolled back.
This tool may run when there is a mouse-down event on a reshape handle.
boolean
This is called to cancel any running "WaitAfter" timer.
any
This is called by #doMouseMove and #doMouseUp to limit the input point before calling #reshape.
Start reshaping, if #findToolHandleAt finds a reshape handle at the mouse down point.
any
Restore the link route to be the original points and stop this tool.
any
This stops the current reshaping operation with the link route shaped the way it is.
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
Call #reshape with a new point determined by the mouse to change the route of the #adornedLink.
any
Reshape the route with a point based on the most recent mouse point by calling #reshape, and then raise a "LinkReshaped" DiagramEvent before stopping this tool.
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
Change the route of the #adornedLink by moving the point corresponding to the current #handle to be at the given Point.
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
Show an Adornment with reshape handles at each of the interesting points of the link's route, if the link is selected and visible and if Part#canReshape is true.
any