This abstract class is the base class for the LinkingTool and RelinkingTool classes.
Don't construct this directly -- this is an abstract class.
Gets the Diagram that owns this tool and for which this tool is handling input events.
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 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 predicate is used by the ToolManager to decide if this tool can be started mode-lessly by mouse and touch events.
boolean
This is called to cancel any running "WaitAfter" timer.
any
Make a temporary port look and act like a real one.
any
This method is called by the diagram after setting Diagram#currentTool, to make the new tool active.
any
The diagram will call this method when the user wishes to cancel the current tool's operation.
any
This method is called by the diagram on the old tool when Diagram#currentTool is set to a new tool.
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
The diagram will call this method upon a mouse up event.
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
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.
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