maxGraph/docs/api/classes/ConstraintHandler.html

62 lines
51 KiB
HTML
Raw Normal View History

Finish converting core to ts, JSDoc conversion, consistency+convention changes, example bugfixes (#70) * reorganised directories; removed mx prefix * reduced directory hierarchies; removed mx prefix; type fixes * convert remaining javascript to ts * fix/add types * add type defs * type updates; moved codecs to where they're used * reorganise constants into enums+type additions * removed "Function:" and "Variable:" prefixes from comments, as they aren't needed in JSDoc * removed "Function:", "Variable:" and "Class:" prefixes from comments, as they aren't needed in JSDoc * removed "Function:" prefixes from comments, as they aren't needed in JSDoc * minor changes * convert code example blocks to markdown * module casing updates * converted parameter function documentation to JSDoc * documentation+type updates * removed react subdir (for now) * reorganised various `utils` functions into different files * type updates/bugfixes/workarounds * rename Rubberband and CellEditor to be *Handler to match the other plugins * move codec classes to where they're used to reduce cyclic dependencies * move codec classes to where they're used to reduce cyclic dependencies * type updates/reorganize layout file structure * renamed various files for consistency * import fixes * renamed GraphHandler SelectionHander and various fixes * convert EventObject parameters to objects * add basic better-docs config * update better-docs config * bugfix for shared variables in Graph persisting across instances * fixed accessing handlers in examples; renamed Model to GraphModel * fixed accessing handlers in examples; renamed Model to GraphModel * restored selection model * bugfix * renamed getModel to getDataModel * changed to use graph.batchUpdate() to reduce lines of code * changed to use graph.batchUpdate() to reduce lines of code * finished annotations+added TypeDoc * convert remaining Cell[] instances to CellArray * convert NaturalDocs links to JSDoc
2022-01-08 01:49:35 +00:00
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ConstraintHandler | @maxgraph/core</title><meta name="description" content="Documentation for @maxgraph/core"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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">@maxgraph/core</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> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></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"><ul class="tsd-breadcrumb"><li><a href="../index.html">@maxgraph/core</a></li><li><a href="ConstraintHandler.html">ConstraintHandler</a></li></ul><h1>Class ConstraintHandler</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Handles constraints on connection targets. This class is in charge of
showing fixed points when the mouse is over a vertex and handles constraints
to establish new connections.</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ConstraintHandler</span></li></ul></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="ConstraintHandler.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-property tsd-parent-kind-class"><a href="ConstraintHandler.html#constraints" class="tsd-kind-icon">constraints</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentConstraint" class="tsd-kind-icon">current<wbr/>Constraint</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentFocus" class="tsd-kind-icon">current<wbr/>Focus</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentFocusArea" class="tsd-kind-icon">current<wbr/>Focus<wbr/>Area</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentPoint" class="tsd-kind-icon">current<wbr/>Point</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#focusHighlight" class="tsd-kind-icon">focus<wbr/>Highlight</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#focusIcons" class="tsd-kind-icon">focus<wbr/>Icons</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#focusPoints" class="tsd-kind-icon">focus<wbr/>Points</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#graph" class="tsd-kind-icon">graph</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#highlightColor" class="tsd-kind-icon">highlight<wbr/>Color</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#mouseleaveHandler" class="tsd-kind-icon">mouseleave<wbr/>Handler</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#pointImage" class="tsd-kind-icon">point<wbr/>Image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#resetHandler" class="tsd-kind-icon">reset<wbr/>Handler</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"><a href="ConstraintHandler.html#createHighlightShape" class="tsd-kind-icon">create<wbr/>Highlight<wbr/>Shape</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#destroyFocusHighlight" class="tsd-kind-icon">destroy<wbr/>Focus<wbr/>Highlight</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#destroyIcons" class="tsd-kind-icon">destroy<wbr/>Icons</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#getCellForEvent" class="tsd-kind-icon">get<wbr/>Cell<wbr/>For<wbr/>Event</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#getImageForConstraint" class="tsd-kind-icon">get<wbr/>Image<wbr/>For<wbr/>Constraint</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#getTolerance" class="tsd-kind-icon">get<wbr/>Tolerance</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#intersects" class="tsd-kind-icon">intersects</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html#isEnabled" class="tsd-kind-icon">is<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="ConstraintHandler.html
<p>Specifies if events are handled. Default is true.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="focusHighlight" class="tsd-anchor"></a><h3>focus<wbr/>Highlight</h3><div class="tsd-signature tsd-kind-icon">focus<wbr/>Highlight<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="RectangleShape.html" class="tsd-signature-type" data-tsd-kind="Class">RectangleShape</a><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L60">view/handler/ConstraintHandler.ts:60</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="focusIcons" class="tsd-anchor"></a><h3>focus<wbr/>Icons</h3><div class="tsd-signature tsd-kind-icon">focus<wbr/>Icons<span class="tsd-signature-symbol">:</span> <a href="ImageShape.html" class="tsd-signature-type" data-tsd-kind="Class">ImageShape</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L54">view/handler/ConstraintHandler.ts:54</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="focusPoints" class="tsd-anchor"></a><h3>focus<wbr/>Points</h3><div class="tsd-signature tsd-kind-icon">focus<wbr/>Points<span class="tsd-signature-symbol">:</span> <a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L62">view/handler/ConstraintHandler.ts:62</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="graph" class="tsd-anchor"></a><h3>graph</h3><div class="tsd-signature tsd-kind-icon">graph<span class="tsd-signature-symbol">:</span> <a href="Graph.html" class="tsd-signature-type" data-tsd-kind="Class">Graph</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L46">view/handler/ConstraintHandler.ts:46</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Reference to the enclosing {@link mxGraph}.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="highlightColor" class="tsd-anchor"></a><h3>highlight<wbr/>Color</h3><div class="tsd-signature tsd-kind-icon">highlight<wbr/>Color<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = DEFAULT_VALID_COLOR</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L74">view/handler/ConstraintHandler.ts:74</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Specifies the color for the highlight. Default is <a href="../modules/constants.html#DEFAULT_VALID_COLOR">DEFAULT_VALID_COLOR</a>.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="mouseleaveHandler" class="tsd-anchor"></a><h3>mouseleave<wbr/>Handler</h3><div class="tsd-signature tsd-kind-icon">mouseleave<wbr/>Handler<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-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L76">view/handler/ConstraintHandler.ts:76</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="pointImage" class="tsd-anchor"></a><h3>point<wbr/>Image</h3><div class="tsd-signature tsd-kind-icon">point<wbr/>Image<span class="tsd-signature-symbol">:</span> <a href="ImageBox.html" class="tsd-signature-type" data-tsd-kind="Class">ImageBox</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L41">view/handler/ConstraintHandler.ts:41</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>{@link Image} to be used as the image for fixed connection points.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="resetHandler" class="tsd-anchor"></a><h3>reset<wbr/>Handler</h3><div class="tsd-signature tsd-kind-icon">reset<wbr/>Handler<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L48">view/handler/ConstraintHandler.ts:48</a></li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><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"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div></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"><a id="createHighlightShape" class="tsd-anchor"></a><h3>create<wbr/>Highlight<wbr/>Shape</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">create<wbr/>Highlight<wbr/>Shape<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="RectangleShape.html" class="tsd-signature-type" data-tsd-kind="Class">RectangleShape</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L454">view/handler/ConstraintHandler.ts:454</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Create the shape used to paint the highlight.</p>
</div><div><p>Returns true if the given icon intersects the given point.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="RectangleShape.html" class="tsd-signature-type" data-tsd-kind="Class">RectangleShape</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="destroyFocusHighlight" class="tsd-anchor"></a><h3>destroy<wbr/>Focus<wbr/>Highlight</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">destroy<wbr/>Focus<wbr/>Highlight<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L191">view/handler/ConstraintHandler.ts:191</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Destroys the <a href="ConstraintHandler.html#focusHighlight">focusHighlight</a> if one exists.</p>
</div></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 id="destroyIcons" class="tsd-anchor"></a><h3>destroy<wbr/>Icons</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">destroy<wbr/>Icons<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L179">view/handler/ConstraintHandler.ts:179</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Destroys the <a href="ConstraintHandler.html#focusIcons">focusIcons</a> if they exist.</p>
</div></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 id="getCellForEvent" class="tsd-anchor"></a><h3>get<wbr/>Cell<wbr/>For<wbr/>Event</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Cell<wbr/>For<wbr/>Event<span class="tsd-signature-symbol">(</span>me<span class="tsd-signature-symbol">: </span><a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a>, point<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L209">view/handler/ConstraintHandler.ts:209</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns the cell for the given event.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>me: <a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a></h5></li><li><h5>point: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="getImageForConstraint" class="tsd-anchor"></a><h3>get<wbr/>Image<wbr/>For<wbr/>Constraint</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Image<wbr/>For<wbr/>Constraint<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a>, constraint<span class="tsd-signature-symbol">: </span><a href="ConnectionConstraint.html" class="tsd-signature-type" data-tsd-kind="Class">ConnectionConstraint</a>, point<span class="tsd-signature-symbol">: </span><a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ImageBox.html" class="tsd-signature-type" data-tsd-kind="Class">ImageBox</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L153">view/handler/ConstraintHandler.ts:153</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns the tolerance to be used for intersecting connection points.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>state: <a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a></h5></li><li><h5>constraint: <a href="ConnectionConstraint.html" class="tsd-signature-type" data-tsd-kind="Class">ConnectionConstraint</a></h5></li><li><h5>point: <a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="ImageBox.html" class="tsd-signature-type" data-tsd-kind="Class">ImageBox</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="getTolerance" class="tsd-anchor"></a><h3>get<wbr/>Tolerance</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Tolerance<span class="tsd-signature-symbol">(</span>me<span class="tsd-signature-symbol">: </span><a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L146">view/handler/ConstraintHandler.ts:146</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns the tolerance to be used for intersecting connection points. This
implementation returns {@link mxGraph.tolerance}.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>me: <a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>{@link mxMouseEvent} whose tolerance should be returned.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="intersects" class="tsd-anchor"></a><h3>intersects</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">intersects<span class="tsd-signature-symbol">(</span>icon<span class="tsd-signature-symbol">: </span><a href="ImageShape.html" class="tsd-signature-type" data-tsd-kind="Class">ImageShape</a>, mouse<span class="tsd-signature-symbol">: </span><a href="Rectangle.html" class="tsd-signature-type" data-tsd-kind="Class">Rectangle</a>, source<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, existingEdge<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">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L469">view/handler/ConstraintHandler.ts:469</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns true if the given icon intersects the given rectangle.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>icon: <a href="ImageShape.html" class="tsd-signature-type" data-tsd-kind="Class">ImageShape</a></h5></li><li><h5>mouse: <a href="Rectangle.html" class="tsd-signature-type" data-tsd-kind="Class">Rectangle</a></h5></li><li><h5>source: <span class="tsd-signature-type">boolean</span></h5></li><li><h5>existingEdge: <span class="tsd-signature-type">boolean</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 id="isEnabled" class="tsd-anchor"></a><h3>is<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">is<wbr/>Enabled<span class="tsd-signature-symbol">(</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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L104">view/handler/ConstraintHandler.ts:104</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns true if events are handled. This implementation
returns <a href="ConstraintHandler.html#enabled">enabled</a>.</p>
</div></div><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 id="isEventIgnored" class="tsd-anchor"></a><h3>is<wbr/>Event<wbr/>Ignored</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">is<wbr/>Event<wbr/>Ignored<span class="tsd-signature-symbol">(</span>me<span class="tsd-signature-symbol">: </span><a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a>, source<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">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L165">view/handler/ConstraintHandler.ts:165</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns true if the given {@link mxMouseEvent} should be ignored in <a href="ConstraintHandler.html#update">update</a>. This
implementation always returns false.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>me: <a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a></h5></li><li><h5>source: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</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 id="isKeepFocusEvent" class="tsd-anchor"></a><h3>is<wbr/>Keep<wbr/>Focus<wbr/>Event</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">is<wbr/>Keep<wbr/>Focus<wbr/>Event<span class="tsd-signature-symbol">(</span>me<span class="tsd-signature-symbol">: </span><a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a><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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L202">view/handler/ConstraintHandler.ts:202</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns true if the current focused state should not be changed for the given event.
This returns true if shift and alt are pressed.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>me: <a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a></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 id="isStateIgnored" class="tsd-anchor"></a><h3>is<wbr/>State<wbr/>Ignored</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">is<wbr/>State<wbr/>Ignored<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a>, source<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">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L172">view/handler/ConstraintHandler.ts:172</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns true if the given state should be ignored. This always returns false.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>state: <a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a></h5></li><li><h5>source: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</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 id="onDestroy" class="tsd-anchor"></a><h3>on<wbr/>Destroy</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">on<wbr/>Destroy<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L476">view/handler/ConstraintHandler.ts:476</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Destroy this handler.</p>
</div></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 id="redraw" class="tsd-anchor"></a><h3>redraw</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">redraw<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L355">view/handler/ConstraintHandler.ts:355</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Transfers the focus to the given state as a source or target terminal. If
the handler is not enabled then the outline is painted, but the constraints
are ignored.</p>
</div></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 id="reset" class="tsd-anchor"></a><h3>reset</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">reset<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L121">view/handler/ConstraintHandler.ts:121</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Resets the state of this handler.</p>
</div></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 id="setEnabled" class="tsd-anchor"></a><h3>set<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">set<wbr/>Enabled<span class="tsd-signature-symbol">(</span>enabled<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L114">view/handler/ConstraintHandler.ts:114</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Enables or disables event handling. This implementation
updates <a href="ConstraintHandler.html#enabled">enabled</a>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>enabled: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Boolean that specifies the new enabled state.</p>
</div></div></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 id="setFocus" class="tsd-anchor"></a><h3>set<wbr/>Focus</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">set<wbr/>Focus<span class="tsd-signature-symbol">(</span>me<span class="tsd-signature-symbol">: </span><a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a>, state<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a>, source<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L388">view/handler/ConstraintHandler.ts:388</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Transfers the focus to the given state as a source or target terminal. If
the handler is not enabled then the outline is painted, but the constraints
are ignored.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>me: <a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a></h5></li><li><h5>state: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a></h5></li><li><h5>source: <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 id="update" class="tsd-anchor"></a><h3>update</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">update<span class="tsd-signature-symbol">(</span>me<span class="tsd-signature-symbol">: </span><a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a>, source<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, existingEdge<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, point<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a><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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/handler/ConstraintHandler.ts#L241">view/handler/ConstraintHandler.ts:241</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Updates the state of this handler based on the given {@link mxMouseEvent}.
Source is a boolean indicating if the cell is a source or target.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>me: <a href="InternalMouseEvent.html" class="tsd-signature-type" data-tsd-kind="Class">InternalMouseEvent</a></h5></li><li><h5>source: <span class="tsd-signature-type">boolean</span></h5></li><li><h5>existingEdge: <span class="tsd-signature-type">boolean</span></h5></li><li><h5>point: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class=" tsd-kind-namespace"><a href="../modules/DomHelpers.html">Dom<wbr/>Helpers</a></li><li class=" tsd-kind-namespace"><a href="../modules/cloneUtils.html">clone<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/constants.html">constants</a></li><li class=" tsd-kind-namespace"><a href="../modules/domUtils.html">dom<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/eventUtils.html">event<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/gestureUtils.html">gesture<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/mathUtils.html">math<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/stringUtils.html">string<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/styleUtils.html">style<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/xmlUtils.html">xml<wbr/>Utils</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="ConstraintHandler.html" class="tsd-kind-icon">Constraint<wbr/>Handler</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="ConstraintHandler.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#constraints" class="tsd-kind-icon">constraints</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentConstraint" class="tsd-kind-icon">current<wbr/>Constraint</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentFocus" class="tsd-kind-icon">current<wbr/>Focus</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentFocusArea" class="tsd-kind-icon">current<wbr/>Focus<wbr/>Area</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#currentPoint" class="tsd-kind-icon">current<wbr/>Point</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#focusHighlight" class="tsd-kind-icon">focus<wbr/>Highlight</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#focusIcons" class="tsd-kind-icon">focus<wbr/>Icons</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#focusPoints" class="tsd-kind-icon">focus<wbr/>Points</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#graph" class="tsd-kind-icon">graph</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#highlightColor" class="tsd-kind-icon">highlight<wbr/>Color</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#mouseleaveHandler" class="tsd-kind-icon">mouseleave<wbr/>Handler</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="ConstraintHandler.html#pointImage" class="tsd-kind-icon">point<wbr/>Image</a></li><li class="tsd-kind-pr