<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxCellCodec"></a>mxCellCodec</h1><divclass=CBody><p>Codec for <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link8onMouseOver="ShowTip(event, 'tt1', 'link8')"onMouseOut="HideTip('tt1')">mxCell</a>s. This class is created and registered dynamically at load time and used implicitely via <ahref="mxCodec-js.html#mxCodec"class=LClassid=link9onMouseOver="ShowTip(event, 'tt6', 'link9')"onMouseOut="HideTip('tt6')">mxCodec</a> and the <ahref="mxCodecRegistry-js.html#mxCodecRegistry"class=LClassid=link10onMouseOver="ShowTip(event, 'tt7', 'link10')"onMouseOut="HideTip('tt7')">mxCodecRegistry</a>.</p><h4class=CHeading>Transient Fields</h4><ul><li>children</li><li>edges</li><li>overlays</li><li>mxTransient</li></ul><h4class=CHeading>Reference Fields</h4><ul><li>parent</li><li>source</li><li>target</li></ul><h4class=CHeading>Transient fields can be added using the following code</h4><p>mxCodecRegistry.getCodec(mxCell).exclude.push(‘name_of_field’);</p><p>To subclass <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link11onMouseOver="ShowTip(event, 'tt1', 'link11')"onMouseOut="HideTip('tt1')">mxCell</a>, replace the template and add an alias as follows.</p><blockquote><preclass="prettyprint">function CustomCell(value, geometry, style)
{
mxCell.apply(this, arguments);
}
mxUtils.extend(CustomCell, mxCell);
mxCodecRegistry.getCodec(mxCell).template = new CustomCell();
mxCodecRegistry.addAlias('CustomCell', 'mxCell');</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxCellCodec">mxCellCodec</a></td><tdclass=SDescription>Codec for <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxCell</a>s. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCellCodec.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCellCodec.isCellCodec"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">isCellCodec</a></td><tdclass=SDescription>Returns true since this is a cell codec.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCellCodec.isExcluded"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">isExcluded</a></td><tdclass=SDescription>Excludes user objects that are XML nodes.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCellCodec.afterEncode"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">afterEncode</a></td><tdclass=SDescription>Encodes an <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link5onMouseOver="ShowTip(event, 'tt1', 'link5')"onMouseOut="HideTip('tt1')">mxCell</a> and wraps the XML up inside the XML of the user object (inversion).</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCellCodec.beforeDecode"id=link6onMouseOver="ShowTip(event, 'tt5', 'link6')"onMouseOut="HideTip('tt5')">beforeDecode</a></td><tdclass=SDescription>Decodes an <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link7onMouseOver="ShowTip(event, 'tt1', 'link7')"onMouseOut="HideTip('tt1')">mxCell</a> and uses the enclosing XML node as the user object for the cell (inversion).</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellCodec.isCellCodec"></a>isCellCodec</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>codec.isCellCodec = function()</td></tr></table></blockquote><p>Returns true since this is a cell codec.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellCodec.isExcluded"></a>isExcluded</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.isExcluded = function(</td><tdclass=PParameternowrap>obj,</td></tr><tr><td></td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>value,</td></tr><tr><td></td><tdclass=PParameternowrap>isWrite</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Excludes user objects that are XML nodes.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellCodec.afterEncode"></a>afterEncode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.afterEncode = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>obj,</td></tr><tr><td></td><tdclass=PParameternowrap>node</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes an <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link12onMouseOver="ShowTip(event, 'tt1', 'link12')"onMouseOut="HideTip('tt1')">mxCell</a> and wraps the XML up inside the XML of the user object (inversion).</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCellCodec.beforeDecode"></a>beforeDecode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.beforeDecode = function(</td><tdclass=PParameternowrap>dec,</td></tr><tr><td></td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes an <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link13onMouseOver="ShowTip(event, 'tt1', 'link13')"onMouseOut="HideTip('tt1')">mxCell</a> and uses the enclosing XML node as the user object for the cell (inversion).</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CClass>Cells are the elements of the graph model. </div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>codec.isCellCodec = function()</td></tr></table></blockquote>Returns true since this is a cell codec.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.isExcluded = function(</td><tdclass=PParameternowrap>obj,</td></tr><tr><td></td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>value,</td></tr><tr><td></td><tdclass=PParameternowrap>isWrite</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Excludes user objects that are XML nodes.</div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.afterEncode = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>obj,</td></tr><tr><td></td><tdclass=PParameternowrap>node</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Encodes an mxCell and wraps the XML up inside the XML of the user object (inversion).</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.beforeDecode = function(</td><tdclass=PParameternowrap>dec,</td></tr><tr><td></td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Decodes an mxCell and uses the enclosing XML node as the user object for the cell (inversion).</div></div><divclass=CToolTipid="tt6"><divclass=CClass>XML codec for JavaScript object graphs. </div></div><divclass=CToolTipid="tt7"><divclass=CClass>Singleton class that acts as a global registry for codecs.</div></div><!--END_ND_TOOLTIPS-->