This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. Extensions can be found in the GoJS kit under the extensions
(for loading via script tags),extensionsTS
(UMD modules), or extensionsJSM
(ES6 modules) folders. See the Extensions intro page for more information.
Constructs a LinkShiftingTool and sets the handles and name of the tool.
A small GraphObject used as a shifting handle.
A small GraphObject used as a shifting handle.
This tool may run when there is a mouse-down event on a reshaping handle.
Start shifting, if findToolHandleAt finds a reshaping handle at the mouse down point.
If successful this sets the handle to be the reshape handle that it finds. It also remembers the original points in case this tool is cancelled. And it starts a transaction.
Restore the link route to be the original points and stop this tool.
This stops the current shifting operation with the link as it is.
Call doReshape with a new point determined by the mouse to change the end point of the link.
Reshape the link's end with a point based on the most recent mouse point by calling doReshape, and then stop this tool.
Find the closest point along the edge of the link's port and shift the end of the link to that point.
Perform cleanup of tool state.
The LinkShiftingTool class lets the user shift the end of a link to be anywhere along the edges of the port; use it in a diagram.toolManager.mouseDownTools list:
If you want to experiment with this extension, try the Link Shifting sample.