This abstract class is the base class for the LinkingTool and RelinkingTool classes. This class includes properties for defining and accessing any temporary nodes and temporary link that are used during any linking operation, as well as access to the existing diagram's nodes and link (if any) that are involved with the linking operation.
You do not normally need to create an instance of this tool because one already exists as the ToolManager#linkingTool, which you can modify.
This value for LinkingTool#direction indicates that users may draw new links backwards only.
This value for LinkingTool#direction indicates that users may draw new links in either direction.
This value for LinkingTool#direction indicates that users may draw new links forwards only.
Gets or sets an optional node data object representing a link label, that is copied by #insertLink and added to the GraphLinksModel when creating a new Link.
Gets or sets a data object that is copied by #insertLink and added to the GraphLinksModel when creating a new Link.
Gets the Diagram that owns this tool and for which this tool is handling input events.
Gets or sets the direction in which new links may be drawn.
Gets or sets whether this tool is started and is actively doing something.
Gets or sets whether this tool can be started by a mouse event.
Gets whether the linking operation is in the forwards direction, connecting from the "From" port to the "To" port.
Gets or sets a predicate that determines whether or not a new link between two ports would be valid.
Gets or sets the name of this tool.
Gets or sets the original Node from which the new link is being drawn or from which the #originalLink was connected when being relinked.
Gets or sets the GraphObject that is the port in the #originalFromNode.
Gets or sets the original Link being reconnected by the RelinkingTool.
Gets or sets the original Node to which the new link is being drawn or to which the #originalLink was connected when being relinked.
Gets or sets the GraphObject that is the port in the #originalToNode.
Gets or sets the distance at which link snapping occurs.
Gets or sets a function that is called as the tool targets the nearest valid port.
Gets or sets the GraphObject at which #findLinkablePort should start its search.
Gets or sets a proposed GraphObject port for connecting a link.
Gets or sets the temporary Node at the "from" end of the #temporaryLink while the user is drawing or reconnecting a link.
Gets or sets the GraphObject that is the port at the "from" end of the #temporaryLink while the user is drawing or reconnecting a link.
Gets or sets the temporary Link that is shown while the user is drawing or reconnecting a link.
Gets or sets the temporary Node at the "to" end of the #temporaryLink while the user is drawing or reconnecting a link.
Gets or sets the GraphObject that is the port at the "to" end of the #temporaryLink while the user is drawing or reconnecting a link.
Gets or sets the name of the transaction to be committed by #stopTransaction; if null, the transaction will be rolled back.
This tool can run when the diagram allows linking, the model is modifiable, the left-button mouse drag has moved far enough away to not be a click, and when #findLinkablePort has returned a valid port.
boolean
This is called to cancel any running "WaitAfter" timer.
any
Make a temporary port look and act like a real one.
any
Start the linking operation.
any
The diagram will call this method when the user wishes to cancel the current tool's operation.
any
Finishing the linking operation stops the transaction, releases the mouse, and resets the cursor.
any
The diagram will call this method upon a key down event.
any
The diagram will call this method upon a key up event.
any
The diagram will call this method upon a mouse down event.
any
Mouse movement results in a temporary node moving to where a valid target port is located, or to where the mouse is if there is no valid target port nearby.
any
A mouse-up ends the linking operation; if there is a valid #targetPort nearby, this adds a new Link by calling #insertLink.
any
The diagram will call this method as the mouse wheel is rotated.
any
This method is called by the diagram when this tool becomes the current tool; you should not call this method.
any
This method is called by the diagram when this tool stops being the current tool; you should not call this method.
any
This is called a certain delay after a call to #standardWaitAfter if there has not been any call to #cancelWaitAfter.
any
Return the GraphObject at the mouse-down point, if it is part of a node and if it is valid to link with it.
Find a port with which the user could complete a valid link.
true if looking for a "to" port.
This convenience function finds the front-most GraphObject that is at a given point and that is part of an Adornment that is of a given category.
a Point in document coordinates.
the required Part#category of the Adornment.
Make a copy of the #archetypeLinkData, set its node and port properties, and add it to the model.
Return true when the last mouse point is far enough away from the first mouse down point to constitute a drag operation instead of just a potential click.
Point in view coordinates, defaults to Diagram#firstInput's InputEvent#viewPoint.
Point in view coordinates, defaults to Diagram#lastInput's InputEvent#viewPoint.
boolean
This predicate is true if both argument ports are in the same Node.
boolean
This predicate is true if there is a link in the diagram going from the given port to the given port
boolean
This predicate is true if it is permissible to connect a link from a given node/port.
False if the node is in a Layer that does not Layer#allowLink. False if the port's GraphObject#fromLinkable is either false or null. False if the number of links connected to the port would exceed the port's GraphObject#fromMaxLinks. Otherwise true.
boolean
This predicate should be true when it is logically valid to connect a new link from one node/port to another node/port.
the "from" Node.
the "from" GraphObject port.
the "to" Node.
the "to" GraphObject port. False if #isValidFrom is false for the "from" node/port. False if #isValidTo is false for the "to" node/port. False if #isInSameNode is true unless GraphObject#fromLinkableSelfNode and GraphObject#toLinkableSelfNode are true for the two ports. False if #isLinked is true unless GraphObject#fromLinkableDuplicates and GraphObject#toLinkableDuplicates are true for the two ports. False if trying to link to the link's own label node(s). If #linkValidation is a predicate and if it returns false, this predicate returns false. Otherwise this predicate is true.
boolean
This predicate is true if it is permissible to connect a link to a given node/port.
False if the node is in a Layer that does not Layer#allowLink. False if the port's GraphObject#toLinkable is either false or null. False if the number of links connected from the port would exceed the port's GraphObject#toMaxLinks. Otherwise true.
boolean
Reset a temporary port's properties to neutral values when there is no target port.
any
Implement the standard behavior for mouse clicks, searching for and calling click handler functions on GraphObjects or on Diagram, and raising the corresponding DiagramEvent.
An optional custom navigation function to find target objects.
An optional custom predicate
any
Implement the standard behavior for mouse enter, over, and leave events, where the mouse is moving but no button is pressed.
any
Implement the standard behavior for selecting parts with the mouse, depending on the control and shift modifier keys.
any
Implement the standard behavior for mouse wheel events.
any
This is called to start a new timer to call #doWaitAfter after a given delay.
in milliseconds
any
Call Diagram#startTransaction with the given transaction name.
a description of the transaction
boolean
If the Diagram#currentTool is this tool, stop this tool and start the Diagram#defaultTool by making it be the new current tool.
any
If #transactionResult is null, call Diagram#rollbackTransaction, otherwise call Diagram#commitTransaction.
boolean
The diagram asks each tool to update any adornments the tool might use for a given part.
any