<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxGraphViewCodec"></a>mxGraphViewCodec</h1><divclass=CBody><p>Custom encoder for <ahref="../view/mxGraphView-js.html#mxGraphView"class=LClassid=link6onMouseOver="ShowTip(event, 'tt1', 'link6')"onMouseOut="HideTip('tt1')">mxGraphView</a>s. This class is created and registered dynamically at load time and used implicitely via <ahref="mxCodec-js.html#mxCodec"class=LClassid=link7onMouseOver="ShowTip(event, 'tt4', 'link7')"onMouseOut="HideTip('tt4')">mxCodec</a> and the <ahref="mxCodecRegistry-js.html#mxCodecRegistry"class=LClassid=link8onMouseOver="ShowTip(event, 'tt5', 'link8')"onMouseOut="HideTip('tt5')">mxCodecRegistry</a>. This codec only writes views into a XML format that can be used to create an image for the graph, that is, it contains absolute coordinates with computed perimeters, edge styles and cell styles.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxGraphViewCodec">mxGraphViewCodec</a></td><tdclass=SDescription>Custom encoder for <ahref="../view/mxGraphView-js.html#mxGraphView"class=LClassid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxGraphView</a>s. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxGraphViewCodec.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewCodec.encode"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">encode</a></td><tdclass=SDescription>Encodes the given <ahref="../view/mxGraphView-js.html#mxGraphView"class=LClassid=link3onMouseOver="ShowTip(event, 'tt1', 'link3')"onMouseOut="HideTip('tt1')">mxGraphView</a> using <ahref="#mxGraphViewCodec.encodeCell"class=LFunctionid=link4onMouseOver="ShowTip(event, 'tt3', 'link4')"onMouseOut="HideTip('tt3')">encodeCell</a> starting at the model’s root. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxGraphViewCodec.encodeCell"id=link5onMouseOver="ShowTip(event, 'tt3', 'link5')"onMouseOut="HideTip('tt3')">encodeCell</a></td><tdclass=SDescription>Recursively encodes the specifed cell. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewCodec.encode"></a>encode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.encode = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>view</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the given <ahref="../view/mxGraphView-js.html#mxGraphView"class=LClassid=link9onMouseOver="ShowTip(event, 'tt1', 'link9')"onMouseOut="HideTip('tt1')">mxGraphView</a> using <ahref="#mxGraphViewCodec.encodeCell"class=LFunctionid=link10onMouseOver="ShowTip(event, 'tt3', 'link10')"onMouseOut="HideTip('tt3')">encodeCell</a> starting at the model’s root. This returns the top-level graph node of the recursive encoding.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewCodec.encodeCell"></a>encodeCell</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.encodeCell = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>view,</td></tr><tr><td></td><tdclass=PParameternowrap>cell</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Recursively encodes the specifed cell. Uses layer as the default nodename. If the cell’s parent is null, then graph is used for the nodename. If <ahref="../model/mxGraphModel-js.html#mxGraphModel.isEdge"class=LFunctionid=link11onMouseOver="ShowTip(event, 'tt6', 'link11')"onMouseOut="HideTip('tt6')">mxGraphModel.isEdge</a> returns true for the cell, then edge is used for the nodename, else if <ahref="../model/mxGraphModel-js.html#mxGraphModel.isVertex"class=LFunctionid=link12onMouseOver="ShowTip(event, 'tt7', 'link12')"onMouseOut="HideTip('tt7')">mxGraphModel.isVertex</a> returns true for the cell, then vertex is used for the nodename.</p><p><ahref="../view/mxGraph-js.html#mxGraph.getLabel"class=LFunctionid=link13onMouseOver="ShowTip(event, 'tt8', 'link13')"onMouseOut="HideTip('tt8')">mxGraph.getLabel</a> is used to create the label attribute for the cell. For graph nodes and vertices the bounds are encoded into x, y, width and height. For edges the points are encoded into a points attribute as a space-separated list of comma-separated coordinate pairs (eg. x0,y0 x1,y1 ... xn,yn). All values from the cell style are added as attribute values to the node.</p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CClass>Extends mxEventSource to implement a view for a graph. </div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.encode = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>view</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Encodes the given mxGraphView using encodeCell starting at the model’s root. </div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.encodeCell = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>view,</td></tr><tr><td></td><tdclass=PParameternowrap>cell</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Recursively encodes the specifed cell. </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=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphModel.prototype.isEdge = function(</td><tdclass=PParameternowrap>cell</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given cell is an edge.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphModel.prototype.isVertex = function(</td><tdclass=PParameternowrap>cell</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given cell is a vertex.</div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraph.prototype.getLabel = function(</td><tdclass=PParameternowrap>cell</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns a string or DOM node that represents the label for the given cell. </div></div><!--END_ND_TOOLTIPS-->