Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PolylineLinkingTool

This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. Extensions can be found in the GoJS kit under the extensions or extensionsTS folders. See the Extensions intro page for more information.

Hierarchy

The PolylineLinkingTool class the user to draw a new Link by clicking where the route should go, until clicking on a valid target port.

This tool supports routing both orthogonal and straight links. You can customize the LinkingBaseTool.temporaryLink as needed to affect the appearance and behavior of the temporary link that is shown during the linking operation. You can customize the LinkingTool.archetypeLinkData to specify property values that can be data-bound by your link template for the Links that are actually created.

If you want to experiment with this extension, try the Polyline Linking sample.

Index

Constructors

constructor

Methods

Override doActivate

  • doActivate(): void
  • Use a "crosshair" cursor.

    Returns void

Override doKeyDown

  • doKeyDown(): void
  • This supports the "Z" command during this tool's operation to remove the last added point of the route. Type ESCAPE to completely cancel the operation of the tool.

    Returns void

Override doMouseDown

  • doMouseDown(): void
  • Add a point to the route that the temporary Link is accumulating.

    Returns void

Override doMouseMove

  • doMouseMove(): void
  • Have the temporary link reach to the last mouse point.

    Returns void

Override doMouseUp

  • doMouseUp(): void
  • If this event happens on a valid target port (as determined by LinkingBaseTool.findTargetPort), we complete the link drawing operation. insertLink is overridden to transfer the accumulated route drawn by user clicks to the new Link that was created.

    If this event happens elsewhere in the diagram, this tool is not stopped: the drawing of the route continues.

    Returns void

Override insertLink

  • This method overrides the standard link creation method by additionally replacing the default link route with the custom one laid out by the user.

    Parameters

    Returns Link | null