<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxEditorCodec"></a>mxEditorCodec</h1><divclass=CBody><p>Codec for <ahref="../editor/mxEditor-js.html#mxEditor"class=LClassid=link4onMouseOver="ShowTip(event, 'tt1', 'link4')"onMouseOut="HideTip('tt1')">mxEditor</a>s. This class is created and registered dynamically at load time and used implicitely via <ahref="mxCodec-js.html#mxCodec"class=LClassid=link5onMouseOver="ShowTip(event, 'tt4', 'link5')"onMouseOut="HideTip('tt4')">mxCodec</a> and the <ahref="mxCodecRegistry-js.html#mxCodecRegistry"class=LClassid=link6onMouseOver="ShowTip(event, 'tt5', 'link6')"onMouseOut="HideTip('tt5')">mxCodecRegistry</a>.</p><h4class=CHeading>Transient Fields</h4><ul><li>modified</li><li>lastSnapshot</li><li>ignoredChanges</li><li>undoManager</li><li>graphContainer</li><li>toolbarContainer</li></ul><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxEditorCodec">mxEditorCodec</a></td><tdclass=SDescription>Codec for <ahref="../editor/mxEditor-js.html#mxEditor"class=LClassid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxEditor</a>s. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxEditorCodec.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxEditorCodec.beforeDecode">beforeDecode</a></td><tdclass=SDescription>Decodes the ui-part of the configuration node by reading a sequence of the following child nodes and attributes and passes the control to the default decoding mechanism:</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxEditorCodec.decodeChild"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">decodeChild</a></td><tdclass=SDescription>Overrides decode child to handle special child nodes.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxEditorCodec.decodeTemplates">decodeTemplates</a></td><tdclass=SDescription>Decodes the cells from the given node as templates.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxEditorCodec.decodeTemplates"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">decodeTemplates</a></td><tdclass=SDescription>Decodes the cells from the given node as templates.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxEditorCodec.beforeDecode"></a>beforeDecode</h3><divclass=CBody><p>Decodes the ui-part of the configuration node by reading a sequence of the following child nodes and attributes and passes the control to the default decoding mechanism:</p><h4class=CHeading>Child Nodes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>stylesheet</td><tdclass=CDLDescription>Adds a CSS stylesheet to the document.</td></tr><tr><tdclass=CDLEntry>resource</td><tdclass=CDLDescription>Adds the basename of a resource bundle.</td></tr><tr><tdclass=CDLEntry>add</td><tdclass=CDLDescription>Creates or configures a known UI element.</td></tr></table><p>These elements may appear in any order given that the graph UI element is added before the toolbar element (see Known Keys).</p><h4class=CHeading>Attributes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>as</td><tdclass=CDLDescription>Key for the UI element (see below).</td></tr><tr><tdclass=CDLEntry>element</td><tdclass=CDLDescription>ID for the element in the document.</td></tr><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>CSS style to be used for the element or window.</td></tr><tr><tdclass=CDLEntry>x</td><tdclass=CDLDescription>X coordinate for the new window.</td></tr><tr><tdclass=CDLEntry>y</td><tdclass=CDLDescription>Y coordinate for the new window.</td></tr><tr><tdclass=CDLEntry>width</td><tdclass=CDLDescription>Width for the new window.</td></tr><tr><tdclass=CDLEntry>height</td><tdclass=CDLDescription>Optional height for the new window.</td></tr><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>Name of the stylesheet (absolute/relative URL).</td></tr><tr><tdclass=CDLEntry>basename</td><tdclass=CDLDescription>Basename of the resource bundle (see <ahref="../util/mxResources-js.html#mxResources"class=LClassid=link7onMouseOver="ShowTip(event, 'tt6', 'link7')"onMouseOut="HideTip('tt6')">mxResources</a>).</td></tr></table><p>The x, y, width and height attributes are used to create a new <ahref="../util/mxWindow-js.html#mxWindow"class=LClassid=link8onMouseOver="ShowTip(event, 'tt7', 'link8')"onMouseOut="HideTip('tt7')">mxWindow</a> if the element attribute is not specified in an add node. The name and basename are only used in the stylesheet and resource nodes, respectively.</p><h4class=CHeading>Known Keys</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription>Main graph element (see <ahref="../editor/mxEditor-js.html#mxEditor.setGraphContainer"class=LFunctionid=link9onMouseOver="ShowTip(event, 'tt8', 'link9')"onMouseOut="HideTip('tt8')">mxEditor.setGraphContainer</a>).</td></tr><tr><tdclass=CDLEntry>title</td><tdclass=CDLDescription>Title element (see <ahref="../editor/mxEditor-js.html#mxEditor.setTitleContainer"class=LFunctionid=link10onMouseOver="ShowTip(event, 'tt9', 'link10')"onMouseOut="HideTip('tt9')">mxEditor.setTitleContainer</a>).</td></tr><tr><tdclass=CDLEntry>toolbar</td><tdclass=CDLDescription>Toolbar element (see <ahref="../editor/mxEditor-js.html#mxEditor.setToolbarContainer"class=LFunctionid=link11onMouseOver="ShowTip(event, 'tt10', 'link11')"onMouseOut="HideTip('tt10')">mxEditor.setToolbarContainer</a>).</td></tr><tr><tdclass=CDLEntry>status</td><tdclass=CDLDescription>Status bar element (see <ahref="../editor/mxEditor-js.html#mxEditor.setStatusContainer"class=LFunctionid=link12onMouseOver="ShowTip(event, 'tt11', 'link12')"onMouseOut="HideTip('tt11')">mxEditor.setStatusContainer</a>).</td></tr></table><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint"><ui>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxEditorCodec.decodeTemplates"></a>decodeTemplates</h3><divclass=CBody><p>Decodes the cells from the given node as templates.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxEditorCodec.decodeTemplates"></a>decodeTemplates</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>codec.decodeTemplates = function(</td><tdclass="PParameter prettyprint "nowrap>dec,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>node,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>editor</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes the cells from the given node as templates.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CClass>Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg. </div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>codec.decodeChild = function(</td><tdclass="PParameter prettyprint "nowrap>dec,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>child,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>obj</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Overrides decode child to handle special child nodes.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>codec.decodeTemplates = function(</td><tdclass="PParameter prettyprint "nowrap>dec,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>node,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>editor</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Decodes the cells from the given node as templates.</div></div><divclass=CToolTipid="tt4"><divclass=CClass>XML codec for JavaScript object graphs. </div></div><divclass=CToolTipid="tt5"><divclass=CClass>Singleton class that acts as a global registry for codecs.</div></div><divclass=CToolTipid="tt6"><divclass=CClass>Implements internationalization. </div></div><divclass=CToolTipid="tt7"><divclass=CClass>Basic window inside a document.</div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxEditor.prototype.setGraphContainer = function (</td><tdclass="PParameter prettyprint "nowrap>container</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the graph’s container using mxGraph.init.</div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxEditor.prototype.setTitleContainer = function (</td><tdclass="PParameter prettyprint "nowrap>container</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a listener to update the inner HTML of the specified DOM node with the value of getTitle.</div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxEditor.prototype.setToolbarContainer = function (</td><tdclass="PParameter prettyprint "nowrap>container</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Initializes the toolbar for the given container.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxEditor.prototype.setStatusContainer = function (</td><tdclass="PParameter prettyprint "nowrap>container</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates the status using the specified container.</div></div><!--END_ND_TOOLTIPS-->