Class LinkShiftingTool

GoJS® Diagramming Components
version 3.0.15
by Northwoods Software®

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. See the Extensions intro page for more information.

Hierarchy (view full)

  • Tool
    • LinkShiftingTool

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:

myDiagram.toolManager.mouseDownTools.add(new LinkShiftingTool());

If you want to experiment with this extension, try the Link Shifting sample.

Index

Constructors

Accessors

  • A small GraphObject used as a shifting handle.

  • A small GraphObject used as a shifting handle.

Methods

  • This tool may run when there is a mouse-down event on a reshaping handle.

    Returns boolean

  • 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.

    Returns void

  • Restore the link route to be the original points and stop this tool.

    Returns void

  • This stops the current shifting operation with the link as it is.

    Returns void

  • Call doReshape with a new point determined by the mouse to change the end point of the link.

    Returns void

  • Reshape the link's end with a point based on the most recent mouse point by calling doReshape, and then stop this tool.

    Returns void

  • Find the closest point along the edge of the link's port and shift the end of the link to that point.

    Parameters

    Returns void

  • Perform cleanup of tool state.

    Returns void

  • Show an go.Adornment with a reshape handle at each end of the link which allows for shifting of the end points.

    Parameters

    Returns void