create-gojs-kit
Version:
A CLI for downloading GoJS samples, extensions, and docs
210 lines • 54.4 kB
HTML
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><link rel="stylesheet" href="../../assets/css/style.css"/><link rel="preconnect" href="https://rsms.me/"/><link rel="stylesheet" href="https://rsms.me/inter/inter.css"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ContextMenuTool | 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/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script type="text/javascript">// formerly in api.js
var hash = null;
function changeHash() {
var panels = document.getElementsByClassName("tsd-panel");
for (let i = 0; i < panels.length; i++) {
var p = panels[i];
p.classList.remove("targeted");
}
hash = window.location.hash.slice(1);
if (hash) {
var elt = document.getElementById(hash);
if (elt) elt.parentNode.classList.add("targeted");
}
}
document.addEventListener("DOMContentLoaded", changeHash);
window.addEventListener("hashchange", changeHash);</script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header><nav id="navTop" class="w-full h-[var(--topnav-h)] z-30 bg-[var(--color-background-secondary)] border-b border-b-[var(--color-accent)]"><div class="max-w-screen-xl mx-auto flex flex-wrap items-start justify-between px-4"><a class="!text-white bg-nwoods-primary font-bold !leading-[calc(var(--topnav-h)_-_1px)] my-0 px-2 text-4xl lg:text-5xl logo" href="../../index.html">GoJS</a><div class="relative"><button id="topnavButton" class="h-[calc(var(--topnav-h)_-_1px)] px-2 m-0 text-[var(--color-text)] bg-inherit shadow-none md:hidden hover:!bg-inherit hover:!text-nwoods-accent hover:!shadow-none" aria-label="Navigation"><svg class="h-7 w-7 block" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div id="topnavList" class="hidden md:block"><div class="absolute right-0 z-30 flex flex-col items-end rounded border border-[var(--color-accent)] p-4 pl-12 shadow bg-[var(--color-background-secondary)] text-[var(--color-text)] font-semibold
md:flex-row md:space-x-4 md:items-start md:border-0 md:p-0 md:shadow-none md:!bg-inherit"><a href="../../learn/index.html">Learn</a><a href="../../samples/index.html">Samples</a><a href="../../intro/index.html">Intro</a><a class="active" href="../../api/index.html">API</a><a href="../../download.html">Download</a><a href="https://forum.nwoods.com/c/gojs/11" target="_blank" rel="noopener">Forum</a><a href="https://nwoods.com/contact.html" target="_blank" rel="noopener" id="contactBtn">Contact</a><a href="https://nwoods.com/sales/index.html" target="_blank" rel="noopener" id="buyBtn">Buy</a></div></div></div></div></nav><script>window.addEventListener("DOMContentLoaded", function () {
// topnav
var topButton = document.getElementById("topnavButton");
var topnavList = document.getElementById("topnavList");
if (topButton && topnavList) {
topButton.addEventListener("click", function (e) {
topnavList
.classList
.toggle("hidden");
e.stopPropagation();
});
document.addEventListener("click", function (e) {
// if the clicked element isn't the list, close the list
if (!topnavList.classList.contains("hidden") && !e.target.closest("#topnavList")) {
topButton.click();
}
});
// set active <a> element
// done via active tag below, always API
}
});</script><div class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><div id="tsd-search-help"><code class="!text-lg">/</code> to search</div><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></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"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><div class="flex w-full max-w-screen-xl mx-auto px-2 items-center justify-between"><div><ul class="tsd-breadcrumb"><li><a href="../index.html">GoJS API</a></li><li><a href="ContextMenuTool.html">ContextMenuTool</a></li></ul><h1 class="flex items-center">Class ContextMenuTool</h1></div><div class="text-xs"><b>GoJS</b>® Diagramming Components<br/>version 3.1.0<br/>by <a href="https://nwoods.com/">Northwoods Software®</a></div></div></div><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a class="link" href="../hierarchy.html#ContextMenuTool">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="Tool.html" class="tsd-signature-type tsd-kind-class">Tool</a><ul class="tsd-hierarchy"><li><span class="target">ContextMenuTool</span></li></ul></li></ul></section><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>The ContextMenuTool is used to create and show a context menu.
It automatically disables any browser context menu.</p>
<p>Define context menus on individual <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a>s by setting <a href="GraphObject.html#contextMenu" class="tsd-kind-accessor">GraphObject.contextMenu</a>.
Define a context menu for the diagram background by setting <a href="Diagram.html#contextMenu" class="tsd-kind-accessor">Diagram.contextMenu</a>.</p>
<p>This tool is a standard mouse-down tool, the <a href="ToolManager.html#contextMenuTool" class="tsd-kind-accessor">ToolManager.contextMenuTool</a>.</p>
<p>This tool does not utilize any tool handles.
This tool does not modify the model or conduct any transaction,
although any code invoked by context menu commands might do so.</p>
<p>There are examples of customizing this tool in the
<a href="../../samples/customContextMenu.html">Custom Context Menu</a> and
<a href="../../samples/htmlLightBoxContextMenu.html">HTML LightBox Context Menu</a> samples.</p>
<p>If you want to programmatically show a context menu for a particular GraphObject or for the
whole diagram, call <a href="CommandHandler.html#showContextMenu" class="tsd-kind-method">CommandHandler.showContextMenu</a>.
That command method is also invoked by the Menu key on the keyboard.</p>
<p>Normally this shows a context menu (if available) on a right-mouse-up event.
If you want it to happen on a right-mouse-down event, you'll need to move this tool
from the <a href="ToolManager.html#mouseUpTools" class="tsd-kind-accessor">ToolManager.mouseUpTools</a> list to the <a href="ToolManager.html#mouseDownTools" class="tsd-kind-accessor">ToolManager.mouseDownTools</a> list:</p>
<pre><code class="language-js"><span class="hl-4">myDiagram</span><span class="hl-2">.</span><span class="hl-4">toolManager</span><span class="hl-2">.</span><span class="hl-4">mouseDownTools</span><span class="hl-2">.</span><span class="hl-5">add</span><span class="hl-2">(</span><span class="hl-4">myDiagram</span><span class="hl-2">.</span><span class="hl-4">toolManager</span><span class="hl-2">.</span><span class="hl-5">replaceTool</span><span class="hl-2">(</span><span class="hl-6">"ContextMenu"</span><span class="hl-2">, </span><span class="hl-1">null</span><span class="hl-2">));</span>
</code><button>Copy</button></pre>
</div></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="true" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="ContextMenuTool.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="ContextMenuTool.html#currentContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>current<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#currentObject" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>current<wbr/>Object</span></a>
<a href="ContextMenuTool.html#defaultTouchContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>default<wbr/>Touch<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#mouseDownPoint" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><g id="subicon-R,#FF4D4D"><rect fill="var(--color-icon-background)" width="28" height="28" rx="14"></rect><path transform="translate(2, 2)" fill="none" stroke-width="1.5" stroke="var(--color-text)" d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" stroke-linecap="round" stroke-linejoin="round"></path></g></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>mouse<wbr/>Down<wbr/>Point</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="ContextMenuTool.html#canStart" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>can<wbr/>Start</span></a>
<a href="ContextMenuTool.html#doActivate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Activate</span></a>
<a href="ContextMenuTool.html#doMouseDown" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Mouse<wbr/>Down</span></a>
<a href="ContextMenuTool.html#doMouseMove" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Mouse<wbr/>Move</span></a>
<a href="ContextMenuTool.html#doMouseUp" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Mouse<wbr/>Up</span></a>
<a href="ContextMenuTool.html#findObjectWithContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Object<wbr/>With<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#hideContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>hide<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#hideDefaultContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>hide<wbr/>Default<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#positionContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>position<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#showContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>show<wbr/>Context<wbr/>Menu</span></a>
<a href="ContextMenuTool.html#showDefaultContextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>show<wbr/>Default<wbr/>Context<wbr/>Menu</span></a>
</div></section></div></details></section></section><section class="tsd-panel-group tsd-index-group tsd-is-inherited"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion"><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Inherited Index</h5></summary><div class="tsd-accordion-details"><div class="tsd-index-content"><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="Tool.html#diagram" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Tool.diagram</span></a>
<a href="Tool.html#isActive" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Tool.is<wbr/>Active</span></a>
<a href="Tool.html#isEnabled" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Tool.is<wbr/>Enabled</span></a>
<a href="Tool.html#name" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Tool.name</span></a>
<a href="Tool.html#transactionResult" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Tool.transaction<wbr/>Result</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="Tool.html#canStartMultiTouch" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.can<wbr/>Start<wbr/>Multi<wbr/>Touch</span></a>
<a href="Tool.html#cancelWaitAfter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.cancel<wbr/>Wait<wbr/>After</span></a>
<a href="Tool.html#doCancel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.do<wbr/>Cancel</span></a>
<a href="Tool.html#doDeactivate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.do<wbr/>Deactivate</span></a>
<a href="Tool.html#doKeyDown" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.do<wbr/>Key<wbr/>Down</span></a>
<a href="Tool.html#doKeyUp" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.do<wbr/>Key<wbr/>Up</span></a>
<a href="Tool.html#doWaitAfter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.do<wbr/>Wait<wbr/>After</span></a>
<a href="Tool.html#findToolHandleAt" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.find<wbr/>Tool<wbr/>Handle<wbr/>At</span></a>
<a href="Tool.html#isBeyondDragSize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.is<wbr/>Beyond<wbr/>Drag<wbr/>Size</span></a>
<a href="Tool.html#standardMouseClick" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Mouse<wbr/>Click</span></a>
<a href="Tool.html#standardMouseOver" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Mouse<wbr/>Over</span></a>
<a href="Tool.html#standardMouseSelect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Mouse<wbr/>Select</span></a>
<a href="Tool.html#standardMouseWheel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Mouse<wbr/>Wheel</span></a>
<a href="Tool.html#standardPinchZoomMove" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Pinch<wbr/>Zoom<wbr/>Move</span></a>
<a href="Tool.html#standardPinchZoomStart" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Pinch<wbr/>Zoom<wbr/>Start</span></a>
<a href="Tool.html#standardWaitAfter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.standard<wbr/>Wait<wbr/>After</span></a>
<a href="Tool.html#startTransaction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.start<wbr/>Transaction</span></a>
<a href="Tool.html#stopTool" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.stop<wbr/>Tool</span></a>
<a href="Tool.html#stopTransaction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.stop<wbr/>Transaction</span></a>
<a href="Tool.html#updateAdornments" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Tool.update<wbr/>Adornments</span></a>
</div></section></div></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_ContextMenuTool" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Context<wbr/>Menu<wbr/>Tool</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">init</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><a href="ContextMenuTool.html" class="tsd-signature-type tsd-kind-class">ContextMenuTool</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ContextMenuTool.html" class="tsd-signature-type tsd-kind-class">ContextMenuTool</a><a href="#constructor.new_ContextMenuTool" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>You do not normally need to create an instance of this tool
because one already exists as the <a href="ToolManager.html#contextMenuTool" class="tsd-kind-accessor">ToolManager.contextMenuTool</a>, which you can modify.</p>
<p>The <a href="Tool.html#name" class="tsd-kind-accessor">Tool.name</a> of this tool is "ContextMenu".</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">init</span>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><a href="ContextMenuTool.html" class="tsd-signature-type tsd-kind-class">ContextMenuTool</a><span class="tsd-signature-symbol">></span></h5></li></ul></div><h4 class="tsd-returns-title">Returns <a href="ContextMenuTool.html" class="tsd-signature-type tsd-kind-class">ContextMenuTool</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Accessors</h2><section class="tsd-panel tsd-member"><a id="currentContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>current<wbr/>Context<wbr/>Menu</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Adornment.html" class="tsd-signature-type tsd-kind-class">Adornment</a><span class="tsd-signature-symbol"> | </span><a href="HTMLInfo.html" class="tsd-signature-type tsd-kind-class">HTMLInfo</a></div><a href="#currentContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the currently showing context menu, or null if there is none.
This is typically only set in <a href="ContextMenuTool.html#showContextMenu" class="tsd-kind-method">showContextMenu</a> and not by the user.
It is also typically set to null in <a href="ContextMenuTool.html#hideContextMenu" class="tsd-kind-method">hideContextMenu</a>.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="currentObject" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>current<wbr/>Object</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a></div><a href="#currentObject" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> found at the mouse point that has a context menu.
This property remembers the result returned by <a href="ContextMenuTool.html#findObjectWithContextMenu" class="tsd-kind-method">findObjectWithContextMenu</a> if it is a GraphObject.
This value is passed to <a href="ContextMenuTool.html#showContextMenu" class="tsd-kind-method">showContextMenu</a> as the second argument.
The value will be null if the context menu is for the diagram rather than for a particular GraphObject.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="defaultTouchContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>default<wbr/>Touch<wbr/>Context<wbr/>Menu</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Adornment.html" class="tsd-signature-type tsd-kind-class">Adornment</a><span class="tsd-signature-symbol"> | </span><a href="HTMLInfo.html" class="tsd-signature-type tsd-kind-class">HTMLInfo</a></div><a href="#defaultTouchContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the HTMLInfo or Adornment that acts as the default touch context menu.
On touch devices, this context menu will appear even there is no context menu defined.</p>
<p>You can disable this functionality by setting this property to null.</p>
<p>By default shows a set of HTML elements acting as a context menu.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="mouseDownPoint" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadOnly">Readonly</code><span>mouse<wbr/>Down<wbr/>Point</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a></div><a href="#mouseDownPoint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>This read-only property returns the original mouse-down point in document coordinates.</p>
</div></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member"><a id="canStart" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><code class="tsd-tag ts-flagOverride">Override</code><span>can<wbr/>Start</span><a href="#canStart" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="canStart.canStart-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">can<wbr/>Start</span><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><a href="#canStart.canStart-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Return true if it's a single mouse right click that hasn't moved <a href="Tool.html#isBeyondDragSize" class="tsd-kind-method">Tool.isBeyondDragSize</a>
and that is on a <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> with a <a href="GraphObject.html#contextMenu" class="tsd-kind-accessor">GraphObject.contextMenu</a>.
This is also true if the mouse right click is in the diagram background
and the diagram's <a href="Diagram.html#contextMenu" class="tsd-kind-accessor">Diagram.contextMenu</a> is non-null.</p>
<p>On touch devices, a special default context menu will appear even if no object with a context menu is found.</p>
<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><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="doActivate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOverride">Override</code><span>do<wbr/>Activate</span><a href="#doActivate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="doActivate.doActivate-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">do<wbr/>Activate</span><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><a href="#doActivate.doActivate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Do nothing, activation is special and relies on doMouseUp</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="doMouseDown" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOverride">Override</code><span>do<wbr/>Mouse<wbr/>Down</span><a href="#doMouseDown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="doMouseDown.doMouseDown-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">do<wbr/>Mouse<wbr/>Down</span><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><a href="#doMouseDown.doMouseDown-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Activate this but also execute the normal behavior that would happen on a mouse-up
if this tool is in the <a href="ToolManager.html#mouseDownTools" class="tsd-kind-accessor">ToolManager.mouseDownTools</a> list.
Perform <a href="ActionTool.html#doMouseDown" class="tsd-kind-method">ActionTool.doMouseDown</a> if a ContextMenuButton was hit.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="doMouseMove" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOverride">Override</code><span>do<wbr/>Mouse<wbr/>Move</span><a href="#doMouseMove" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="doMouseMove.doMouseMove-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">do<wbr/>Mouse<wbr/>Move</span><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><a href="#doMouseMove.doMouseMove-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Handle mouse-enter, mouse-over, and mouse-leave events, as well as tooltips.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="doMouseUp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOverride">Override</code><span>do<wbr/>Mouse<wbr/>Up</span><a href="#doMouseUp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="doMouseUp.doMouseUp-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">do<wbr/>Mouse<wbr/>Up</span><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><a href="#doMouseUp.doMouseUp-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>If there is something found by <a href="ContextMenuTool.html#findObjectWithContextMenu" class="tsd-kind-method">findObjectWithContextMenu</a>,
call <a href="ContextMenuTool.html#showContextMenu" class="tsd-kind-method">showContextMenu</a> with that object's <a href="GraphObject.html#contextMenu" class="tsd-kind-accessor">GraphObject.contextMenu</a>
or the <a href="Diagram.html#contextMenu" class="tsd-kind-accessor">Diagram.contextMenu</a>.</p>
<p>Once a context menu is being shown,
if a click occurs on a part of the context menu, call <a href="Tool.html#standardMouseClick" class="tsd-kind-method">Tool.standardMouseClick</a>.
Otherwise if the click occurs elsewhere, just stop this tool.
Unlike most tools, the first mouse-up should not stop this tool.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="findObjectWithContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><span>find<wbr/>Object<wbr/>With<wbr/>Context<wbr/>Menu</span><a href="#findObjectWithContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findObjectWithContextMenu.findObjectWithContextMenu-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>Object<wbr/>With<wbr/>Context<wbr/>Menu</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">?: </span><a href="Diagram.html" class="tsd-signature-type tsd-kind-class">Diagram</a><span class="tsd-signature-symbol"> | </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Diagram.html" class="tsd-signature-type tsd-kind-class">Diagram</a><span class="tsd-signature-symbol"> | </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a><a href="#findObjectWithContextMenu.findObjectWithContextMenu-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Find a <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> at the current mouse point with a <a href="GraphObject.html#contextMenu" class="tsd-kind-accessor">GraphObject.contextMenu</a>,
or return the <a href="Diagram.html" class="tsd-kind-class">Diagram</a> if there is a <a href="Diagram.html#contextMenu" class="tsd-kind-accessor">Diagram.contextMenu</a>.</p>
<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 class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">obj</span>: <a href="Diagram.html" class="tsd-signature-type tsd-kind-class">Diagram</a><span class="tsd-signature-symbol"> | </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a></h5><div class="tsd-comment tsd-typography"><p>Optional GraphObject with which to start searching for a context menu.
If null, the Diagram will be used. If no argument is specified, this method will look for an object at the current mouse point.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Diagram.html" class="tsd-signature-type tsd-kind-class">Diagram</a><span class="tsd-signature-symbol"> | </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a></h4><p>something with a <code>contextMenu</code>,
or null if nothing can be found with a context menu at the current mouse point.</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="hideContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><span>hide<wbr/>Context<wbr/>Menu</span><a href="#hideContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="hideContextMenu.hideContextMenu-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">hide<wbr/>Context<wbr/>Menu</span><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><a href="#hideContextMenu.hideContextMenu-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Hide any context menu.</p>
<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><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="hideDefaultContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><span>hide<wbr/>Default<wbr/>Context<wbr/>Menu</span><a href="#hideDefaultContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="hideDefaultContextMenu.hideDefaultContextMenu-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">hide<wbr/>Default<wbr/>Context<wbr/>Menu</span><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><a href="#hideDefaultContextMenu.hideDefaultContextMenu-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>This is the <a href="HTMLInfo.html#hide" class="tsd-kind-accessor">HTMLInfo.hide</a> method for the <a href="ContextMenuTool.html#defaultTouchContextMenu" class="tsd-kind-accessor">defaultTouchContextMenu</a>.</p>
<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><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="positionContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><span>position<wbr/>Context<wbr/>Menu</span><a href="#positionContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="positionContextMenu.positionContextMenu-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">position<wbr/>Context<wbr/>Menu</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">contextmenu</span><span class="tsd-signature-symbol">: </span><a href="Adornment.html" class="tsd-signature-type tsd-kind-class">Adornment</a>, <span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#positionContextMenu.positionContextMenu-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>This is called by <a href="ContextMenuTool.html#showContextMenu" class="tsd-kind-method">showContextMenu</a> to position the context menu within the viewport.
It normally goes just below the cursor.
But if the mouse is too close to the right edge or the bottom edge of the viewport,
it is positioned left and/or above the cursor.</p>
<p>This method only operates if the context menu, an <a href="Adornment.html" class="tsd-kind-class">Adornment</a>, does not have a <a href="Adornment.html#placeholder" class="tsd-kind-accessor">Adornment.placeholder</a>.
When there is a <a href="Placeholder.html" class="tsd-kind-class">Placeholder</a> in the context menu, that Adornment is automatically positioned
so that the Placeholder is positioned at the adorned object, the second argument to this method.</p>
<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>
<p>If you override this method to position the context menu,
the context menu has already been measured but not arranged,
so you can use its <a href="GraphObject.html#measuredBounds" class="tsd-kind-accessor">GraphObject.measuredBounds</a> width and height
but not its <a href="GraphObject.html#actualBounds" class="tsd-kind-accessor">GraphObject.actualBounds</a>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">contextmenu</span>: <a href="Adornment.html" class="tsd-signature-type tsd-kind-class">Adornment</a></h5></li><li><h5><span class="tsd-kind-parameter">obj</span>: <a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a></h5><div class="tsd-comment tsd-typography"><p>The <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> getting the context menu,
or null if the context menu is for the diagram background.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="showContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><span>show<wbr/>Context<wbr/>Menu</span><a href="#showContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="showContextMenu.showContextMenu-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">show<wbr/>Context<wbr/>Menu</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">contextmenu</span><span class="tsd-signature-symbol">: </span><a href="Adornment.html" class="tsd-signature-type tsd-kind-class">Adornment</a><span class="tsd-signature-symbol"> | </span><a href="HTMLInfo.html" class="tsd-signature-type tsd-kind-class">HTMLInfo</a>, <span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#showContextMenu.showContextMenu-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Show an <a href="Adornment.html" class="tsd-kind-class">Adornment</a> or <a href="HTMLInfo.html" class="tsd-kind-class">HTMLInfo</a> as a context menu.</p>
<p>This method is called by the context click (<a href="Tool.html#doMouseDown" class="tsd-kind-method">Tool.doMouseDown</a>) and <a href="CommandHandler.html#showContextMenu" class="tsd-kind-method">CommandHandler.showContextMenu</a>.
If you want to programmatically show a context menu for a particular GraphObject or for the
whole diagram, do not call this method, which only does one small piece of the process of
bringing up a context menu.
Instead call <a href="CommandHandler.html#showContextMenu" class="tsd-kind-method">CommandHandler.showContextMenu</a>, which will start this tool
and eventually call this method and handle additional input events.</p>
<p>For <a href="Adornment.html" class="tsd-kind-class">Adornment</a> context menus: If the object's containing <a href="Part.html" class="tsd-kind-class">Part</a> is data-bound,
this sets the contextmenu's <code>Part.data</code> to the same value.
The <a href="Adornment.html#adornedObject" class="tsd-kind-accessor">Adornment.adornedObject</a> property is set to the <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> for which the menu is being shown.</p>
<p>This method sets the <a href="ContextMenuTool.html#currentContextMenu" class="tsd-kind-accessor">currentContextMenu</a>.</p>
<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 class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">contextmenu</span>: <a href="Adornment.html" class="tsd-signature-type tsd-kind-class">Adornment</a><span class="tsd-signature-symbol"> | </span><a href="HTMLInfo.html" class="tsd-signature-type tsd-kind-class">HTMLInfo</a></h5></li><li><h5><span class="tsd-kind-parameter">obj</span>: <a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a></h5><div class="tsd-comment tsd-typography"><p>the <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> for which the context menu is being shown;
this is null if the contextmenu is being shown for the diagram background.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="showDefaultContextMenu" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagVirtual">Virtual</code><span>show<wbr/>Default<wbr/>Context<wbr/>Menu</span><a href="#showDefaultContextMenu" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="showDefaultContextMenu.showDefaultContextMenu-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">show<wbr/>Default<wbr/>Context<wbr/>Menu</span><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><a href="#showDefaultContextMenu.showDefaultContextMenu-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>This is the <a href="HTMLInfo.html#show" class="tsd-kind-accessor">HTMLInfo.show</a> method for the <a href="ContextMenuTool.html#defaultTouchContextMenu" class="tsd-kind-accessor">defaultTouchContextMenu</a>.</p>
<p>If the object's containing <a href="Part.html" class="tsd-kind-class">Part</a> is data-bound,
set the contextmenu's <code>Part.data</code> to the same value.
The <a href="Adornment.html#adornedObject" class="tsd-kind-accessor">Adornment.adornedObject</a> property is set to the <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a>
for which the menu is being shown.</p>
<p>The menu carries some default CSS styling and uses the following CSS classes:</p>
<ul>
<li><code>goCXforeground</code> for the DIV containing the buttons</li>
<li><code>goCXbackground</code> for the darker DIV behind the context menu</li>
<li><code>goCXul</code> for the HTML <code>ul</code> items</li>
<li><code>goCXli</code> for the HTML <code>li</code> tag items</li>
<li><code>goCXa</code> for the HTML <code>a</code> tag items</li>
</ul>
<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><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><ul><li><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></li><li><a href="#currentContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>current<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#currentObject"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>current<wbr/>Object</span></a></li><li><a href="#defaultTouchContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>default<wbr/>Touch<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#mouseDownPoint"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>mouse<wbr/>Down<wbr/>Point</span></a></li><li><a href="#canStart"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>can<wbr/>Start</span></a></li><li><a href="#doActivate"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Activate</span></a></li><li><a href="#doMouseDown"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Mouse<wbr/>Down</span></a></li><li><a href="#doMouseMove"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Mouse<wbr/>Move</span></a></li><li><a href="#doMouseUp"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>do<wbr/>Mouse<wbr/>Up</span></a></li><li><a href="#findObjectWithContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Object<wbr/>With<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#hideContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>hide<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#hideDefaultContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>hide<wbr/>Default<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#positionContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>position<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#showContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>show<wbr/>Context<wbr/>Menu</span></a></li><li><a href="#showDefaultContextMenu"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>show<wbr/>Default<wbr/>Context<wbr/>Menu</span></a></li></ul></div></details><div class="tsd-navigation settings"><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">System</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>GoJS API</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><div class="tsd w-full max-w-screen-xl mx-auto px-2"><div class="bottom-copyright">Copyright © 1998-2025 by Northwoods Software Corporation.</div></div><div class="overlay"></div><script async src="https://www.googletagmanager.com/gtag/js?id=G-S5QK8VSK84"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-S5QK8VSK84');
var getOutboundLink = function(url, label) {
gtag('event', 'click', {
'event_category': 'outbound',
'event_label': label,
'transport_type': 'beacon'
});
}
document.getElementById("contactBtn").addEventListener("click", function() {
getOutboundLink('https://nwoods.com/contact.html', 'contact');
});
document.getElementById("buyBtn").addEventListener("click", function() {
getOutboundLink('https://nwoods.com/sales/index.html', 'buy');
});</script></body></html>