<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxAutoSaveManager"></a>mxAutoSaveManager</h1><divclass=CBody><p>Manager for automatically saving diagrams. The <ahref="#mxAutoSaveManager.save"class=LFunctionid=link20onMouseOver="ShowTip(event, 'tt14', 'link20')"onMouseOut="HideTip('tt14')">save</a> hook must be implemented.</p><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint">var mgr = new mxAutoSaveManager(editor.graph);
mgr.save = function()
{
mxLog.show();
mxLog.debug('save');
};</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxAutoSaveManager">mxAutoSaveManager</a></td><tdclass=SDescription>Manager for automatically saving diagrams. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxAutoSaveManager.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxAutoSaveManager.mxAutoSaveManager"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxAutoSaveManager</a></td><tdclass=SDescription>Constructs a new automatic layout for the given graph.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxAutoSaveManager.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxAutoSaveManager.graph"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">graph</a></td><tdclass=SDescription>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">mxGraph</a>.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxAutoSaveManager.autoSaveDelay"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">autoSaveDelay</a></td><tdclass=SDescription>Minimum amount of seconds between two consecutive autosaves. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxAutoSaveManager.autoSaveThrottle"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">autoSaveThrottle</a></td><tdclass=SDescription>Minimum amount of seconds between two consecutive autosaves triggered by more than <autoSaveThreshhold> changes within a timespan of less than <ahref="#mxAutoSaveManager.autoSaveDelay"class=LVariableid=link6onMouseOver="ShowTip(event, 'tt4', 'link6')"onMouseOut="HideTip('tt4')">autoSaveDelay</a> seconds. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxAutoSaveManager.autoSaveThreshold"id=link7onMouseOver="ShowTip(event, 'tt6', 'link7')"onMouseOut="HideTip('tt6')">autoSaveThreshold</a></td><tdclass=SDescription>Minimum amount of ignored changes before an autosave. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxAutoSaveManager.ignoredChanges"id=link8onMouseOver="ShowTip(event, 'tt7', 'link8')"onMouseOut="HideTip('tt7')">ignoredChanges</a></td><tdclass=SDescription>Counter for ignored changes in autosave.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxAutoSaveManager.lastSnapshot"id=link9onMouseOver="ShowTip(event, 'tt8', 'link9')"onMouseOut="HideTip('tt8')">lastSnapshot</a></td><tdclass=SDescription>Used for autosaving. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxAutoSaveManager.enabled"id=link10onMouseOver="ShowTip(event, 'tt9', 'link10')"onMouseOut="HideTip('tt9')">enabled</a></td><tdclass=SDescription>Specifies if event handling is enabled. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxAutoSaveManager.changeHandler"id=link11onMouseOver="ShowTip(event, 'tt10', 'link11')"onMouseOut="HideTip('tt10')">changeHandler</a></td><tdclass=SDescription>Holds the function that handles graph model changes.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxAutoSaveManager.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxAutoSaveManager.isEnabled"id=link12onMouseOver="ShowTip(event, 'tt11', 'link12')"onMouseOut="HideTip('tt11')">isEnabled</a></td><tdclass=SDescription>Returns true if events are handled. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxAutoSaveManager.setEnabled"id=link13onMouseOver="ShowTip(event, 'tt12', 'link13')"onMouseOut="HideTip('tt12')">s
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.mxAutoSaveManager"></a>mxAutoSaveManager</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxAutoSaveManager(</td><tdclass=PParameternowrap>graph</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new automatic layout for the given graph.</p><h4class=CHeading>Arguments</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription>Reference to the enclosing graph.</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.graph"></a>graph</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.graph</td></tr></table></blockquote><p>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link21onMouseOver="ShowTip(event, 'tt3', 'link21')"onMouseOut="HideTip('tt3')">mxGraph</a>.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.autoSaveDelay"></a>autoSaveDelay</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.autoSaveDelay</td></tr></table></blockquote><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></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.autoSaveThrottle"></a>autoSaveThrottle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.autoSaveThrottle</td></tr></table></blockquote><p>Minimum amount of seconds between two consecutive autosaves triggered by more than <autoSaveThreshhold> changes within a timespan of less than <ahref="#mxAutoSaveManager.autoSaveDelay"class=LVariableid=link22onMouseOver="ShowTip(event, 'tt4', 'link22')"onMouseOut="HideTip('tt4')">autoSaveDelay</a> seconds. Eg. a value of 1 (s) means the graph is not stored more than once per second even if there are more than <ahref="#mxAutoSaveManager.autoSaveThreshold"class=LVariableid=link23onMouseOver="ShowTip(event, 'tt6', 'link23')"onMouseOut="HideTip('tt6')">autoSaveThreshold</a> changes within that timespan. Default is 2.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.autoSaveThreshold"></a>autoSaveThreshold</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.autoSaveThreshold</td></tr></table></blockquote><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></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.ignoredChanges"></a>ignoredChanges</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.ignoredChanges</td></tr></table></blockquote><p>Counter for ignored changes in autosave.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.lastSnapshot"></a>lastSnapshot</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.lastSnapshot</td></tr></table></blockquote><p>Used for autosaving. See <autosave>.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.enabled"></a>enabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.enabled</td></tr></table></blockquote><p>Specifies if event handling is enabled. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.changeHandler"></a>changeHandler</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.changeHandler</td></tr></table></blockquote><p>Holds the function that handles graph model changes.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.isEnabled"></a>isEnabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.isEnabled = function()</td></tr></table></blockquote><p>Returns true if events are handled. This implementation returns <ahref="#mxAutoSaveManager.enabled"class=LVariableid=link24onMouseOver="ShowTip(event, 'tt9', 'link24')"onMouseOut="HideTip('tt9')">enabled</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.setEnabled"></a>setEnabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxAutoSaveManager.prototype.setEnabled = function(</td><tdclass=PParameternowrap>value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Enables or disables event handling. This implementation updates <ahref="#mxAutoSaveManager.enabled"class=LVariableid=link25onMouseOver="ShowTip(event, 'tt9', 'link25')"onMouseOut="HideTip('tt9')">enabled</a>.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>enabled</td><tdclass=CDLDescription>Boolean that specifies the new enabled state.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.setGraph"></a>setGraph</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxAutoSaveManager.prototype.setGraph = function(</td><tdclass=PParameternowrap>graph</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the graph that the layouts operate on.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.save"></a>save</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.save = function()</td></tr></table></blockquote><p>Empty hook that is called if the graph should be saved.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.graphModelChanged"></a>graphModelChanged</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxAutoSaveManager.prototype.graphModelChanged = function(</td><tdclass=PParameternowrap>changes</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Invoked when the graph model has changed.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.reset"></a>reset</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.reset = function()</td></tr></table></blockquote><p>Resets all counters.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxAutoSaveManager.destroy"></a>destroy</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.destroy = function()</td></tr></table></blockquote><p>Removes all handlers from the <ahref="#mxAutoSaveManager.graph"class=LVariableid=link26onMouseOver="ShowTip(event, 'tt2', 'link26')"onMouseOut="HideTip('tt2')">graph</a> and deletes the reference to it.</p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxAutoSaveManager(</td><tdclass=PParameternowrap>graph</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new automatic layout for the given graph.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.graph</td></tr></table></blockquote>Reference to the enclosing mxGraph.</div></div><divclass=CToolTipid="tt3"><divclass=CClass>Extends mxEventSource to implement a graph component for the browser. </div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.autoSaveDelay</td></tr></table></blockquote>Minimum amount of seconds between two consecutive autosaves. </div></div><divclass=CToolTipid="tt5"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.autoSaveThrottle</td></tr></table></blockquote>Minimum amount of seconds between two consecutive autosaves triggered by more than autoSaveThreshhold changes within a timespan of less than autoSaveDelay seconds. </div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.autoSaveThreshold</td></tr></table></blockquote>Minimum amount of ignored changes before an autosave. </div></div><divclass=CToolTipid="tt7"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.ignoredChanges</td></tr></table></blockquote>Counter for ignored changes in autosave.</div></div><divclass=CToolTipid="tt8"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.lastSnapshot</td></tr></table></blockquote>Used for autosaving. </div></div><divclass=CToolTipid="tt9"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.enabled</td></tr></table></blockquote>Specifies if event handling is enabled. </div></div><divclass=CToolTipid="tt10"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.changeHandler</td></tr></table></blockquote>Holds the function that handles graph model changes.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxAutoSaveManager.prototype.isEnabled = function()</td></tr></table></blockquote>Returns true if events are handled. </div></div><divclass=CToolTipid="tt12"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxAutoSaveManager.prototype.setEnabled = function(</td><tdclass=PParameternowrap>value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Enables or disables event handling. </div></div><divclass=CToolTipid="tt13"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxAutoSaveManager.prototype.setGraph = function(</td><tdclass=PParameternowrap>graph</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Sets the graph that the layouts operate on.</div></div><divclass=CToolTipid="tt14"><divclass=CFunctio