<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxUndoableEdit"></a>mxUndoableEdit</h1><divclass=CBody><p>Implements a composite undoable edit. Here is an example for a custom change which gets executed via the model:</p><blockquote><preclass="prettyprint">function CustomChange(model, name)
{
this.model = model;
this.name = name;
this.previous = name;
};
CustomChange.prototype.execute = function()
{
var tmp = this.model.name;
this.model.name = this.previous;
this.previous = tmp;
};
var name = prompt('Enter name');
graph.model.execute(new CustomChange(graph.model, name));</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxUndoableEdit">mxUndoableEdit</a></td><tdclass=SDescription>Implements a composite undoable edit. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxUndoableEdit.Events">Events</a></td><tdclass=SDescription></td></tr><trclass="SEvent SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.mxEvent.EXECUTED">mxEvent.<wbr>EXECUTED</a></td><tdclass=SDescription>Fires between START_EDIT and END_EDIT after an atomic change was executed. </td></tr><trclass="SEvent SIndent2"><tdclass=SEntry><ahref="#mxUndoableEdit.mxEvent.START_EDIT">mxEvent.<wbr>START_EDIT</a></td><tdclass=SDescription>Fires before a set of changes will be executed in <ahref="#mxUndoableEdit.undo"class=LFunctionid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">undo</a> or <ahref="#mxUndoableEdit.redo"class=LFunctionid=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">redo</a>. </td></tr><trclass="SEvent SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.mxEvent.END_EDIT">mxEvent.<wbr>END_EDIT</a></td><tdclass=SDescription>Fires after a set of changeswas executed in <ahref="#mxUndoableEdit.undo"class=LFunctionid=link3onMouseOver="ShowTip(event, 'tt1', 'link3')"onMouseOut="HideTip('tt1')">undo</a> or <ahref="#mxUndoableEdit.redo"class=LFunctionid=link4onMouseOver="ShowTip(event, 'tt2', 'link4')"onMouseOut="HideTip('tt2')">redo</a>. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxUndoableEdit.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.mxUndoableEdit"id=link5onMouseOver="ShowTip(event, 'tt3', 'link5')"onMouseOut="HideTip('tt3')">mxUndoableEdit</a></td><tdclass=SDescription>Constructs a new undoable edit for the given source.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxUndoableEdit.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.source"id=link6onMouseOver="ShowTip(event, 'tt4', 'link6')"onMouseOut="HideTip('tt4')">source</a></td><tdclass=SDescription>Specifies the source of the edit.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxUndoableEdit.changes"id=link7onMouseOver="ShowTip(event, 'tt5', 'link7')"onMouseOut="HideTip('tt5')">changes</a></td><tdclass=SDescription>Array that contains the changes that make up this edit. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.significant"id=link8onMouseOver="ShowTip(event, 'tt6', 'link8')"onMouseOut="HideTip('tt6')">significant</a></td><tdclass=SDescription>Specifies if the undoable change is significant. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxUndoableEdit.undone"id=link9onMouseOver="ShowTip(event, 'tt7', 'link9')"onMouseOut="HideTip('tt7')">undone</a></td><tdclass=SDescription>Specifies if this edit has been undone. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.redone"id=link10onMouseOver="ShowTip(event, 'tt8', 'link10')"onMouseOut="HideTip('tt8')">redone</a></td><tdclass=SDescription>Specifies if this edit has been redone. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxUndoableEdit.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUndoableEdit.isEmpty"id=link11onMouseOver="ShowTip(event, 'tt9', 'link11')"onMouseOut="HideTip('tt9')">isEmpty</a></td><tdclass=SDescription>Returns true if the this edit contains no changes.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxUndoableEdit.isSignificant"id=link12onMouseOver="S
<divclass="CEvent"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.mxEvent.EXECUTED"></a>mxEvent.<wbr>EXECUTED</h3><divclass=CBody><p>Fires between START_EDIT and END_EDIT after an atomic change was executed. The <code>change</code> property contains the change that was executed.</p></div></div></div>
<divclass="CEvent"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.mxEvent.START_EDIT"></a>mxEvent.<wbr>START_EDIT</h3><divclass=CBody><p>Fires before a set of changes will be executed in <ahref="#mxUndoableEdit.undo"class=LFunctionid=link21onMouseOver="ShowTip(event, 'tt1', 'link21')"onMouseOut="HideTip('tt1')">undo</a> or <ahref="#mxUndoableEdit.redo"class=LFunctionid=link22onMouseOver="ShowTip(event, 'tt2', 'link22')"onMouseOut="HideTip('tt2')">redo</a>. This event contains no properties.</p></div></div></div>
<divclass="CEvent"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.mxEvent.END_EDIT"></a>mxEvent.<wbr>END_EDIT</h3><divclass=CBody><p>Fires after a set of changeswas executed in <ahref="#mxUndoableEdit.undo"class=LFunctionid=link23onMouseOver="ShowTip(event, 'tt1', 'link23')"onMouseOut="HideTip('tt1')">undo</a> or <ahref="#mxUndoableEdit.redo"class=LFunctionid=link24onMouseOver="ShowTip(event, 'tt2', 'link24')"onMouseOut="HideTip('tt2')">redo</a>. This event contains no properties.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.mxUndoableEdit"></a>mxUndoableEdit</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxUndoableEdit(</td><tdclass=PParameternowrap>source,</td></tr><tr><td></td><tdclass=PParameternowrap>significant</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new undoable edit for the given source.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.source"></a>source</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.source</td></tr></table></blockquote><p>Specifies the source of the edit.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.changes"></a>changes</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.changes</td></tr></table></blockquote><p>Array that contains the changes that make up this edit. The changes are expected to either have an undo and redo function, or an execute function. Default is an empty array.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.significant"></a>significant</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.significant</td></tr></table></blockquote><p>Specifies if the undoable change is significant. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.undone"></a>undone</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.undone</td></tr></table></blockquote><p>Specifies if this edit has been undone. Default is false.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.redone"></a>redone</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.redone</td></tr></table></blockquote><p>Specifies if this edit has been redone. Default is false.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.isEmpty"></a>isEmpty</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.isEmpty = function()</td></tr></table></blockquote><p>Returns true if the this edit contains no changes.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.add"></a>add</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxUndoableEdit.prototype.add = function(</td><tdclass=PParameternowrap>change</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds the specified change to this edit. The change is an object that is expected to either have an undo and redo, or an execute function.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.notify"></a>notify</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.notify = function()</td></tr></table></blockquote><p>Hook to notify any listeners of the changes after an <ahref="#mxUndoableEdit.undo"class=LFunctionid=link26onMouseOver="ShowTip(event, 'tt1', 'link26')"onMouseOut="HideTip('tt1')">undo</a> or <ahref="#mxUndoableEdit.redo"class=LFunctionid=link27onMouseOver="ShowTip(event, 'tt2', 'link27')"onMouseOut="HideTip('tt2')">redo</a> has been carried out. This implementation is empty.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.die"></a>die</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.die = function()</td></tr></table></blockquote><p>Hook to free resources after the edit has been removed from the command history. This implementation is empty.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.undo"></a>undo</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.undo = function()</td></tr></table></blockquote><p>Undoes all changes in this edit.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUndoableEdit.redo"></a>redo</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.redo = function()</td></tr></table></blockquote><p>Redoes all changes in this edit.</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>mxUndoableEdit.prototype.undo = function()</td></tr></table></blockquote>Undoes all changes in this edit.</div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.redo = function()</td></tr></table></blockquote>Redoes all changes in this edit.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxUndoableEdit(</td><tdclass=PParameternowrap>source,</td></tr><tr><td></td><tdclass=PParameternowrap>significant</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new undoable edit for the given source.</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.source</td></tr></table></blockquote>Specifies the source of the edit.</div></div><divclass=CToolTipid="tt5"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.changes</td></tr></table></blockquote>Array that contains the changes that make up this edit. </div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.significant</td></tr></table></blockquote>Specifies if the undoable change is significant. </div></div><divclass=CToolTipid="tt7"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.undone</td></tr></table></blockquote>Specifies if this edit has been undone. </div></div><divclass=CToolTipid="tt8"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.redone</td></tr></table></blockquote>Specifies if this edit has been redone. </div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.isEmpty = function()</td></tr></table></blockquote>Returns true if the this edit contains no changes.</div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.isSignificant = function()</td></tr></table></blockquote>Returns significant.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxUndoableEdit.prototype.add = function(</td><tdclass=PParameternowrap>change</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds the specified change to this edit. </div></div><divclass=CToolTipid="tt12"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.notify = function()</td></tr></table></blockquote>Hook to notify any listeners of the changes after an undo or redo has been carried out. </div></div><divclass=CToolTipid="tt13"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxUndoableEdit.prototype.die = function()</td></tr></table></blockquote>Hook to free resources after the edit has been removed from the command history. </div></div><!--END_ND_TOOLTIPS-->