maxGraph/dotnet/docs/html/classcom_1_1mxgraph_1_1mxCo...

685 lines
39 KiB
HTML
Raw Normal View History

2012-05-21 20:32:26 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>mxGraph: com::mxgraph::mxCodec Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><b>com</b>::<b>mxgraph</b>::<a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html">mxCodec</a>
</div>
</div>
<div class="contents">
<h1>com::mxgraph::mxCodec Class Reference</h1><!-- doxytag: class="com::mxgraph::mxCodec" -->
<p>XML codec for .NET object graphs. In order to resolve forward references when reading files the XML document that contains the data must be passed to the constructor.
<a href="#_details">More...</a></p>
<p><a href="classcom_1_1mxgraph_1_1mxCodec-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a08aed19305c14248949292a713588056">mxCodec</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs an XML encoder/decoder with a new owner document. <a href="#a08aed19305c14248949292a713588056"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a56834df37ac58e69c1445e14c0c8dcb7">mxCodec</a> (XmlDocument <a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a91caf2d5796965cfeae55e748ae1d438">document</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs an XML encoder/decoder for the specified owner document. The document is required to resolve forward ID references. This means if you parse a graphmodel that is represented in XML you must also pass the document that contains the XML to the constructor, otherwise forward references will not be resolved. <a href="#a56834df37ac58e69c1445e14c0c8dcb7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Object&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ab7189e0c130a648ef15541f2be790bd9">PutObject</a> (string id, Object obj)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assoiates the given object with the given ID. <a href="#ab7189e0c130a648ef15541f2be790bd9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Object&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ac4c7937c86766f1cf44f12d4023d706d">GetObject</a> (string id)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the decoded object for the element with the specified ID in document. If the object is not known then lookup is used to find an object. If no object is found, then the element with the respective ID from the document is parsed using decode. <a href="#ac4c7937c86766f1cf44f12d4023d706d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Object&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#adcf61362787457dc4ed50811871571f8">Lookup</a> (string id)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Hook for subclassers to implement a custom lookup mechanism for cell IDs. This implementation always returns null. <a href="#adcf61362787457dc4ed50811871571f8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">XmlNode&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ab75670c8e89934b2f45cb202a95598b8">GetElementById</a> (string id)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the element with the given ID from the document. <a href="#ab75670c8e89934b2f45cb202a95598b8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">XmlNode&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#afa470c9e8ffc3d563b62aa46a619607d">GetElementById</a> (string id, string attributeName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the element with the given ID from document. The optional attr argument specifies the name of the ID attribute. Default is id. The XPath expression used to find the element is //*[@id='arg'] where id is the name of the ID attribute (attributeName) and arg is the given id. <a href="#afa470c9e8ffc3d563b62aa46a619607d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#af13936ced2b0da9ad4f088db31ca2007">GetId</a> (Object obj)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the ID of the specified object. This implementation calls reference first and if that returns null handles the object as an <a class="el" href="classcom_1_1mxgraph_1_1mxCell.html" title="Cells are the elements of the graph model. They represent the state of the groups...">mxCell</a> by returning their IDs using mxCell.getId. If no ID exists for the given cell, then an on-the-fly ID is generated using mxCellPath.create. <a href="#af13936ced2b0da9ad4f088db31ca2007"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a65dacbf11b9be370b293b8256ef116fe">Reference</a> (Object obj)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null. <a href="#a65dacbf11b9be370b293b8256ef116fe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">XmlNode&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#aed5b7fe6bb0431767d3a0303822d092e">Encode</a> (Object obj)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encodes the specified object and returns the resulting XML node. <a href="#aed5b7fe6bb0431767d3a0303822d092e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Object&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a270c02410861862c8c08e0d45c4b4dbf">Decode</a> (XmlNode node)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decodes the given XML node using decode(XmlNode, Object). <a href="#a270c02410861862c8c08e0d45c4b4dbf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Object&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ad0b4d9980bf37c9a7dd75032eb943f52">Decode</a> (XmlNode node, Object into)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decodes the given XML node. The optional "into" argument specifies an existing object to be used. If no object is given, then a new instance is created using the constructor from the codec. The function returns the passed in object or the new instance if no object was given. <a href="#ad0b4d9980bf37c9a7dd75032eb943f52"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a063a0154505235fab267d75f87d1d94e">EncodeCell</a> (<a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a> cell, XmlNode node, bool includeChildren)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg. <a class="el" href="classcom_1_1mxgraph_1_1mxModelCodec.html" title="Codec for mxGraphModels. This class is created and registered dynamically at load...">mxModelCodec</a>, mxChildChangeCodec and mxRootChangeCodec). This implementation writes the given cell and its children as a (flat) sequence into the given node. The children are not encoded if the optional includeChildren is false. The function is in charge of adding the result into the given node and has no return value. <a href="#a063a0154505235fab267d75f87d1d94e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a2e31c56e464eabd8fe784f93ebf45b78">DecodeCell</a> (XmlNode node, bool restoreStructures)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decodes cells that have been encoded using inversion, ie. where the user object is the enclosing node in the XML, and restores the group and graph structure in the cells. Returns a new <a class="el" href="classcom_1_1mxgraph_1_1mxCell.html" title="Cells are the elements of the graph model. They represent the state of the groups...">mxCell</a> instance that represents the given node. <a href="#a2e31c56e464eabd8fe784f93ebf45b78"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a0c731bec8adf1279a5813e9334b37319">InsertIntoGraph</a> (<a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a> cell)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Inserts the given cell into its parent and terminal cells. <a href="#a0c731bec8adf1279a5813e9334b37319"></a><br/></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a155ebb610b21e83dfc28eb30ace11dfa">SetAttribute</a> (XmlNode node, string attribute, Object value)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the attribute on the specified node to value. This is a helper method that makes sure the attribute and value arguments are not null. <a href="#a155ebb610b21e83dfc28eb30ace11dfa"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">XmlDocument&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a91caf2d5796965cfeae55e748ae1d438">document</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds the owner document of the codec. <a href="#a91caf2d5796965cfeae55e748ae1d438"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Dictionary&lt; string, object &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a9f983ce7275a1005de496ee15093a6f0">objects</a> = new Dictionary&lt;string, Object&gt;()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Maps from IDs to objects. <a href="#a9f983ce7275a1005de496ee15093a6f0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a955dde36b094d0845613ff7b7b0abdb9">encodeDefaults</a> = false</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specifies if default values should be encoded. Default is false. <a href="#a955dde36b094d0845613ff7b7b0abdb9"></a><br/></td></tr>
<tr><td colspan="2"><h2>Properties</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">XmlDocument&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a3c424b0a7288e6e8a4029c06ec358009">Document</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets or returns the owner document of the codec. <a href="#a3c424b0a7288e6e8a4029c06ec358009"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a3f063598603020bfdd63c9b3a24ebe97">IsEncodeDefaults</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets or returns if default values of member variables should be encoded. <a href="#a3f063598603020bfdd63c9b3a24ebe97"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Dictionary&lt; string, object &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#aed4c1e1287432ab7f8213ee5a729dcd6">Objects</a><code> [get]</code></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the object lookup table. <a href="#aed4c1e1287432ab7f8213ee5a729dcd6"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>XML codec for .NET object graphs. In order to resolve forward references when reading files the XML document that contains the data must be passed to the constructor. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a08aed19305c14248949292a713588056"></a><!-- doxytag: member="com::mxgraph::mxCodec::mxCodec" ref="a08aed19305c14248949292a713588056" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">com::mxgraph::mxCodec::mxCodec </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs an XML encoder/decoder with a new owner document. </p>
</div>
</div>
<a class="anchor" id="a56834df37ac58e69c1445e14c0c8dcb7"></a><!-- doxytag: member="com::mxgraph::mxCodec::mxCodec" ref="a56834df37ac58e69c1445e14c0c8dcb7" args="(XmlDocument document)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">com::mxgraph::mxCodec::mxCodec </td>
<td>(</td>
<td class="paramtype">XmlDocument&nbsp;</td>
<td class="paramname"> <em>document</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs an XML encoder/decoder for the specified owner document. The document is required to resolve forward ID references. This means if you parse a graphmodel that is represented in XML you must also pass the document that contains the XML to the constructor, otherwise forward references will not be resolved. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>document</em>&nbsp;</td><td>Optional XML document that contains the data. If no document is specified then a new document is created using mxUtils.createDocument</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad0b4d9980bf37c9a7dd75032eb943f52"></a><!-- doxytag: member="com::mxgraph::mxCodec::Decode" ref="ad0b4d9980bf37c9a7dd75032eb943f52" args="(XmlNode node, Object into)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Object com::mxgraph::mxCodec::Decode </td>
<td>(</td>
<td class="paramtype">XmlNode&nbsp;</td>
<td class="paramname"> <em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>into</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decodes the given XML node. The optional "into" argument specifies an existing object to be used. If no object is given, then a new instance is created using the constructor from the codec. The function returns the passed in object or the new instance if no object was given. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>XML node to be decoded.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>into</em>&nbsp;</td><td>Optional object to be decodec into.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns an object that represents the given node.</dd></dl>
</div>
</div>
<a class="anchor" id="a270c02410861862c8c08e0d45c4b4dbf"></a><!-- doxytag: member="com::mxgraph::mxCodec::Decode" ref="a270c02410861862c8c08e0d45c4b4dbf" args="(XmlNode node)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Object com::mxgraph::mxCodec::Decode </td>
<td>(</td>
<td class="paramtype">XmlNode&nbsp;</td>
<td class="paramname"> <em>node</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decodes the given XML node using decode(XmlNode, Object). </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>XML node to be decoded.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns an object that represents the given node.</dd></dl>
</div>
</div>
<a class="anchor" id="a2e31c56e464eabd8fe784f93ebf45b78"></a><!-- doxytag: member="com::mxgraph::mxCodec::DecodeCell" ref="a2e31c56e464eabd8fe784f93ebf45b78" args="(XmlNode node, bool restoreStructures)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a> com::mxgraph::mxCodec::DecodeCell </td>
<td>(</td>
<td class="paramtype">XmlNode&nbsp;</td>
<td class="paramname"> <em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"> <em>restoreStructures</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decodes cells that have been encoded using inversion, ie. where the user object is the enclosing node in the XML, and restores the group and graph structure in the cells. Returns a new <a class="el" href="classcom_1_1mxgraph_1_1mxCell.html" title="Cells are the elements of the graph model. They represent the state of the groups...">mxCell</a> instance that represents the given node. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>XML node that contains the cell data.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>restoreStructures</em>&nbsp;</td><td>Boolean indicating whether the graph structure should be restored by calling insert and insertEdge on the parent and terminals, respectively. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Graph cell that represents the given node.</dd></dl>
</div>
</div>
<a class="anchor" id="aed5b7fe6bb0431767d3a0303822d092e"></a><!-- doxytag: member="com::mxgraph::mxCodec::Encode" ref="aed5b7fe6bb0431767d3a0303822d092e" args="(Object obj)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XmlNode com::mxgraph::mxCodec::Encode </td>
<td>(</td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>obj</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Encodes the specified object and returns the resulting XML node. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>obj</em>&nbsp;</td><td>Object to be encoded.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns an XML node that represents the given object.</dd></dl>
</div>
</div>
<a class="anchor" id="a063a0154505235fab267d75f87d1d94e"></a><!-- doxytag: member="com::mxgraph::mxCodec::EncodeCell" ref="a063a0154505235fab267d75f87d1d94e" args="(mxICell cell, XmlNode node, bool includeChildren)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void com::mxgraph::mxCodec::EncodeCell </td>
<td>(</td>
<td class="paramtype"><a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a>&nbsp;</td>
<td class="paramname"> <em>cell</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">XmlNode&nbsp;</td>
<td class="paramname"> <em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"> <em>includeChildren</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg. <a class="el" href="classcom_1_1mxgraph_1_1mxModelCodec.html" title="Codec for mxGraphModels. This class is created and registered dynamically at load...">mxModelCodec</a>, mxChildChangeCodec and mxRootChangeCodec). This implementation writes the given cell and its children as a (flat) sequence into the given node. The children are not encoded if the optional includeChildren is false. The function is in charge of adding the result into the given node and has no return value. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>cell</em>&nbsp;</td><td><a class="el" href="classcom_1_1mxgraph_1_1mxCell.html" title="Cells are the elements of the graph model. They represent the state of the groups...">mxCell</a> to be encoded.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>Parent XML node to add the encoded cell into.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>includeChildren</em>&nbsp;</td><td>Boolean indicating if the method should include all descendents</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="afa470c9e8ffc3d563b62aa46a619607d"></a><!-- doxytag: member="com::mxgraph::mxCodec::GetElementById" ref="afa470c9e8ffc3d563b62aa46a619607d" args="(string id, string attributeName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XmlNode com::mxgraph::mxCodec::GetElementById </td>
<td>(</td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>attributeName</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the element with the given ID from document. The optional attr argument specifies the name of the ID attribute. Default is id. The XPath expression used to find the element is //*[@id='arg'] where id is the name of the ID attribute (attributeName) and arg is the given id. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>ID of the element to be returned.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>attributeName</em>&nbsp;</td><td>Optional string for the attributename. Default is id.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the element for the given ID.</dd></dl>
</div>
</div>
<a class="anchor" id="ab75670c8e89934b2f45cb202a95598b8"></a><!-- doxytag: member="com::mxgraph::mxCodec::GetElementById" ref="ab75670c8e89934b2f45cb202a95598b8" args="(string id)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XmlNode com::mxgraph::mxCodec::GetElementById </td>
<td>(</td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>id</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the element with the given ID from the document. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>ID of the element to be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the element for the given ID.</dd></dl>
</div>
</div>
<a class="anchor" id="af13936ced2b0da9ad4f088db31ca2007"></a><!-- doxytag: member="com::mxgraph::mxCodec::GetId" ref="af13936ced2b0da9ad4f088db31ca2007" args="(Object obj)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxCodec::GetId </td>
<td>(</td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>obj</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the ID of the specified object. This implementation calls reference first and if that returns null handles the object as an <a class="el" href="classcom_1_1mxgraph_1_1mxCell.html" title="Cells are the elements of the graph model. They represent the state of the groups...">mxCell</a> by returning their IDs using mxCell.getId. If no ID exists for the given cell, then an on-the-fly ID is generated using mxCellPath.create. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>obj</em>&nbsp;</td><td>Object to return the ID for.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the ID for the given object.</dd></dl>
</div>
</div>
<a class="anchor" id="ac4c7937c86766f1cf44f12d4023d706d"></a><!-- doxytag: member="com::mxgraph::mxCodec::GetObject" ref="ac4c7937c86766f1cf44f12d4023d706d" args="(string id)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Object com::mxgraph::mxCodec::GetObject </td>
<td>(</td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>id</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the decoded object for the element with the specified ID in document. If the object is not known then lookup is used to find an object. If no object is found, then the element with the respective ID from the document is parsed using decode. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>ID of the object to be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the object for the given ID.</dd></dl>
</div>
</div>
<a class="anchor" id="a0c731bec8adf1279a5813e9334b37319"></a><!-- doxytag: member="com::mxgraph::mxCodec::InsertIntoGraph" ref="a0c731bec8adf1279a5813e9334b37319" args="(mxICell cell)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void com::mxgraph::mxCodec::InsertIntoGraph </td>
<td>(</td>
<td class="paramtype"><a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a>&nbsp;</td>
<td class="paramname"> <em>cell</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Inserts the given cell into its parent and terminal cells. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>cell</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="adcf61362787457dc4ed50811871571f8"></a><!-- doxytag: member="com::mxgraph::mxCodec::Lookup" ref="adcf61362787457dc4ed50811871571f8" args="(string id)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Object com::mxgraph::mxCodec::Lookup </td>
<td>(</td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>id</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Hook for subclassers to implement a custom lookup mechanism for cell IDs. This implementation always returns null. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>ID of the object to be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the object for the given ID.</dd></dl>
</div>
</div>
<a class="anchor" id="ab7189e0c130a648ef15541f2be790bd9"></a><!-- doxytag: member="com::mxgraph::mxCodec::PutObject" ref="ab7189e0c130a648ef15541f2be790bd9" args="(string id, Object obj)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Object com::mxgraph::mxCodec::PutObject </td>
<td>(</td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>obj</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Assoiates the given object with the given ID. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>ID for the object to be associated with.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>obj</em>&nbsp;</td><td>Object to be associated with the ID.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the given object.</dd></dl>
</div>
</div>
<a class="anchor" id="a65dacbf11b9be370b293b8256ef116fe"></a><!-- doxytag: member="com::mxgraph::mxCodec::Reference" ref="a65dacbf11b9be370b293b8256ef116fe" args="(Object obj)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxCodec::Reference </td>
<td>(</td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>obj</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>obj</em>&nbsp;</td><td>Object whose ID should be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the ID for the given object.</dd></dl>
</div>
</div>
<a class="anchor" id="a155ebb610b21e83dfc28eb30ace11dfa"></a><!-- doxytag: member="com::mxgraph::mxCodec::SetAttribute" ref="a155ebb610b21e83dfc28eb30ace11dfa" args="(XmlNode node, string attribute, Object value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void com::mxgraph::mxCodec::SetAttribute </td>
<td>(</td>
<td class="paramtype">XmlNode&nbsp;</td>
<td class="paramname"> <em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>attribute</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>value</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the attribute on the specified node to value. This is a helper method that makes sure the attribute and value arguments are not null. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>XML node to set the attribute for.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>attribute</em>&nbsp;</td><td>Attributename to be set.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>New value of the attribute.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a91caf2d5796965cfeae55e748ae1d438"></a><!-- doxytag: member="com::mxgraph::mxCodec::document" ref="a91caf2d5796965cfeae55e748ae1d438" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XmlDocument <a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a91caf2d5796965cfeae55e748ae1d438">com::mxgraph::mxCodec::document</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Holds the owner document of the codec. </p>
</div>
</div>
<a class="anchor" id="a955dde36b094d0845613ff7b7b0abdb9"></a><!-- doxytag: member="com::mxgraph::mxCodec::encodeDefaults" ref="a955dde36b094d0845613ff7b7b0abdb9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a955dde36b094d0845613ff7b7b0abdb9">com::mxgraph::mxCodec::encodeDefaults</a> = false<code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Specifies if default values should be encoded. Default is false. </p>
</div>
</div>
<a class="anchor" id="a9f983ce7275a1005de496ee15093a6f0"></a><!-- doxytag: member="com::mxgraph::mxCodec::objects" ref="a9f983ce7275a1005de496ee15093a6f0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;string, object&gt; <a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a9f983ce7275a1005de496ee15093a6f0">com::mxgraph::mxCodec::objects</a> = new Dictionary&lt;string, Object&gt;()<code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Maps from IDs to objects. </p>
</div>
</div>
<hr/><h2>Property Documentation</h2>
<a class="anchor" id="a3c424b0a7288e6e8a4029c06ec358009"></a><!-- doxytag: member="com::mxgraph::mxCodec::Document" ref="a3c424b0a7288e6e8a4029c06ec358009" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XmlDocument com::mxgraph::mxCodec::Document<code> [get, set]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets or returns the owner document of the codec. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the owner document.</dd></dl>
</div>
</div>
<a class="anchor" id="a3f063598603020bfdd63c9b3a24ebe97"></a><!-- doxytag: member="com::mxgraph::mxCodec::IsEncodeDefaults" ref="a3f063598603020bfdd63c9b3a24ebe97" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool com::mxgraph::mxCodec::IsEncodeDefaults<code> [get, set]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets or returns if default values of member variables should be encoded. </p>
</div>
</div>
<a class="anchor" id="aed4c1e1287432ab7f8213ee5a729dcd6"></a><!-- doxytag: member="com::mxgraph::mxCodec::Objects" ref="aed4c1e1287432ab7f8213ee5a729dcd6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;string, object&gt; com::mxgraph::mxCodec::Objects<code> [get]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the object lookup table. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/io/mxCodec.cs</li>
</ul>
</div>
2013-02-14 13:13:16 +00:00
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Feb 14 13:10:38 2013 for mxGraph by&nbsp;
2012-05-21 20:32:26 +00:00
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>