Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LinkShiftingTool Extension

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.

Hierarchy

  • 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

Inherited Members

Constructors

  • Constructs a LinkShiftingTool and sets the handles and name of the tool.

    Returns LinkShiftingTool

Properties

  • A small GraphObject used as a shifting handle.

  • A small GraphObject used as a shifting handle.

Methods

  • canStart(): boolean
  • This tool may run when there is a mouse-down event on a reshaping handle.

    Returns boolean

  • doActivate(): void
  • 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

  • doCancel(): void
  • Restore the link route to be the original points and stop this tool.

    Returns void

  • doDeactivate(): void
  • This stops the current shifting operation with the link as it is.

    Returns void

  • doMouseMove(): void
  • Call doReshape with a new point determined by the mouse to change the end point of the link.

    Returns void

  • doMouseUp(): 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

  • doReshape(pt: Point): 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

  • doStop(): void
  • Perform cleanup of tool state.

    Returns void

  • updateAdornments(part: Part): void
  • Show an Adornment with a reshape handle at each end of the link which allows for shifting of the end points.

    Parameters

    Returns void