gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
753 lines • 64.9 kB
HTML
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>LinkingBaseTool | GoJS API</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../assets/css/bootstrap.min.css">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<!-- non-fixed navbar -->
<nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top">
<div class="container-fluid">
<div class="navbar-header">
<div class="navheader-container">
<div class="navheader-collapse" data-toggle="collapse" data-target="#navbar">
<a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="../../index.html">Home</a></li>
<li><a href="../../learn/index.html">Learn</a></li>
<li><a href="../../samples/index.html">Samples</a></li>
<li><a href="../../intro/index.html">Intro</a></li>
<li><a href="../../api/index.html" target="api">API</a></li>
<li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li>
<li><a href="../../download.html">Download</a></li>
<li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li>
<li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li>
<li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li>
<li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="tsd-page-header">
<div class="tsd-page-toolbar">
<div class="container-fluid plr15">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">GoJS API</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container-fluid plr15">
<div class="top-copyright">
<!--<b>GoJS</b>® Diagramming Components<br/>version <br/>version 2.1.18 for TypeScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>-->
<b>GoJS</b>® Diagramming Components<br/>version 2.1.18<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>
</div>
<div>
<h1>Class LinkingBaseTool</h1>
</div>
</div>
</div>
</div>
</header>
<div class="container-fluid container-main plr15">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="Tool.html" class="tsd-signature-type">Tool</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">LinkingBaseTool</span>
<ul class="tsd-hierarchy">
<li>
<a href="LinkingTool.html" class="tsd-signature-type">LinkingTool</a>
</li>
<li>
<a href="RelinkingTool.html" class="tsd-signature-type">RelinkingTool</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<p>This abstract class is the base class for the <a href="LinkingTool.html">LinkingTool</a> and <a href="RelinkingTool.html">RelinkingTool</a> classes.</p>
<p>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.</p>
<p class="boxread">
For a general discussion of link routing, see:
<a href="../../intro/links.html">Introduction to Links</a>,
<a href="../../intro/linkLabels.html">Introduction to Link Labels</a>, and
<a href="../../intro/connectionPoints.html">Introduction to Link Connection Points</a>.
For customizing the linking tools, see <a href="../../intro/tools.html#LinkingAndRelinkingTools">Introduction to the Linking Tools</a>.
For customizing the reshaping of Links, see <a href="../../intro/tools.html#LinkReshapingTool">Introduction to the LinkReshapingTool</a>.
For a general discussion of validation, see <a href="../../intro/validation.html">Introduction to Validation</a>.
</div>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="LinkingBaseTool.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#isForwards" class="tsd-kind-icon">is<wbr>Forwards</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#isUnconnectedLinkValid" class="tsd-kind-icon">is<wbr>Unconnected<wbr>Link<wbr>Valid</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#linkValidation" class="tsd-kind-icon">link<wbr>Validation</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#originalFromNode" class="tsd-kind-icon">original<wbr>From<wbr>Node</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#originalFromPort" class="tsd-kind-icon">original<wbr>From<wbr>Port</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#originalLink" class="tsd-kind-icon">original<wbr>Link</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#originalToNode" class="tsd-kind-icon">original<wbr>ToNode</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#originalToPort" class="tsd-kind-icon">original<wbr>ToPort</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#portGravity" class="tsd-kind-icon">port<wbr>Gravity</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#portTargeted" class="tsd-kind-icon">port<wbr>Targeted</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#targetPort" class="tsd-kind-icon">target<wbr>Port</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#temporaryFromNode" class="tsd-kind-icon">temporary<wbr>From<wbr>Node</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#temporaryFromPort" class="tsd-kind-icon">temporary<wbr>From<wbr>Port</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#temporaryLink" class="tsd-kind-icon">temporary<wbr>Link</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#temporaryToNode" class="tsd-kind-icon">temporary<wbr>ToNode</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="LinkingBaseTool.html#temporaryToPort" class="tsd-kind-icon">temporary<wbr>ToPort</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><a href="LinkingBaseTool.html#copyPortProperties" class="tsd-kind-icon">copy<wbr>Port<wbr>Properties</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#doMouseMove" class="tsd-kind-icon">do<wbr>Mouse<wbr>Move</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#findTargetPort" class="tsd-kind-icon">find<wbr>Target<wbr>Port</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#isInSameNode" class="tsd-kind-icon">is<wbr>InSame<wbr>Node</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#isLinked" class="tsd-kind-icon">is<wbr>Linked</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#isValidCycle" class="tsd-kind-icon">is<wbr>Valid<wbr>Cycle</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#isValidFrom" class="tsd-kind-icon">is<wbr>Valid<wbr>From</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#isValidLink" class="tsd-kind-icon">is<wbr>Valid<wbr>Link</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="LinkingBaseTool.html#isValidTo" class="tsd-kind-icon">is<wbr>Valid<wbr>To</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><a href="LinkingBaseTool.html#setNoTargetPortProperties" class="tsd-kind-icon">set<wbr>NoTarget<wbr>Port<wbr>Properties</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>
constructor
</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Linking<wbr>Base<wbr>Tool<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="LinkingBaseTool.html" class="tsd-signature-type">LinkingBaseTool</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Don't construct this directly -- this is an abstract class.</p>
</div>
<h4 class="tsd-returns-title">Returns <a href="LinkingBaseTool.html" class="tsd-signature-type">LinkingBaseTool</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="isForwards" class="tsd-anchor"></a>
<h3>
is<wbr>Forwards
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets whether the linking operation is in the forwards direction,
connecting from the "From" port to the "To" port.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="isUnconnectedLinkValid" class="tsd-anchor"></a>
<h3>
is<wbr>Unconnected<wbr>Link<wbr>Valid
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets whether it is valid to have partly or completely unconnected links.</p>
<p>The default value is false -- the user cannot draw or reconnect a link to "nowhere".
Setting this property does not raise any events.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.3</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="linkValidation" class="tsd-anchor"></a>
<h3>
link<wbr>Validation
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">fromNode</span><span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">fromPort</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">toNode</span><span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">toPort</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">link</span><span class="tsd-signature-symbol">: </span><a href="Link.html" class="tsd-signature-type">Link</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>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 <a href="LinkingBaseTool.html#isValidLink">isValidLink</a>
and any <a href="Node.html#linkValidation">Node.linkValidation</a> predicates on the "from" and "to" nodes.
When relinking, the <a href="Link.html">Link</a> being considered for reconnection is passed as the fifth argument.
The default predicate is null, which is equivalent to simply returning true.</p>
<p class="boxread">
For a more general discussion of validation, see <a href="../../intro/validation.html">Introduction to Validation</a>.
<p>The function, if supplied, must not have any side-effects.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="originalFromNode" class="tsd-anchor"></a>
<h3>
original<wbr>From<wbr>Node
<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the original <a href="Node.html">Node</a> from which the new link is being drawn
or from which the <a href="LinkingBaseTool.html#originalLink">originalLink</a> was connected when being relinked.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="originalFromPort" class="tsd-anchor"></a>
<h3>
original<wbr>From<wbr>Port
<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="GraphObject.html">GraphObject</a> that is the port in the <a href="LinkingBaseTool.html#originalFromNode">originalFromNode</a>.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="originalLink" class="tsd-anchor"></a>
<h3>
original<wbr>Link
<span class="tsd-signature-symbol">: </span><a href="Link.html" class="tsd-signature-type">Link</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the original <a href="Link.html">Link</a> being reconnected by the <a href="RelinkingTool.html">RelinkingTool</a>.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="originalToNode" class="tsd-anchor"></a>
<h3>
original<wbr>ToNode
<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the original <a href="Node.html">Node</a> to which the new link is being drawn
or to which the <a href="LinkingBaseTool.html#originalLink">originalLink</a> was connected when being relinked.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="originalToPort" class="tsd-anchor"></a>
<h3>
original<wbr>ToPort
<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="GraphObject.html">GraphObject</a> that is the port in the <a href="LinkingBaseTool.html#originalToNode">originalToNode</a>.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="portGravity" class="tsd-anchor"></a>
<h3>
port<wbr>Gravity
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>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.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="portTargeted" class="tsd-anchor"></a>
<h3>
port<wbr>Targeted
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">node</span><span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">port</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">tempNode</span><span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">tempPort</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">toEnd</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>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 <a href="Node.html">Node</a> that it is in
and the <a href="GraphObject.html">GraphObject</a> 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 <a href="LinkingBaseTool.html#temporaryToNode">temporaryToNode</a> and <a href="LinkingBaseTool.html#temporaryToPort">temporaryToPort</a>
or the <a href="LinkingBaseTool.html#temporaryFromNode">temporaryFromNode</a> and <a href="LinkingBaseTool.html#temporaryFromPort">temporaryFromPort</a>, 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.</p>
<p>When there is no valid port within the <a href="LinkingBaseTool.html#portGravity">portGravity</a>, the first two arguments are null.</p>
<p>The function, if supplied, must not add or remove any links or nodes or port objects,
nor may it change the validity of any potential link connection.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.2</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="targetPort" class="tsd-anchor"></a>
<h3>
target<wbr>Port
<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets a proposed <a href="GraphObject.html">GraphObject</a> port for connecting a link.
Whether this is a "to" port or a "from" port depends on the direction
(<a href="LinkingBaseTool.html#isForwards">isForwards</a>) in which the link is being drawn or reconnected.</p>
<p>This is set when the mouse is being dragged and when a mouse-up event occurs
with the result of a call to <a href="LinkingBaseTool.html#findTargetPort">findTargetPort</a>.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="temporaryFromNode" class="tsd-anchor"></a>
<h3>
temporary<wbr>From<wbr>Node
<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the temporary <a href="Node.html">Node</a> at the "from" end of the <a href="LinkingBaseTool.html#temporaryLink">temporaryLink</a>
while the user is drawing or reconnecting a link.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="temporaryFromPort" class="tsd-anchor"></a>
<h3>
temporary<wbr>From<wbr>Port
<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="GraphObject.html">GraphObject</a> that is the port at the "from" end of the <a href="LinkingBaseTool.html#temporaryLink">temporaryLink</a>
while the user is drawing or reconnecting a link.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="temporaryLink" class="tsd-anchor"></a>
<h3>
temporary<wbr>Link
<span class="tsd-signature-symbol">: </span><a href="Link.html" class="tsd-signature-type">Link</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the temporary <a href="Link.html">Link</a> that is shown while the user is drawing or reconnecting a link.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="temporaryToNode" class="tsd-anchor"></a>
<h3>
temporary<wbr>ToNode
<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the temporary <a href="Node.html">Node</a> at the "to" end of the <a href="LinkingBaseTool.html#temporaryLink">temporaryLink</a>
while the user is drawing or reconnecting a link.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="temporaryToPort" class="tsd-anchor"></a>
<h3>
temporary<wbr>ToPort
<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="GraphObject.html">GraphObject</a> that is the port at the "to" end of the <a href="LinkingBaseTool.html#temporaryLink">temporaryLink</a>
while the user is drawing or reconnecting a link.
Setting this property does not raise any events.</p>
</div>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a name="copyPortProperties" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagProtected">Protected</span> <span class="tsd-flag ts-flagVirtual">Virtual</span>
copy<wbr>Port<wbr>Properties
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<li class="tsd-signature tsd-kind-icon">copy<wbr>Port<wbr>Properties<span class="tsd-signature-symbol">(</span>realnode<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, realport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, tempnode<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a>, tempport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a>, toend<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Make a temporary port look and act like a real one.</p>
<p>This is called by <a href="LinkingBaseTool.html#doMouseMove">doMouseMove</a> as the tool finds new valid target ports.
If <a href="LinkingBaseTool.html#findTargetPort">findTargetPort</a> returns null, it calls <a href="LinkingBaseTool.html#setNoTargetPortProperties">setNoTargetPortProperties</a> instead.</p>
<p>If the <a href="LinkingBaseTool.html#portTargeted">portTargeted</a> property is a function, that function is called.
It is easier to customize the behavior by setting that functional property than it is to override
this method and the <a href="LinkingBaseTool.html#setNoTargetPortProperties">setNoTargetPortProperties</a> method.
But you may want to call this method to get the standard behavior for dynamically adapting
the temporary node/port to "act like" the target port.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.2</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>realnode: <a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5>realport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5>tempnode: <a href="Node.html" class="tsd-signature-type">Node</a></h5>
</li>
<li>
<h5>tempport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a></h5>
</li>
<li>
<h5>toend: <span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="doMouseMove" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagOverride">Override</span>
do<wbr>Mouse<wbr>Move
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">do<wbr>Mouse<wbr>Move<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>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.</p>
<p>This calls <a href="LinkingBaseTool.html#findTargetPort">findTargetPort</a> to update the <a href="LinkingBaseTool.html#targetPort">targetPort</a>
given the new mouse point.
If a valid target port is found this moves the temporary node/port and
makes them appear like the target node/port by calling <a href="LinkingBaseTool.html#copyPortProperties">copyPortProperties</a>.
If no valid target port is found, this moves the temporary node to
where the mouse currently is and removes any node/port appearance,
by calling <a href="LinkingBaseTool.html#setNoTargetPortProperties">setNoTargetPortProperties</a>.</p>
<p>This method may be overridden, but we recommend that you call this base method.</p>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="findTargetPort" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagVirtual">Virtual</span>
find<wbr>Target<wbr>Port
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">find<wbr>Target<wbr>Port<span class="tsd-signature-symbol">(</span>toend<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Find a port with which the user could complete a valid link.</p>
<p>This finds objects near to the current mouse point for which a valid link connection is possible.</p>
<p>For each port element found, this calls <a href="LinkingBaseTool.html#isValidLink">isValidLink</a> to find out if a link between
the original node/port and the found node/port would be valid.
The result is saved in a cache for faster decisions later during operation of this tool.
The closest valid port is returned.</p>
<p>This method may be overridden, but we recommend that you call this base method.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>toend: <span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<p>true if looking for a "to" port.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<a href="GraphObject.html" class="tsd-signature-type">GraphObject</a>
<span class="tsd-signature-symbol"> | </span>
<span class="tsd-signature-type">null</span>
</h4>
<p>a valid port, or null if no such port is near the current mouse point
within the <a href="LinkingBaseTool.html#portGravity">portGravity</a> distance.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="isInSameNode" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagVirtual">Virtual</span>
is<wbr>InSame<wbr>Node
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>InSame<wbr>Node<span class="tsd-signature-symbol">(</span>fromport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, toport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>This predicate is true if both argument ports are in the same <a href="Node.html">Node</a>.
This is called by <a href="LinkingBaseTool.html#isValidLink">isValidLink</a>.</p>
<p>This method may be overridden, but we recommend that you call this base method.
It is rare that you will want to override this method.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>fromport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5>toport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="isLinked" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagVirtual">Virtual</span>
is<wbr>Linked
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>Linked<span class="tsd-signature-symbol">(</span>fromport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, toport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>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 <a href="LinkingBaseTool.html#isValidLink">isValidLink</a>.</p>
<p>This method may be overridden, but we recommend that you call this base method.
It is rare that you will want to override this method.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>fromport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5>toport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="isValidCycle" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagVirtual">Virtual</span>
is<wbr>Valid<wbr>Cycle
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>Valid<wbr>Cycle<span class="tsd-signature-symbol">(</span>from<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, to<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, ignore<span class="tsd-signature-symbol">?: </span><a href="Link.html" class="tsd-signature-type">Link</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Checks whether a proposed link would be valid according to <a href="Diagram.html#validCycle">Diagram.validCycle</a>.
This does not distinguish between different ports on a node, so this method does not need to take port arguments.
This is called by <a href="LinkingBaseTool.html#isValidLink">isValidLink</a>.</p>
<p>This method may be overridden, but we recommend that you call this base method.
It is rare that you will want to override this method.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.5</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>from: <a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5>to: <a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> ignore: <a href="Link.html" class="tsd-signature-type">Link</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
<div class="tsd-comment tsd-typography">
<p>may be null; this is useful during relinking to ignore the <a href="LinkingBaseTool.html#originalLink">originalLink</a></p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="isValidFrom" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagVirtual">Virtual</span>
is<wbr>Valid<wbr>From
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>Valid<wbr>From<span class="tsd-signature-symbol">(</span>fromnode<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, fromport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>This predicate is true if it is permissible to connect a link from a given node/port.
This is called by <a href="LinkingBaseTool.html#isValidLink">isValidLink</a>.</p>
<p class="boxread">
For a more general discussion of validation, see <a href="../../intro/validation.html">Introduction to Validation</a>.
<p>This method may be overridden, but we recommend that you call this base method.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>fromnode: <a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
<li>
<h5>fromport: <a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
<p>False if the node is in a <a href="Layer.html">Layer</a> that does not <a href="Layer.html#allowLink">Layer.allowLink</a>.
False if the port's <a href="GraphObject.html#fromLinkable">GraphObject.fromLinkable</a> is either false or null.
False if the number of links connected to the port would exceed the port's <a href="GraphObject.html#fromMaxLinks">GraphObject.fromMaxLinks</a>.
Otherwise true.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="isValidLink" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagVirtual">Virtual</span>
is<wbr>Valid<wbr>Link
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">is<wbr>Valid<wbr>Link<span class="tsd-signature-symbol">(</span>fromnode<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, fromport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, tonode<span class="tsd-signature-symbol">: </span><a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span>, toport<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>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 <a href="RelinkingTool.html">RelinkingTool</a>, that tool sets <a href="LinkingBaseTool.html#originalLink">originalLink</a>
to be the <a href="Link.html">Link</a> being reconnected.</p>
<p class="boxread">
For a more general discussion of validation, see <a href="../../intro/validation.html">Introduction to Validation</a>.
<p>This method may be overridden, although it is usually much easier to just set <a href="LinkingBaseTool.html#linkValidation">linkValidation</a>
or <a href="Node.html#linkValidation">Node.linkValidation</a> in order to add some application-specific link validation.
Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>fromnode: <a href="Node.html" class="tsd-signature-type">Node</a><span class="tsd-signature-symbol"> | </span><span cl