LinkingTool class

The LinkingTool lets a user draw a new Link between two ports, using a mouse-drag operation.

By default an instance of this tool is installed as a mouse-move tool in the Diagram#toolManager as the ToolManager#linkingTool. However this tool may be used modally, as described below.

#canStart calls #findLinkablePort to find a valid "port" element from which (or to which) the user may interactively draw a new link. #doActivate sets up a temporary link and two temporary nodes, one at the start port and one following the mouse.

For a general discussion of validation, see Introduction to Validation.

This tool does not utilize any Adornments or tool handles.

This tool conducts a transaction while the tool is active. A successful linking will result in a "LinkDrawn" DiagramEvent and a "Linking" transaction.

If you want to programmatically start a new user mouse-gesture to draw a new link from a given GraphObject that either is a "port" or may be within the visual tree of a "port", set the #startObject property to let #findLinkablePort find the real "port" element. Then start and activate this tool:

  var tool = myDiagram.toolManager.linkingTool;
  tool.startObject = ...;
  myDiagram.currentTool = tool;
  tool.doActivate();
Implemented types
Available Extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

LinkingTool()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

backwardsOnly EnumValue
This value for LinkingTool#direction indicates that users may draw new links backwards only (i.e. from "to" node to "from" node).
getter/setter pair
either EnumValue
This value for LinkingTool#direction indicates that users may draw new links in either direction.
getter/setter pair
forwardsOnly EnumValue
This value for LinkingTool#direction indicates that users may draw new links forwards only (i.e. from "from" node to "to" node).
getter/setter pair