maxGraph/docs/api/classes/AutoSaveManager.html

80 lines
43 KiB
HTML

<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>AutoSaveManager | @maxgraph/core</title><meta name="description" content="Documentation for @maxgraph/core"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@maxgraph/core</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">@maxgraph/core</a></li><li><a href="AutoSaveManager.html">AutoSaveManager</a></li></ul><h1>Class AutoSaveManager</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Manager for automatically saving diagrams. The <save> hook must be
implemented.</p>
</div><div><pre><code class="language-javascript"><span class="hl-3">var</span><span class="hl-1"> </span><span class="hl-0">mgr</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-2">AutoSaveManager</span><span class="hl-1">(</span><span class="hl-0">editor</span><span class="hl-1">.</span><span class="hl-0">graph</span><span class="hl-1">);</span><br/><span class="hl-0">mgr</span><span class="hl-1">.</span><span class="hl-2">save</span><span class="hl-1">()</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-0">MaxLog</span><span class="hl-1">.</span><span class="hl-2">show</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-0">MaxLog</span><span class="hl-1">.</span><span class="hl-2">debug</span><span class="hl-1">(</span><span class="hl-6">&#39;save&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">};</span>
</code></pre>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="EventSource.html" class="tsd-signature-type" data-tsd-kind="Class">EventSource</a><ul class="tsd-hierarchy"><li><span class="target">AutoSaveManager</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="AutoSaveManager.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#autoSaveDelay" class="tsd-kind-icon">auto<wbr/>Save<wbr/>Delay</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#autoSaveThreshold" class="tsd-kind-icon">auto<wbr/>Save<wbr/>Threshold</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#autoSaveThrottle" class="tsd-kind-icon">auto<wbr/>Save<wbr/>Throttle</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#changeHandler" class="tsd-kind-icon">change<wbr/>Handler</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#eventListeners" class="tsd-kind-icon">event<wbr/>Listeners</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#eventSource" class="tsd-kind-icon">event<wbr/>Source</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#eventsEnabled" class="tsd-kind-icon">events<wbr/>Enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#graph" class="tsd-kind-icon">graph</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#ignoredChanges" class="tsd-kind-icon">ignored<wbr/>Changes</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#lastSnapshot" class="tsd-kind-icon">last<wbr/>Snapshot</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#addListener" class="tsd-kind-icon">add<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#destroy" class="tsd-kind-icon">destroy</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#fireEvent" class="tsd-kind-icon">fire<wbr/>Event</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#getEventSource" class="tsd-kind-icon">get<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#graphModelChanged" class="tsd-kind-icon">graph<wbr/>Model<wbr/>Changed</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#isEnabled" class="tsd-kind-icon">is<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#isEventsEnabled" class="tsd-kind-icon">is<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#removeListener" class="tsd-kind-icon">remove<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#reset" class="tsd-kind-icon">reset</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#save" class="tsd-kind-icon">save</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#setEnabled" class="tsd-kind-icon">set<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#setEventSource" class="tsd-kind-icon">set<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#setEventsEnabled" class="tsd-kind-icon">set<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#setGraph" class="tsd-kind-icon">set<wbr/>Graph</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 tsd-is-overwrite"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><li class="tsd-signature tsd-kind-icon">new <wbr/>Auto<wbr/>Save<wbr/>Manager<span class="tsd-signature-symbol">(</span>graph<span class="tsd-signature-symbol">: </span><a href="Graph.html" class="tsd-signature-type" data-tsd-kind="Class">Graph</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="AutoSaveManager.html" class="tsd-signature-type" data-tsd-kind="Class">AutoSaveManager</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Overrides <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#constructor">constructor</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L28">view/other/AutoSaveManager.ts:28</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>graph: <a href="Graph.html" class="tsd-signature-type" data-tsd-kind="Class">Graph</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="AutoSaveManager.html" class="tsd-signature-type" data-tsd-kind="Class">AutoSaveManager</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-property tsd-parent-kind-class"><a id="autoSaveDelay" class="tsd-anchor"></a><h3>auto<wbr/>Save<wbr/>Delay</h3><div class="tsd-signature tsd-kind-icon">auto<wbr/>Save<wbr/>Delay<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 10</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L51">view/other/AutoSaveManager.ts:51</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Minimum amount of seconds between two consecutive autosaves. Eg. a
value of 1 (s) means the graph is not stored more than once per second.
Default is 10.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="autoSaveThreshold" class="tsd-anchor"></a><h3>auto<wbr/>Save<wbr/>Threshold</h3><div class="tsd-signature tsd-kind-icon">auto<wbr/>Save<wbr/>Threshold<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 5</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L67">view/other/AutoSaveManager.ts:67</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Minimum amount of ignored changes before an autosave. Eg. a value of 2
means after 2 change of the graph model the autosave will trigger if the
condition below is true. Default is 5.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="autoSaveThrottle" class="tsd-anchor"></a><h3>auto<wbr/>Save<wbr/>Throttle</h3><div class="tsd-signature tsd-kind-icon">auto<wbr/>Save<wbr/>Throttle<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 2</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L60">view/other/AutoSaveManager.ts:60</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Minimum amount of seconds between two consecutive autosaves triggered by
more than <autoSaveThreshhold> changes within a timespan of less than
<autoSaveDelay> seconds. Eg. a value of 1 (s) means the graph is not
stored more than once per second even if there are more than
<autoSaveThreshold> changes within that timespan. Default is 2.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="changeHandler" class="tsd-anchor"></a><h3>change<wbr/>Handler</h3><div class="tsd-signature tsd-kind-icon">change<wbr/>Handler<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Function</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L87">view/other/AutoSaveManager.ts:87</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the function that handles graph model changes.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L82">view/other/AutoSaveManager.ts:82</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Specifies if event handling is enabled. Default is true.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="eventListeners" class="tsd-anchor"></a><h3>event<wbr/>Listeners</h3><div class="tsd-signature tsd-kind-icon">event<wbr/>Listeners<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">EventListenerObject</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#eventListeners">eventListeners</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L45">view/event/EventSource.ts:45</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the event names and associated listeners in an array. The array
contains the event name followed by the respective listener for each
registered listener.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="eventSource" class="tsd-anchor"></a><h3>event<wbr/>Source</h3><div class="tsd-signature tsd-kind-icon">event<wbr/>Source<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#eventSource">eventSource</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L55">view/event/EventSource.ts:55</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional source for events. Default is null.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="eventsEnabled" class="tsd-anchor"></a><h3>events<wbr/>Enabled</h3><div class="tsd-signature tsd-kind-icon">events<wbr/>Enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#eventsEnabled">eventsEnabled</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L50">view/event/EventSource.ts:50</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Specifies if events can be fired. Default is true.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="graph" class="tsd-anchor"></a><h3>graph</h3><div class="tsd-signature tsd-kind-icon">graph<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Graph.html" class="tsd-signature-type" data-tsd-kind="Class">Graph</a><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L44">view/other/AutoSaveManager.ts:44</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Reference to the enclosing <a href="Graph.html">Graph</a>.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="ignoredChanges" class="tsd-anchor"></a><h3>ignored<wbr/>Changes</h3><div class="tsd-signature tsd-kind-icon">ignored<wbr/>Changes<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L72">view/other/AutoSaveManager.ts:72</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Counter for ignored changes in autosave.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="lastSnapshot" class="tsd-anchor"></a><h3>last<wbr/>Snapshot</h3><div class="tsd-signature tsd-kind-icon">last<wbr/>Snapshot<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L77">view/other/AutoSaveManager.ts:77</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Used for autosaving. See <autosave>.</p>
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="addListener" class="tsd-anchor"></a><h3>add<wbr/>Listener</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">add<wbr/>Listener<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, funct<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#addListener">addListener</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L91">view/event/EventSource.ts:91</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Binds the specified function to the given event name. If no event name
is given, then the listener is registered for all events.</p>
</div><div><p>The parameters of the listener are the sender and an <a href="EventObject.html">EventObject</a>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>funct: <span class="tsd-signature-type">Function</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="destroy" class="tsd-anchor"></a><h3>destroy</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">destroy<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L159">view/other/AutoSaveManager.ts:159</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Removes all handlers from the <graph> and deletes the reference to it.</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 tsd-is-inherited"><a id="fireEvent" class="tsd-anchor"></a><h3>fire<wbr/>Event</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">fire<wbr/>Event<span class="tsd-signature-symbol">(</span>evt<span class="tsd-signature-symbol">: </span><a href="EventObject.html" class="tsd-signature-type" data-tsd-kind="Class">EventObject</a>, sender<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#fireEvent">fireEvent</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L125">view/event/EventSource.ts:125</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Dispatches the given event to the listeners which are registered for
the event. The sender argument is optional. The current execution scope
(&quot;this&quot;) is used for the listener invocation (see {@link Utils#bind}).</p>
</div><div><p>Example:</p>
<pre><code class="language-javascript"><span class="hl-2">fireEvent</span><span class="hl-1">(</span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-2">mxEventObject</span><span class="hl-1">(</span><span class="hl-6">&quot;eventName&quot;</span><span class="hl-1">, </span><span class="hl-0">key1</span><span class="hl-1">, </span><span class="hl-0">val1</span><span class="hl-1">, .., </span><span class="hl-0">keyN</span><span class="hl-1">, </span><span class="hl-0">valN</span><span class="hl-1">))</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>evt: <a href="EventObject.html" class="tsd-signature-type" data-tsd-kind="Class">EventObject</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="EventObject.html">EventObject</a> that represents the event.</p>
</div></div></li><li><h5>sender: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional sender to be passed to the listener. Default value is
the return value of <getEventSource>.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="getEventSource" class="tsd-anchor"></a><h3>get<wbr/>Event<wbr/>Source</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">get<wbr/>Event<wbr/>Source<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#getEventSource">getEventSource</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L74">view/event/EventSource.ts:74</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns <eventSource>.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="graphModelChanged" class="tsd-anchor"></a><h3>graph<wbr/>Model<wbr/>Changed</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">graph<wbr/>Model<wbr/>Changed<span class="tsd-signature-symbol">(</span>changes<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L132">view/other/AutoSaveManager.ts:132</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Invoked when the graph model has changed.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>changes: <span class="tsd-signature-type">any</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="isEnabled" class="tsd-anchor"></a><h3>is<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">is<wbr/>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L93">view/other/AutoSaveManager.ts:93</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns true if events are handled. This implementation
returns <enabled>.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="isEventsEnabled" class="tsd-anchor"></a><h3>is<wbr/>Events<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">is<wbr/>Events<wbr/>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#isEventsEnabled">isEventsEnabled</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L60">view/event/EventSource.ts:60</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns <eventsEnabled>.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="removeListener" class="tsd-anchor"></a><h3>remove<wbr/>Listener</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">remove<wbr/>Listener<span class="tsd-signature-symbol">(</span>funct<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#removeListener">removeListener</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L98">view/event/EventSource.ts:98</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Removes all occurrences of the given listener from <eventListeners>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>funct: <span class="tsd-signature-type">Function</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="reset" class="tsd-anchor"></a><h3>reset</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">reset<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L151">view/other/AutoSaveManager.ts:151</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Resets all counters.</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="save" class="tsd-anchor"></a><h3>save</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">save<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L125">view/other/AutoSaveManager.ts:125</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Empty hook that is called if the graph should be saved.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="setEnabled" class="tsd-anchor"></a><h3>set<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">set<wbr/>Enabled<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L103">view/other/AutoSaveManager.ts:103</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Enables or disables event handling. This implementation
updates <enabled>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setEventSource" class="tsd-anchor"></a><h3>set<wbr/>Event<wbr/>Source</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Event<wbr/>Source<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#setEventSource">setEventSource</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L81">view/event/EventSource.ts:81</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets <eventSource>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setEventsEnabled" class="tsd-anchor"></a><h3>set<wbr/>Events<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Events<wbr/>Enabled<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#setEventsEnabled">setEventsEnabled</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L67">view/event/EventSource.ts:67</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets <eventsEnabled>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="setGraph" class="tsd-anchor"></a><h3>set<wbr/>Graph</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">set<wbr/>Graph<span class="tsd-signature-symbol">(</span>graph<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Graph.html" class="tsd-signature-type" data-tsd-kind="Class">Graph</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/other/AutoSaveManager.ts#L110">view/other/AutoSaveManager.ts:110</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets the graph that the layouts operate on.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>graph: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Graph.html" class="tsd-signature-type" data-tsd-kind="Class">Graph</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class=" tsd-kind-namespace"><a href="../modules/DomHelpers.html">Dom<wbr/>Helpers</a></li><li class=" tsd-kind-namespace"><a href="../modules/cloneUtils.html">clone<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/constants.html">constants</a></li><li class=" tsd-kind-namespace"><a href="../modules/domUtils.html">dom<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/eventUtils.html">event<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/gestureUtils.html">gesture<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/mathUtils.html">math<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/stringUtils.html">string<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/styleUtils.html">style<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/xmlUtils.html">xml<wbr/>Utils</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="AutoSaveManager.html" class="tsd-kind-icon">Auto<wbr/>Save<wbr/>Manager</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="AutoSaveManager.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#autoSaveDelay" class="tsd-kind-icon">auto<wbr/>Save<wbr/>Delay</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#autoSaveThreshold" class="tsd-kind-icon">auto<wbr/>Save<wbr/>Threshold</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#autoSaveThrottle" class="tsd-kind-icon">auto<wbr/>Save<wbr/>Throttle</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#changeHandler" class="tsd-kind-icon">change<wbr/>Handler</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#eventListeners" class="tsd-kind-icon">event<wbr/>Listeners</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#eventSource" class="tsd-kind-icon">event<wbr/>Source</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#eventsEnabled" class="tsd-kind-icon">events<wbr/>Enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#graph" class="tsd-kind-icon">graph</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#ignoredChanges" class="tsd-kind-icon">ignored<wbr/>Changes</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="AutoSaveManager.html#lastSnapshot" class="tsd-kind-icon">last<wbr/>Snapshot</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#addListener" class="tsd-kind-icon">add<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#destroy" class="tsd-kind-icon">destroy</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#fireEvent" class="tsd-kind-icon">fire<wbr/>Event</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#getEventSource" class="tsd-kind-icon">get<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#graphModelChanged" class="tsd-kind-icon">graph<wbr/>Model<wbr/>Changed</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#isEnabled" class="tsd-kind-icon">is<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#isEventsEnabled" class="tsd-kind-icon">is<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#removeListener" class="tsd-kind-icon">remove<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#reset" class="tsd-kind-icon">reset</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#save" class="tsd-kind-icon">save</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#setEnabled" class="tsd-kind-icon">set<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#setEventSource" class="tsd-kind-icon">set<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="AutoSaveManager.html#setEventsEnabled" class="tsd-kind-icon">set<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="AutoSaveManager.html#setGraph" class="tsd-kind-icon">set<wbr/>Graph</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>