UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

214 lines 104 kB
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tool | GoJS API</title><meta name="description" content="Documentation for GoJS API"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../../assets/css/style.css"/><link rel="stylesheet" href="../assets/style-tsd.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><nav id="navTop" class="w-full z-30 top-0 text-white bg-nwoods-primary"><div class="w-full container max-w-screen-lg mx-auto flex flex-wrap sm:flex-nowrap items-center justify-between mt-0 py-2"><div class="md:pl-4"><a class="text-white hover:text-white no-underline hover:no-underline\n font-bold text-2xl lg:text-4xl rounded-lg hover:bg-nwoods-secondary" href="../../index.html"><h1 class="my-0 p-1 leading-none">GoJS</h1></a></div><button id="topnavButton" class="rounded-lg sm:hidden focus:outline-none focus:ring" aria-label="Navigation"><svg fill="currentColor" viewBox="0 0 20 20" class="w-6 h-6"><path id="topnavOpen" fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM9 15a1 1 0 011-1h6a1 1 0 110 2h-6a1 1 0 01-1-1z" clip-rule="evenodd"></path><path id="topnavClosed" class="hidden" fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg></button><div id="topnavList" class="hidden sm:block items-center w-auto mt-0 text-white p-0 z-20"><ul class="list-reset list-none font-semibold flex justify-end flex-wrap sm:flex-nowrap items-center px-0 pb-0"><li class="p-1 sm:p-0"><a class="topnav-link" href="../../learn/index.html">Learn</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="../../samples/index.html">Samples</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="../../intro/index.html">Intro</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="../../api/index.html">API</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="https://www.nwoods.com/products/register.html">Register</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="../../download.html">Download</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="https://forum.nwoods.com/c/gojs/11">Forum</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="https://www.nwoods.com/contact.html" target="_blank" rel="noopener" id="contactBtn">Contact</a></li><li class="p-1 sm:p-0"><a class="topnav-link" href="https://www.nwoods.com/sales/index.html" target="_blank" rel="noopener" id="buyBtn">Buy</a></li></ul></div></div><hr class="border-b border-gray-600 opacity-50 my-0 py-0"/></nav><div class="tsd-page-header"><div class="tsd-page-toolbar"><div class="w-full max-w-screen-xl mx-auto px-2"><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">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> <input type="checkbox" id="tsd-filter-inherited"/><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><div class="tsd-page-title"><div class="w-full max-w-screen-xl mx-auto px-2"><div class="top-copyright"><b>GoJS</b>&reg; Diagramming Components<br/>version 2.3.8<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a></div><div><h1>Class Tool <span class="tsd-flag ts-flagAbstract">Abstract</span> </h1></div></div></div></header><div class="tsd w-full max-w-screen-xl mx-auto pb-4"><div class="row px-2 w-full"><div class="col-8 col-content"><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Tool</span><ul class="tsd-hierarchy"><li><a href="ToolManager.html" class="tsd-signature-type" data-tsd-kind="Class">ToolManager</a></li><li><a href="DraggingTool.html" class="tsd-signature-type" data-tsd-kind="Class">DraggingTool</a></li><li><a href="LinkingBaseTool.html" class="tsd-signature-type" data-tsd-kind="Class">LinkingBaseTool</a></li><li><a href="LinkReshapingTool.html" class="tsd-signature-type" data-tsd-kind="Class">LinkReshapingTool</a></li><li><a href="ResizingTool.html" class="tsd-signature-type" data-tsd-kind="Class">ResizingTool</a></li><li><a href="RotatingTool.html" class="tsd-signature-type" data-tsd-kind="Class">RotatingTool</a></li><li><a href="ClickSelectingTool.html" class="tsd-signature-type" data-tsd-kind="Class">ClickSelectingTool</a></li><li><a href="ActionTool.html" class="tsd-signature-type" data-tsd-kind="Class">ActionTool</a></li><li><a href="ClickCreatingTool.html" class="tsd-signature-type" data-tsd-kind="Class">ClickCreatingTool</a></li><li><a href="DragSelectingTool.html" class="tsd-signature-type" data-tsd-kind="Class">DragSelectingTool</a></li><li><a href="PanningTool.html" class="tsd-signature-type" data-tsd-kind="Class">PanningTool</a></li><li><a href="ContextMenuTool.html" class="tsd-signature-type" data-tsd-kind="Class">ContextMenuTool</a></li><li><a href="TextEditingTool.html" class="tsd-signature-type" data-tsd-kind="Class">TextEditingTool</a></li><li><a href="ColumnResizingTool.html" class="tsd-signature-type" data-tsd-kind="Class">ColumnResizingTool</a></li><li><a href="DragCreatingTool.html" class="tsd-signature-type" data-tsd-kind="Class">DragCreatingTool</a></li><li><a href="DragZoomingTool.html" class="tsd-signature-type" data-tsd-kind="Class">DragZoomingTool</a></li><li><a href="FreehandDrawingTool.html" class="tsd-signature-type" data-tsd-kind="Class">FreehandDrawingTool</a></li><li><a href="GeometryReshapingTool.html" class="tsd-signature-type" data-tsd-kind="Class">GeometryReshapingTool</a></li><li><a href="LinkLabelDraggingTool.html" class="tsd-signature-type" data-tsd-kind="Class">LinkLabelDraggingTool</a></li><li><a href="LinkLabelOnPathDraggingTool.html" class="tsd-signature-type" data-tsd-kind="Class">LinkLabelOnPathDraggingTool</a></li><li><a href="LinkShiftingTool.html" class="tsd-signature-type" data-tsd-kind="Class">LinkShiftingTool</a></li><li><a href="NodeLabelDraggingTool.html" class="tsd-signature-type" data-tsd-kind="Class">NodeLabelDraggingTool</a></li><li><a href="PolygonDrawingTool.html" class="tsd-signature-type" data-tsd-kind="Class">PolygonDrawingTool</a></li><li><a href="PortShiftingTool.html" class="tsd-signature-type" data-tsd-kind="Class">PortShiftingTool</a></li><li><a href="RescalingTool.html" class="tsd-signature-type" data-tsd-kind="Class">RescalingTool</a></li><li><a href="RowResizingTool.html" class="tsd-signature-type" data-tsd-kind="Class">RowResizingTool</a></li><li><a href="SectorReshapingTool.html" class="tsd-signature-type" data-tsd-kind="Class">SectorReshapingTool</a></li></ul></li></ul></section><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"> <p>Tools handle mouse, keyboard, and touch events. The currently running tool, <a href="Diagram.html#currentTool">Diagram.currentTool</a>, receives all input events from the <a href="Diagram.html">Diagram</a> via canonicalized <a href="InputEvent.html">InputEvent</a>s.</p> <p class="boxrun"> For more discussion, see <a href="../../intro/tools.html">Introduction to Tools</a>. See samples that make use of tools in the <a href="../../samples/index.html#tools">samples index</a>.<div><p>Most tools are &quot;mode-less&quot; tools that are managed by the <a href="ToolManager.html">ToolManager</a>, which chooses the current tool based on the kind and position of the mouse event and the parts in the diagram. The <a href="ToolManager.html">ToolManager</a> has properties holding instances of most of the pre-defined <a href="Tool.html">Tool</a> classes. These classes include:</p> <ul> <li>In the <a href="ToolManager.html#mouseDownTools">ToolManager.mouseDownTools</a> <a href="List.html">List</a>:<ul> <li><a href="ActionTool.html">ActionTool</a></li> <li><a href="RelinkingTool.html">RelinkingTool</a></li> <li><a href="LinkReshapingTool.html">LinkReshapingTool</a></li> <li><a href="RotatingTool.html">RotatingTool</a></li> <li><a href="ResizingTool.html">ResizingTool</a></li> </ul> </li> <li>In the <a href="ToolManager.html#mouseMoveTools">ToolManager.mouseMoveTools</a> <a href="List.html">List</a>:<ul> <li><a href="LinkingTool.html">LinkingTool</a></li> <li><a href="DraggingTool.html">DraggingTool</a></li> <li><a href="DragSelectingTool.html">DragSelectingTool</a></li> <li><a href="PanningTool.html">PanningTool</a></li> </ul> </li> <li>In the <a href="ToolManager.html#mouseUpTools">ToolManager.mouseUpTools</a> <a href="List.html">List</a>:<ul> <li><a href="ContextMenuTool.html">ContextMenuTool</a></li> <li><a href="TextEditingTool.html">TextEditingTool</a></li> <li><a href="ClickCreatingTool.html">ClickCreatingTool</a></li> <li><a href="ClickSelectingTool.html">ClickSelectingTool</a></li> </ul> </li> </ul> <p>The ToolManager chooses a tool to run as the diagram&#39;s current tool by finding in its lists of tools the first tool whose <a href="Tool.html#canStart">canStart</a> method returns true. The ToolManager then sets <a href="Diagram.html#currentTool">Diagram.currentTool</a> to be that tool.</p> <p>A tool is in the &quot;running&quot; state when it is the value of <a href="Diagram.html#currentTool">Diagram.currentTool</a>. The <a href="Diagram.html#currentTool">Diagram.currentTool</a> property setter will call <a href="Tool.html#doStop">doStop</a> on the old tool and then call <a href="Tool.html#doStart">doStart</a> on the new tool.</p> <p>A tool can then go into the &quot;active&quot; state once it decides it can actually do something. This happens with a call to <a href="Tool.html#doActivate">doActivate</a>, normally called by the ToolManager. Later it is deactivated (<a href="Tool.html#doDeactivate">doDeactivate</a>) and then stopped. <a href="Tool.html#isActive">isActive</a> should be true when the tool is &quot;active&quot;. Often tools should ignore certain common events, such as calls to <a href="Tool.html#doMouseMove">doMouseMove</a>, unless the tool <a href="Tool.html#isActive">isActive</a>.</p> <p>You can prevent a &quot;mode-less&quot; tool (i.e. one managed by the <a href="ToolManager.html">ToolManager</a>) from being started by the ToolManager by setting <a href="Tool.html#isEnabled">isEnabled</a> to false.</p> <p>You can also go into a particular &quot;mode&quot; by setting <a href="Diagram.html#currentTool">Diagram.currentTool</a> explicitly, thereby circumventing the normal operation of the <a href="ToolManager.html">ToolManager</a>. This ignores the <a href="Tool.html#isEnabled">isEnabled</a> property and does not call the <a href="Tool.html#canStart">canStart</a> predicate. The behavior will depend on the tool -- not all of the predefined tools support operating as a &quot;modal&quot; tool.</p> <p>Tools cannot be shared amongst multiple Diagrams.</p> <p>If you define a Tool subclass, you may override any of the methods whose names start with &quot;do&quot; and any other methods that are documented to be overridable, such as <a href="Tool.html#canStart">canStart</a>. However you must seriously consider calling the base method in order to gets its default behavior. There may be situations where not calling the base method may cause subtle bugs. But that depends on the method and the tool. Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call the base method.</p> </div></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="Tool.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="Tool.html#diagram" class="tsd-kind-icon">diagram</a></li><li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Tool.html#isActive" class="tsd-kind-icon">is<wbr/>Active</a></li><li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Tool.html#isEnabled" class="tsd-kind-icon">is<wbr/>Enabled</a></li><li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Tool.html#name" class="tsd-kind-icon">name</a></li><li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Tool.html#transactionResult" class="tsd-kind-icon">transaction<wbr/>Result</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="Tool.html#canStart" class="tsd-kind-icon">can<wbr/>Start</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#canStartMultiTouch" class="tsd-kind-icon">can<wbr/>Start<wbr/>Multi<wbr/>Touch</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#cancelWaitAfter" class="tsd-kind-icon">cancel<wbr/>Wait<wbr/>After</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doActivate" class="tsd-kind-icon">do<wbr/>Activate</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doCancel" class="tsd-kind-icon">do<wbr/>Cancel</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doDeactivate" class="tsd-kind-icon">do<wbr/>Deactivate</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doKeyDown" class="tsd-kind-icon">do<wbr/>Key<wbr/>Down</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doKeyUp" class="tsd-kind-icon">do<wbr/>Key<wbr/>Up</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doMouseDown" class="tsd-kind-icon">do<wbr/>Mouse<wbr/>Down</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doMouseMove" class="tsd-kind-icon">do<wbr/>Mouse<wbr/>Move</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doMouseUp" class="tsd-kind-icon">do<wbr/>Mouse<wbr/>Up</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doMouseWheel" class="tsd-kind-icon">do<wbr/>Mouse<wbr/>Wheel</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doStart" class="tsd-kind-icon">do<wbr/>Start</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doStop" class="tsd-kind-icon">do<wbr/>Stop</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#doWaitAfter" class="tsd-kind-icon">do<wbr/>Wait<wbr/>After</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#findToolHandleAt" class="tsd-kind-icon">find<wbr/>Tool<wbr/>Handle<wbr/>At</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#isBeyondDragSize" class="tsd-kind-icon">is<wbr/>Beyond<wbr/>Drag<wbr/>Size</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="Tool.html#standardMouseClick" class="tsd-kind-icon">standard<wbr/>Mouse<wbr/>Click</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#standardMouseOver" class="tsd-kind-icon">standard<wbr/>Mouse<wbr/>Over</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#standardMouseSelect" class="tsd-kind-icon">standard<wbr/>Mouse<wbr/>Select</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#standardMouseWheel" class="tsd-kind-icon">standard<wbr/>Mouse<wbr/>Wheel</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#standardPinchZoomMove" class="tsd-kind-icon">standard<wbr/>Pinch<wbr/>Zoom<wbr/>Move</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#standardPinchZoomStart" class="tsd-kind-icon">standard<wbr/>Pinch<wbr/>Zoom<wbr/>Start</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#standardWaitAfter" class="tsd-kind-icon">standard<wbr/>Wait<wbr/>After</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#startTransaction" class="tsd-kind-icon">start<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#stopTool" class="tsd-kind-icon">stop<wbr/>Tool</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#stopTransaction" class="tsd-kind-icon">stop<wbr/>Transaction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Tool.html#updateAdornments" class="tsd-kind-icon">update<wbr/>Adornments</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 id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"> constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Tool<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Tool.html" class="tsd-signature-type" data-tsd-kind="Class">Tool</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"> <p>Don&#39;t construct this directly -- this is an abstract class.</p> </div><h4 class="tsd-returns-title">Returns <a href="Tool.html" class="tsd-signature-type" data-tsd-kind="Class">Tool</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 id="diagram" class="tsd-anchor"></a><h3 class="tsd-anchor-link"> diagram<span class="tsd-signature-symbol">: </span><a href="Diagram.html" class="tsd-signature-type" data-tsd-kind="Class">Diagram</a><a href="#diagram" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"> <p>This read-only property returns the <a href="Diagram.html">Diagram</a> that owns this tool and for which this tool is handling input events.</p> </div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"><a id="isActive" class="tsd-anchor"></a><h3 class="tsd-anchor-link"> is<wbr/>Active<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#isActive" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"> <p>Gets or sets whether this tool is started and is actively doing something.</p> <div><p>You can set this to true after your tool is started (i.e. when it is the <a href="Diagram.html#currentTool">Diagram.currentTool</a> and <a href="Tool.html#doStart">doStart</a> had been called), but when it is not yet in a state that it is actually &quot;doing&quot; something, because it is waiting for the right circumstances. This is typically only important when the tool is used in a modal fashion.</p> <p>The default value is false. This is normally set by <a href="Tool.html#doActivate">doActivate</a> and <a href="Tool.html#doDeactivate">doDeactivate</a>.</p> </div></div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"><a id="isEnabled" class="tsd-anchor"></a><h3 class="tsd-anchor-link"> is<wbr/>Enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#isEnabled" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"> <p>Gets or sets whether this tool can be started by a mouse event.</p> <div><p>Set this to false to prevent <a href="Tool.html#canStart">canStart</a> from returning true. Setting this property to false should prevent this tool from being used in a mode-less fashion by the <a href="ToolManager.html">ToolManager</a> with a mouse down/move/up event. However, even when this property is false, this tool can still be used in a modal fashion: it can still be started by explicitly setting the <a href="Diagram.html#currentTool">Diagram.currentTool</a> property to this tool.</p> <p>The default value is true.</p> </div></div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"><a id="name" class="tsd-anchor"></a><h3 class="tsd-anchor-link"> name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"> <p>Gets or sets the name of this tool. The default name is an empty string, but the constructor for each instance of a subclass of Tool will initialize it appropriately. For example, the name of the <a href="DragSelectingTool.html">DragSelectingTool</a> is &quot;DragSelecting&quot;.</p> <div><p>This name is sometimes used by tools that use <a href="Adornment.html">Adornment</a>s as the <a href="Part.html#category">Part.category</a> for their Adornments. It is also sometimes used by tools that conduct transactions as the transaction name.</p> </div></div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"><a id="transactionResult" class="tsd-anchor"></a><h3 class="tsd-anchor-link"> transaction<wbr/>Result<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#transactionResult" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"> <p>Gets or sets the name of the transaction to be committed by <a href="Tool.html#stopTransaction">stopTransaction</a></p> <div><p>If null, the transaction will be rolled back.</p> <p>If this is non-null at the time of a call to <a href="Tool.html#stopTransaction">stopTransaction</a>, it calls <a href="Diagram.html#commitTransaction">Diagram.commitTransaction</a> with this transaction name; if this is null at that time, it calls <a href="Diagram.html#rollbackTransaction">Diagram.rollbackTransaction</a>.</p> <p>The default value is null; <a href="Tool.html#startTransaction">startTransaction</a> will also set this to null. Because a value of null when <a href="Tool.html#stopTransaction">stopTransaction</a> is called will rollback the transaction, it is important that your code sets this property to a non-null value when it thinks it has succeeded.</p> <p>This property exists so that no matter what execution path occurs to end the usage of a tool, any ongoing transaction can be properly committed or rolled-back. Many tools call <a href="Tool.html#startTransaction">startTransaction</a> and <a href="Tool.html#stopTransaction">stopTransaction</a>; thus they set this property for their transaction to be committed. <a href="Tool.html#doCancel">doCancel</a> also sets this property to null.</p> </div></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"><a id="canStart" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> can<wbr/>Start<a href="#canStart" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">can<wbr/>Start<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"><div class="tsd-comment tsd-typography"> <p>This predicate is used by the <a href="ToolManager.html">ToolManager</a> to decide if this tool can be started mode-lessly by mouse and touch events. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the mouse event and input state.</p> <div><p>By default this method returns <a href="Tool.html#isEnabled">isEnabled</a>. This method may be overridden. 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></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div><p>true if <a href="Tool.html#isEnabled">isEnabled</a> is true and if the <a href="Diagram.html#toolManager">Diagram.toolManager</a> can make this tool the <a href="Diagram.html#currentTool">Diagram.currentTool</a> and then call the <a href="Tool.html#doStart">doStart</a> method.</p> </div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="canStartMultiTouch" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> can<wbr/>Start<wbr/>Multi<wbr/>Touch<a href="#canStartMultiTouch" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">can<wbr/>Start<wbr/>Multi<wbr/>Touch<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"><div class="tsd-comment tsd-typography"> <p>Called by <a href="ToolManager.html#doMouseDown">ToolManager.doMouseDown</a> and <a href="ToolManager.html#doMouseMove">ToolManager.doMouseMove</a>, this method determines whether or not to allow pinch zooming from a multi-touch event. By default this predicate just returns true. This method may be overridden. 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 class="">see</dt><dd><p><a href="Tool.html#standardPinchZoomStart">standardPinchZoomStart</a>, <a href="Tool.html#standardPinchZoomMove">standardPinchZoomMove</a></p> </dd><dt class="">since</dt><dd><p>1.5</p> </dd></dl></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="cancelWaitAfter" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> cancel<wbr/>Wait<wbr/>After<a href="#cancelWaitAfter" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">cancel<wbr/>Wait<wbr/>After<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>This is called to cancel any running &quot;WaitAfter&quot; timer.</p> <div><p>This is called when a tool is stopped.</p> <p>This method is rarely overridden. 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></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="doActivate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Activate<a href="#doActivate" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Activate<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>The Diagram calls this method after setting <a href="Diagram.html#currentTool">Diagram.currentTool</a>, to make the new tool active. This should set <a href="Tool.html#isActive">isActive</a> to true. Overrides of this method might call <a href="Tool.html#startTransaction">startTransaction</a>, if this tool&#39;s activity involves modification of the model. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the mouse event and input state.</p> <div><p>You should call this method only after setting <a href="Diagram.html#currentTool">Diagram.currentTool</a> to the Tool that you want to activate.</p> <p>By default this only sets <a href="Tool.html#isActive">isActive</a> to true. This method may be overridden. 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> <p>If you override this method, it is commonplace to also override <a href="Tool.html#doDeactivate">doDeactivate</a> to clean up whatever you set up in this method.</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="doCancel" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Cancel<a href="#doCancel" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Cancel<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>The diagram will call this method when the user wishes to cancel the current tool&#39;s operation. Typically this is called when the user hits the ESCAPE key. This should restore the original state of what was modified by this tool, and then it should call <a href="Tool.html#stopTool">stopTool</a>. This method is not responsible for cleaning up any side-effects that should be performed by <a href="Tool.html#doDeactivate">doDeactivate</a> and/or <a href="Tool.html#doStop">doStop</a>, which will always be called whether the tool stops normally or abnormally.</p> <div><p>By default this method just sets <a href="Tool.html#transactionResult">transactionResult</a> to null and calls <a href="Tool.html#stopTool">stopTool</a>. You will want to override this method even in tools that call <a href="Tool.html#startTransaction">startTransaction</a> and <a href="Tool.html#stopTransaction">stopTransaction</a>, because the <a href="UndoManager.html">UndoManager</a> might not be enabled. This method may be overridden. 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></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="doDeactivate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Deactivate<a href="#doDeactivate" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Deactivate<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>The Diagram calls this method on the old tool when <a href="Diagram.html#currentTool">Diagram.currentTool</a> is set to a new tool. This needs to set <a href="Tool.html#isActive">isActive</a> to false. Overrides of this method might call <a href="Tool.html#stopTransaction">stopTransaction</a>, if this tool&#39;s activity involves modification of the model.</p> <div><p>You should have no reason to call this method, because it is automatically called by the <a href="Diagram.html#currentTool">Diagram.currentTool</a> property setter on the old tool.</p> <p>By default this only sets <a href="Tool.html#isActive">isActive</a> to false. This method may be overridden. 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> <p>It is commonplace to override this method in order to clean up whatever you have set up in an override of <a href="Tool.html#doActivate">doActivate</a>.</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="doKeyDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Key<wbr/>Down<a href="#doKeyDown" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Key<wbr/>Down<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>The diagram will call this method upon a key down event. By default this just calls <a href="Tool.html#doCancel">doCancel</a> if the key is the ESCAPE key. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the key.</p> <div><p>This method may be overridden. 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></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="doKeyUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Key<wbr/>Up<a href="#doKeyUp" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Key<wbr/>Up<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>The diagram will call this method upon a key up event. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the key.</p> <div><p>By default this method does nothing. This method may be overridden. 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></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="doMouseDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Mouse<wbr/>Down<a href="#doMouseDown" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Mouse<wbr/>Down<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>The diagram will call this method upon a mouse down event. This is normally overridden for mouse-down tools; it is not called for mouse-move or mouse-up tools. However it may also be called when the tool is run in a modal fashion, when code explicitly sets the diagram&#39;s <a href="Diagram.html#currentTool">Diagram.currentTool</a>. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the mouse event and input state.</p> <div><p>By default this method checks <a href="Tool.html#isActive">isActive</a>; if that is false it calls <a href="Tool.html#canStart">canStart</a>. If that in turn is true, this calls <a href="Tool.html#doActivate">doActivate</a>. This method may be overridden. 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></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="doMouseMove" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Mouse<wbr/>Move<a href="#doMouseMove" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></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>The diagram will call this method upon a mouse move event. This is normally overridden for mouse-move tools; it is not called for mouse-up tools. However it may also be called when the tool is run in a modal fashion, when code explicitly sets the diagram&#39;s <a href="Diagram.html#currentTool">Diagram.currentTool</a>. An override of this method usually does nothing when <a href="Tool.html#isActive">isActive</a> is false. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the mouse event and input state.</p> <div><p>By default this method does nothing. This method may be overridden. 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></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="doMouseUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Mouse<wbr/>Up<a href="#doMouseUp" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">do<wbr/>Mouse<wbr/>Up<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>The diagram will call this method upon a mouse up event. This is normally overridden for mouse-up tools. An override of this method usually does nothing when <a href="Tool.html#isActive">isActive</a> is false, except for calling <a href="Tool.html#stopTool">stopTool</a>. Tools normally stop upon a mouse up, by calling <a href="Tool.html#stopTool">stopTool</a>. If you want to handle multiple mouse down-up gestures in one tool activation, you will need to override this method to only stop the tool when you want. Implementations of this method can look at <a href="Diagram.html#lastInput">Diagram.lastInput</a> to get the mouse event and input state.</p> <div><p>By default this method just calls <a href="Tool.html#stopTool">stopTool</a>. This method may be overridden. 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></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="doMouseWheel" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagVirtual">Virtual</span> do<wbr/>Mouse<wbr/>Wheel<a href="#doMouseWheel" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signat