LinkingBaseTool$Typings extension

on

Properties

isForwards bool
Gets whether the linking operation is in the forwards direction, connecting from the "From" port to the "To" port.
getter/setter pair
isUnconnectedLinkValid bool
Gets or sets whether it is valid to have partly or completely unconnected links.
getter/setter pair
linkingCursor String
Gets or sets the cursor used during the linking or relinking operation. This defaults to 'pointer'. Read more about cursors at Diagram#currentCursor
getter/setter pair
linkValidation ↔ (bool Function(Node, GraphObject, Node, GraphObject, Link)?)
Gets or sets a predicate that determines whether or not a new link between two ports would be valid. This predicate is called in addition to the normal link checking performed by #isValidLink and any Node#linkValidation predicates on the "from" and "to" nodes. When relinking, the Link being considered for reconnection is passed as the fifth argument. The default predicate is null, which is equivalent to simply returning true.
getter/setter pair
originalFromNode Node?
Gets or sets the original Node from which the new link is being drawn or from which the #originalLink was connected when being relinked. Setting this property does not raise any events.
getter/setter pair
originalFromPort GraphObject?
Gets or sets the GraphObject that is the port in the #originalFromNode. Setting this property does not raise any events.
getter/setter pair
Gets or sets the original Link being reconnected by the RelinkingTool. Setting this property does not raise any events.
getter/setter pair
originalToNode Node?
Gets or sets the original Node to which the new link is being drawn or to which the #originalLink was connected when being relinked. Setting this property does not raise any events.
getter/setter pair
originalToPort GraphObject?
Gets or sets the GraphObject that is the port in the #originalToNode. Setting this property does not raise any events.
getter/setter pair
portGravity num
Gets or sets the distance at which link snapping occurs. The default value is 100.0. The value must be non-negative. Setting this property does not raise any events.
getter/setter pair
portTargeted ↔ (void Function(Node, GraphObject, bool, [Node?, GraphObject?])?)
Gets or sets a function that is called as the tool targets the nearest valid port. The first two arguments specify the port by providing the Node that it is in and the GraphObject that is the actual port object. The next two arguments are the temporary port that has been moved and styled to be like the valid port. These values will be either the #temporaryToNode and #temporaryToPort or the #temporaryFromNode and #temporaryFromPort, depending on which end of the temporary link is being updated. The fifth argument is true if the target port represents a potential "to" end of a link; it is false if it is for the "from" end of a link.
getter/setter pair
targetPort GraphObject?
Gets or sets a proposed GraphObject port for connecting a link. Whether this is a "to" port or a "from" port depends on the direction (#isForwards) in which the link is being drawn or reconnected.
getter/setter pair
temporaryFromNode Node
Gets or sets the temporary Node at the "from" end of the #temporaryLink while the user is drawing or reconnecting a link. Setting this property does not raise any events.
getter/setter pair
temporaryFromPort GraphObject
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. Setting this property does not raise any events.
getter/setter pair
Gets or sets the temporary Link that is shown while the user is drawing or reconnecting a link. Setting this property does not raise any events.
getter/setter pair
temporaryToNode Node
Gets or sets the temporary Node at the "to" end of the #temporaryLink while the user is drawing or reconnecting a link. Setting this property does not raise any events.
getter/setter pair
temporaryToPort GraphObject
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. Setting this property does not raise any events.
getter/setter pair

Methods

copyPortProperties(Node tempnode, GraphObject tempport, bool toend, [Node? realnode, GraphObject? realport]) → void
Make a temporary port look and act like a real one.
doMouseMove() → void
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.
findTargetPort(bool toend) GraphObject?
Find a port with which the user could complete a valid link.
isInSameNode([GraphObject? fromport, GraphObject? toport]) bool
This predicate is true if both argument ports are in the same Node. This is called by #isValidLink.
isLinked([GraphObject? fromport, GraphObject? toport]) bool
This predicate is true if there is a link in the diagram going from the given port to the given port. This is called by #isValidLink.
isValidCycle([Node? from, Node? to, Link? ignore]) bool
Checks whether a proposed link would be valid according to Diagram#validCycle. This does not distinguish between different ports on a node, so this method does not need to take port arguments. This is called by #isValidLink.
isValidFrom([Node? fromnode, GraphObject? fromport]) bool
This predicate is true if it is permissible to connect a link from a given node/port. This is called by #isValidLink.
This predicate should be true when it is logically valid to connect a new link from one node/port to another node/port. When this is called by the RelinkingTool, that tool sets #originalLink to be the Link being reconnected.
isValidTo([Node? tonode, GraphObject? toport]) bool
This predicate is true if it is permissible to connect a link to a given node/port. This is called by #isValidLink.
setNoTargetPortProperties(Node tempnode, GraphObject tempport, bool toend) → void
Reset a temporary port's properties to neutral values when there is no target port.