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

987 lines
54 KiB
HTML

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mxGraph: com.mxgraph.mxCodec Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">mxGraph
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacecom.html">com</a></li><li class="navelem"><a class="el" href="namespacecom_1_1mxgraph.html">mxgraph</a></li><li class="navelem"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html">mxCodec</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="classcom_1_1mxgraph_1_1mxCodec-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">com.mxgraph.mxCodec Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<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. Here is an example for parsing an existing XML document into a graph model:
<a href="classcom_1_1mxgraph_1_1mxCodec.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a07e453ed963ab7bc07639091b9e371cb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a07e453ed963ab7bc07639091b9e371cb">mxCodec</a> ()</td></tr>
<tr class="memdesc:a07e453ed963ab7bc07639091b9e371cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs an XML encoder/decoder with a new owner document. <a href="#a07e453ed963ab7bc07639091b9e371cb">More...</a><br /></td></tr>
<tr class="separator:a07e453ed963ab7bc07639091b9e371cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc2542faf421e95e1074c8b4c8b88b21"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#abc2542faf421e95e1074c8b4c8b88b21">mxCodec</a> (XmlDocument <a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#aad8ec158a71d86cd392af0f7dc519b63">document</a>)</td></tr>
<tr class="memdesc:abc2542faf421e95e1074c8b4c8b88b21"><td class="mdescLeft">&#160;</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="#abc2542faf421e95e1074c8b4c8b88b21">More...</a><br /></td></tr>
<tr class="separator:abc2542faf421e95e1074c8b4c8b88b21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a662c18d5b7a3c7d31031653baec1c9fa"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a662c18d5b7a3c7d31031653baec1c9fa">PutObject</a> (string id, Object obj)</td></tr>
<tr class="memdesc:a662c18d5b7a3c7d31031653baec1c9fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assoiates the given object with the given ID. <a href="#a662c18d5b7a3c7d31031653baec1c9fa">More...</a><br /></td></tr>
<tr class="separator:a662c18d5b7a3c7d31031653baec1c9fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7284e48f4139e92b75c38598bec683e"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#af7284e48f4139e92b75c38598bec683e">GetObject</a> (string id)</td></tr>
<tr class="memdesc:af7284e48f4139e92b75c38598bec683e"><td class="mdescLeft">&#160;</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="#af7284e48f4139e92b75c38598bec683e">More...</a><br /></td></tr>
<tr class="separator:af7284e48f4139e92b75c38598bec683e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abda3b8202fd04cb2e3730d3dd2560f9b"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#abda3b8202fd04cb2e3730d3dd2560f9b">Lookup</a> (string id)</td></tr>
<tr class="memdesc:abda3b8202fd04cb2e3730d3dd2560f9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hook for subclassers to implement a custom lookup mechanism for cell IDs. This implementation always returns null. <a href="#abda3b8202fd04cb2e3730d3dd2560f9b">More...</a><br /></td></tr>
<tr class="separator:abda3b8202fd04cb2e3730d3dd2560f9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1910f4beb57b5515cfd5a16119d78de0"><td class="memItemLeft" align="right" valign="top">XmlNode&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a1910f4beb57b5515cfd5a16119d78de0">GetElementById</a> (string id)</td></tr>
<tr class="memdesc:a1910f4beb57b5515cfd5a16119d78de0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the element with the given ID from the document. <a href="#a1910f4beb57b5515cfd5a16119d78de0">More...</a><br /></td></tr>
<tr class="separator:a1910f4beb57b5515cfd5a16119d78de0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae259ea85ae98f767a6ebfb15468652ca"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ae259ea85ae98f767a6ebfb15468652ca">GetId</a> (Object obj)</td></tr>
<tr class="memdesc:ae259ea85ae98f767a6ebfb15468652ca"><td class="mdescLeft">&#160;</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, vertices and edges in a graph. ">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="#ae259ea85ae98f767a6ebfb15468652ca">More...</a><br /></td></tr>
<tr class="separator:ae259ea85ae98f767a6ebfb15468652ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e373d85a134b3b71d0969fa0faa0e4c"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a9e373d85a134b3b71d0969fa0faa0e4c">Reference</a> (Object obj)</td></tr>
<tr class="memdesc:a9e373d85a134b3b71d0969fa0faa0e4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null. <a href="#a9e373d85a134b3b71d0969fa0faa0e4c">More...</a><br /></td></tr>
<tr class="separator:a9e373d85a134b3b71d0969fa0faa0e4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3088b2e442dd7ea6f92a7ccba3b12251"><td class="memItemLeft" align="right" valign="top">XmlNode&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a3088b2e442dd7ea6f92a7ccba3b12251">Encode</a> (Object obj)</td></tr>
<tr class="memdesc:a3088b2e442dd7ea6f92a7ccba3b12251"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encodes the specified object and returns the resulting XML node. <a href="#a3088b2e442dd7ea6f92a7ccba3b12251">More...</a><br /></td></tr>
<tr class="separator:a3088b2e442dd7ea6f92a7ccba3b12251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0ad136f46f6a2b29360bd1537ff30fc"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#aa0ad136f46f6a2b29360bd1537ff30fc">Decode</a> (XmlNode node)</td></tr>
<tr class="memdesc:aa0ad136f46f6a2b29360bd1537ff30fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes the given XML node using decode(XmlNode, Object). <a href="#aa0ad136f46f6a2b29360bd1537ff30fc">More...</a><br /></td></tr>
<tr class="separator:aa0ad136f46f6a2b29360bd1537ff30fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4d103574f3b6b379d7d7cca995a2a3d"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#aa4d103574f3b6b379d7d7cca995a2a3d">Decode</a> (XmlNode node, Object into)</td></tr>
<tr class="memdesc:aa4d103574f3b6b379d7d7cca995a2a3d"><td class="mdescLeft">&#160;</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="#aa4d103574f3b6b379d7d7cca995a2a3d">More...</a><br /></td></tr>
<tr class="separator:aa4d103574f3b6b379d7d7cca995a2a3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52442cecf5ce690681d95496c9673f87"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a52442cecf5ce690681d95496c9673f87">EncodeCell</a> (<a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a> cell, XmlNode node, bool includeChildren)</td></tr>
<tr class="memdesc:a52442cecf5ce690681d95496c9673f87"><td class="mdescLeft">&#160;</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 time and used impli...">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="#a52442cecf5ce690681d95496c9673f87">More...</a><br /></td></tr>
<tr class="separator:a52442cecf5ce690681d95496c9673f87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a824d4ca6eaa4cf228e055c4485b7ea52"><td class="memItemLeft" align="right" valign="top"><a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a824d4ca6eaa4cf228e055c4485b7ea52">DecodeCell</a> (XmlNode node, bool restoreStructures)</td></tr>
<tr class="memdesc:a824d4ca6eaa4cf228e055c4485b7ea52"><td class="mdescLeft">&#160;</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, vertices and edges in a graph. ">mxCell</a> instance that represents the given node. <a href="#a824d4ca6eaa4cf228e055c4485b7ea52">More...</a><br /></td></tr>
<tr class="separator:a824d4ca6eaa4cf228e055c4485b7ea52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae58f38afc74452857f2e339eba51f6b6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ae58f38afc74452857f2e339eba51f6b6">InsertIntoGraph</a> (<a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html">mxICell</a> cell)</td></tr>
<tr class="memdesc:ae58f38afc74452857f2e339eba51f6b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts the given cell into its parent and terminal cells. <a href="#ae58f38afc74452857f2e339eba51f6b6">More...</a><br /></td></tr>
<tr class="separator:ae58f38afc74452857f2e339eba51f6b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a799403c766d5a6c12525fb0278c50e74"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a799403c766d5a6c12525fb0278c50e74">SetAttribute</a> (XmlNode node, string attribute, Object value)</td></tr>
<tr class="memdesc:a799403c766d5a6c12525fb0278c50e74"><td class="mdescLeft">&#160;</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="#a799403c766d5a6c12525fb0278c50e74">More...</a><br /></td></tr>
<tr class="separator:a799403c766d5a6c12525fb0278c50e74"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ae6bbe6707e3a49bf948be41572871e52"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ae6bbe6707e3a49bf948be41572871e52">AddElement</a> (XmlNode node)</td></tr>
<tr class="memdesc:ae6bbe6707e3a49bf948be41572871e52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the given element to &lt;elements&gt; if it has an ID. <a href="#ae6bbe6707e3a49bf948be41572871e52">More...</a><br /></td></tr>
<tr class="separator:ae6bbe6707e3a49bf948be41572871e52"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:aad8ec158a71d86cd392af0f7dc519b63"><td class="memItemLeft" align="right" valign="top">XmlDocument&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#aad8ec158a71d86cd392af0f7dc519b63">document</a></td></tr>
<tr class="memdesc:aad8ec158a71d86cd392af0f7dc519b63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Holds the owner document of the codec. <a href="#aad8ec158a71d86cd392af0f7dc519b63">More...</a><br /></td></tr>
<tr class="separator:aad8ec158a71d86cd392af0f7dc519b63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04522d7a38095efb6263bd10518fc6cc"><td class="memItemLeft" align="right" valign="top">Dictionary&lt; string, object &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a04522d7a38095efb6263bd10518fc6cc">objects</a> = new Dictionary&lt;string, Object&gt;()</td></tr>
<tr class="memdesc:a04522d7a38095efb6263bd10518fc6cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps from IDs to objects. <a href="#a04522d7a38095efb6263bd10518fc6cc">More...</a><br /></td></tr>
<tr class="separator:a04522d7a38095efb6263bd10518fc6cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c80fd7a3130d830317a255b41758f30"><td class="memItemLeft" align="right" valign="top">Dictionary&lt; string, XmlNode &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a6c80fd7a3130d830317a255b41758f30">elements</a> = null</td></tr>
<tr class="memdesc:a6c80fd7a3130d830317a255b41758f30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps from IDs to elements. <a href="#a6c80fd7a3130d830317a255b41758f30">More...</a><br /></td></tr>
<tr class="separator:a6c80fd7a3130d830317a255b41758f30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32a5c223e9e716534ee445271ca770ff"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#a32a5c223e9e716534ee445271ca770ff">encodeDefaults</a> = false</td></tr>
<tr class="memdesc:a32a5c223e9e716534ee445271ca770ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specifies if default values should be encoded. Default is false. <a href="#a32a5c223e9e716534ee445271ca770ff">More...</a><br /></td></tr>
<tr class="separator:a32a5c223e9e716534ee445271ca770ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:ad62be275d2f44acaf2e8be0a4a07ee4e"><td class="memItemLeft" align="right" valign="top">XmlDocument&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ad62be275d2f44acaf2e8be0a4a07ee4e">Document</a><code> [get, set]</code></td></tr>
<tr class="memdesc:ad62be275d2f44acaf2e8be0a4a07ee4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets or returns the owner document of the codec. <a href="#ad62be275d2f44acaf2e8be0a4a07ee4e">More...</a><br /></td></tr>
<tr class="separator:ad62be275d2f44acaf2e8be0a4a07ee4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1f1547969b60eaf71b1aa5ac686ea2a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ab1f1547969b60eaf71b1aa5ac686ea2a">IsEncodeDefaults</a><code> [get, set]</code></td></tr>
<tr class="memdesc:ab1f1547969b60eaf71b1aa5ac686ea2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets or returns if default values of member variables should be encoded. <a href="#ab1f1547969b60eaf71b1aa5ac686ea2a">More...</a><br /></td></tr>
<tr class="separator:ab1f1547969b60eaf71b1aa5ac686ea2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5808ca1e07460f138eb34b3ae244e27"><td class="memItemLeft" align="right" valign="top">Dictionary&lt; string, object &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html#ad5808ca1e07460f138eb34b3ae244e27">Objects</a><code> [get]</code></td></tr>
<tr class="memdesc:ad5808ca1e07460f138eb34b3ae244e27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the object lookup table. <a href="#ad5808ca1e07460f138eb34b3ae244e27">More...</a><br /></td></tr>
<tr class="separator:ad5808ca1e07460f138eb34b3ae244e27"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><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. Here is an example for parsing an existing XML document into a graph model: </p>
<p><a class="el" href="classcom_1_1mxgraph_1_1mxCodec.html" title="XML codec for .NET object graphs. In order to resolve forward references when reading files the XML d...">mxCodec</a> codec = new mxCodec(doc); <a class="el" href="classcom_1_1mxgraph_1_1mxGraph.html" title="Implements a graph object that allows to create diagrams from a graph model and stylesheet. ">mxGraph</a> graph = new mxGraph(); codec.Decode(doc.DocumentElement, graph.Model); </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a07e453ed963ab7bc07639091b9e371cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07e453ed963ab7bc07639091b9e371cb">&#9670;&nbsp;</a></span>mxCodec() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">com.mxgraph.mxCodec.mxCodec </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs an XML encoder/decoder with a new owner document. </p>
</div>
</div>
<a id="abc2542faf421e95e1074c8b4c8b88b21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc2542faf421e95e1074c8b4c8b88b21">&#9670;&nbsp;</a></span>mxCodec() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">com.mxgraph.mxCodec.mxCodec </td>
<td>(</td>
<td class="paramtype">XmlDocument&#160;</td>
<td class="paramname"><em>document</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">document</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>
<p class="reference">References <a class="el" href="classcom_1_1mxgraph_1_1mxUtils.html#af18b643b1cfb52bf5c77b5df5e7c18f9">com.mxgraph.mxUtils.CreateDocument()</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae6bbe6707e3a49bf948be41572871e52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae6bbe6707e3a49bf948be41572871e52">&#9670;&nbsp;</a></span>AddElement()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void com.mxgraph.mxCodec.AddElement </td>
<td>(</td>
<td class="paramtype">XmlNode&#160;</td>
<td class="paramname"><em>node</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds the given element to &lt;elements&gt; if it has an ID. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Node to be added.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aa0ad136f46f6a2b29360bd1537ff30fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0ad136f46f6a2b29360bd1537ff30fc">&#9670;&nbsp;</a></span>Decode() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Object com.mxgraph.mxCodec.Decode </td>
<td>(</td>
<td class="paramtype">XmlNode&#160;</td>
<td class="paramname"><em>node</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Decodes the given XML node using decode(XmlNode, Object). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>XML node to be decoded.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns an object that represents the given node.</dd></dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a7690c0e1b9d4e2e3a84d5811dca5ed10">com.mxgraph.mxObjectCodec.DecodeChild()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#ac5c143df7b7b7c9d8b7a77681b2b9815">com.mxgraph.mxObjectCodec.ProcessInclude()</a>.</p>
</div>
</div>
<a id="aa4d103574f3b6b379d7d7cca995a2a3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa4d103574f3b6b379d7d7cca995a2a3d">&#9670;&nbsp;</a></span>Decode() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Object com.mxgraph.mxCodec.Decode </td>
<td>(</td>
<td class="paramtype">XmlNode&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object&#160;</td>
<td class="paramname"><em>into</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>XML node to be decoded.</td></tr>
<tr><td class="paramname">into</td><td>Optional object to be decodec into.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns an object that represents the given node.</dd></dl>
<p class="reference">References <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a1ecf4a9e08d688c9041d97b6af1c2df0">com.mxgraph.mxObjectCodec.Decode()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxCodecRegistry.html#a26a31214cadf077d0acb37f3f0295c6c">com.mxgraph.mxCodecRegistry.GetCodec()</a>.</p>
</div>
</div>
<a id="a824d4ca6eaa4cf228e055c4485b7ea52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a824d4ca6eaa4cf228e055c4485b7ea52">&#9670;&nbsp;</a></span>DecodeCell()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<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&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>restoreStructures</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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, vertices and edges in a graph. ">mxCell</a> instance that represents the given node. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>XML node that contains the cell data.</td></tr>
<tr><td class="paramname">restoreStructures</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="section return"><dt>Returns</dt><dd>Graph cell that represents the given node.</dd></dl>
<p class="reference">References <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a1ecf4a9e08d688c9041d97b6af1c2df0">com.mxgraph.mxObjectCodec.Decode()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxCodecRegistry.html#a26a31214cadf077d0acb37f3f0295c6c">com.mxgraph.mxCodecRegistry.GetCodec()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxModelCodec.html#a87ebd28e84d602ec87f411744bbe0ef8">com.mxgraph.mxModelCodec.BeforeDecode()</a>.</p>
</div>
</div>
<a id="a3088b2e442dd7ea6f92a7ccba3b12251"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3088b2e442dd7ea6f92a7ccba3b12251">&#9670;&nbsp;</a></span>Encode()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XmlNode com.mxgraph.mxCodec.Encode </td>
<td>(</td>
<td class="paramtype">Object&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Encodes the specified object and returns the resulting XML node. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>Object to be encoded.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns an XML node that represents the given object.</dd></dl>
<p class="reference">References <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#af54fb528308bc68c772398c0f42862ff">com.mxgraph.mxObjectCodec.Encode()</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxCodecRegistry.html#a26a31214cadf077d0acb37f3f0295c6c">com.mxgraph.mxCodecRegistry.GetCodec()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxCodecRegistry.html#a26bc2c27208d17e5419e1964c73f1e92">com.mxgraph.mxCodecRegistry.GetName()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#af82997a9553b5ef4c4c72e22ce89aab2">com.mxgraph.mxObjectCodec.WriteComplexAttribute()</a>.</p>
</div>
</div>
<a id="a52442cecf5ce690681d95496c9673f87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52442cecf5ce690681d95496c9673f87">&#9670;&nbsp;</a></span>EncodeCell()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<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>&#160;</td>
<td class="paramname"><em>cell</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">XmlNode&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>includeChildren</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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 time and used impli...">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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">cell</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, vertices and edges in a graph. ">mxCell</a> to be encoded.</td></tr>
<tr><td class="paramname">node</td><td>Parent XML node to add the encoded cell into.</td></tr>
<tr><td class="paramname">includeChildren</td><td>Boolean indicating if the method should include all descendents</td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a36e9eb9110b62095cdce78caf919c6f4">com.mxgraph.mxICell.ChildCount()</a>, and <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a4d8537b8b40c0fb6ae718d97b647ea5e">com.mxgraph.mxICell.GetChildAt()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxModelCodec.html#acc086a36b6e6fe3119a4db05c73b68c9">com.mxgraph.mxModelCodec.EncodeObject()</a>.</p>
</div>
</div>
<a id="a1910f4beb57b5515cfd5a16119d78de0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1910f4beb57b5515cfd5a16119d78de0">&#9670;&nbsp;</a></span>GetElementById()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XmlNode com.mxgraph.mxCodec.GetElementById </td>
<td>(</td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the element with the given ID from the document. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">id</td><td>ID of the element to be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the element for the given ID.</dd></dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxCellCodec.html#afef8d0281b5a8a7bc75fdf897c5d31b7">com.mxgraph.mxCellCodec.BeforeDecode()</a>.</p>
</div>
</div>
<a id="ae259ea85ae98f767a6ebfb15468652ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae259ea85ae98f767a6ebfb15468652ca">&#9670;&nbsp;</a></span>GetId()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">string com.mxgraph.mxCodec.GetId </td>
<td>(</td>
<td class="paramtype">Object&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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, vertices and edges in a graph. ">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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>Object to return the ID for.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the ID for the given object.</dd></dl>
<p class="reference">References <a class="el" href="classcom_1_1mxgraph_1_1mxCellPath.html#a176ff5fb801eb866aa15dac0e936c702">com.mxgraph.mxCellPath.Create()</a>.</p>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a9f6a46c7f5d672663352742e7379f042">com.mxgraph.mxObjectCodec.EncodeObject()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a126ab2aba3fd6743cc55474b8044296e">com.mxgraph.mxObjectCodec.EncodeValue()</a>.</p>
</div>
</div>
<a id="af7284e48f4139e92b75c38598bec683e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7284e48f4139e92b75c38598bec683e">&#9670;&nbsp;</a></span>GetObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Object com.mxgraph.mxCodec.GetObject </td>
<td>(</td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">id</td><td>ID of the object to be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the object for the given ID.</dd></dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a438a81b33fc988dc9e43e76cf2f1a248">com.mxgraph.mxObjectCodec.DecodeAttribute()</a>.</p>
</div>
</div>
<a id="ae58f38afc74452857f2e339eba51f6b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae58f38afc74452857f2e339eba51f6b6">&#9670;&nbsp;</a></span>InsertIntoGraph()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<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>&#160;</td>
<td class="paramname"><em>cell</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Inserts the given cell into its parent and terminal cells. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">cell</td><td></td></tr>
</table>
</dd>
</dl>
<p class="reference">References <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a30ed7cb4d9fca0f6a5d832fbb77d6f3d">com.mxgraph.mxICell.GetTerminal()</a>, <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a40465416ebdc8d255412d4560d17248e">com.mxgraph.mxICell.Insert()</a>, <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a120872cffb87a5c7998e2965ea55998d">com.mxgraph.mxICell.InsertEdge()</a>, <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a941936fb7b521cb9e1258e236be4d0ff">com.mxgraph.mxICell.Parent</a>, and <a class="el" href="interfacecom_1_1mxgraph_1_1mxICell.html#a4c745d0790959982fd24750992a0e5e9">com.mxgraph.mxICell.SetTerminal()</a>.</p>
</div>
</div>
<a id="abda3b8202fd04cb2e3730d3dd2560f9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abda3b8202fd04cb2e3730d3dd2560f9b">&#9670;&nbsp;</a></span>Lookup()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Object com.mxgraph.mxCodec.Lookup </td>
<td>(</td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">id</td><td>ID of the object to be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the object for the given ID.</dd></dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxCellCodec.html#afef8d0281b5a8a7bc75fdf897c5d31b7">com.mxgraph.mxCellCodec.BeforeDecode()</a>.</p>
</div>
</div>
<a id="a662c18d5b7a3c7d31031653baec1c9fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a662c18d5b7a3c7d31031653baec1c9fa">&#9670;&nbsp;</a></span>PutObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Object com.mxgraph.mxCodec.PutObject </td>
<td>(</td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object&#160;</td>
<td class="paramname"><em>obj</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Assoiates the given object with the given ID. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">id</td><td>ID for the object to be associated with.</td></tr>
<tr><td class="paramname">obj</td><td>Object to be associated with the ID.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the given object.</dd></dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxStylesheetCodec.html#a0b91a548bbfba3a0c29b929ca223f7a4">com.mxgraph.mxStylesheetCodec.Decode()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a27db4f4c90305c7707198e7e29ba1d09">com.mxgraph.mxObjectCodec.Decode()</a>.</p>
</div>
</div>
<a id="a9e373d85a134b3b71d0969fa0faa0e4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e373d85a134b3b71d0969fa0faa0e4c">&#9670;&nbsp;</a></span>Reference()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">string com.mxgraph.mxCodec.Reference </td>
<td>(</td>
<td class="paramtype">Object&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>Object whose ID should be returned.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the ID for the given object.</dd></dl>
</div>
</div>
<a id="a799403c766d5a6c12525fb0278c50e74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a799403c766d5a6c12525fb0278c50e74">&#9670;&nbsp;</a></span>SetAttribute()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void com.mxgraph.mxCodec.SetAttribute </td>
<td>(</td>
<td class="paramtype">XmlNode&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>attribute</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>XML node to set the attribute for.</td></tr>
<tr><td class="paramname">attribute</td><td>Attributename to be set.</td></tr>
<tr><td class="paramname">value</td><td>New value of the attribute.</td></tr>
</table>
</dd>
</dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a9f6a46c7f5d672663352742e7379f042">com.mxgraph.mxObjectCodec.EncodeObject()</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#af82997a9553b5ef4c4c72e22ce89aab2">com.mxgraph.mxObjectCodec.WriteComplexAttribute()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#ad6b38c3626995256419d0d7f9d537b28">com.mxgraph.mxObjectCodec.WritePrimitiveAttribute()</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="aad8ec158a71d86cd392af0f7dc519b63"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad8ec158a71d86cd392af0f7dc519b63">&#9670;&nbsp;</a></span>document</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XmlDocument com.mxgraph.mxCodec.document</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Holds the owner document of the codec. </p>
</div>
</div>
<a id="a6c80fd7a3130d830317a255b41758f30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c80fd7a3130d830317a255b41758f30">&#9670;&nbsp;</a></span>elements</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;string, XmlNode&gt; com.mxgraph.mxCodec.elements = null</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Maps from IDs to elements. </p>
</div>
</div>
<a id="a32a5c223e9e716534ee445271ca770ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32a5c223e9e716534ee445271ca770ff">&#9670;&nbsp;</a></span>encodeDefaults</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool com.mxgraph.mxCodec.encodeDefaults = false</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies if default values should be encoded. Default is false. </p>
</div>
</div>
<a id="a04522d7a38095efb6263bd10518fc6cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04522d7a38095efb6263bd10518fc6cc">&#9670;&nbsp;</a></span>objects</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;string, object&gt; com.mxgraph.mxCodec.objects = new Dictionary&lt;string, Object&gt;()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Maps from IDs to objects. </p>
</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a id="ad62be275d2f44acaf2e8be0a4a07ee4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad62be275d2f44acaf2e8be0a4a07ee4e">&#9670;&nbsp;</a></span>Document</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XmlDocument com.mxgraph.mxCodec.Document</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets or returns the owner document of the codec. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns the owner document.</dd></dl>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxCellCodec.html#a97e9e569ab7a4116d4b91f9ac2f17447">com.mxgraph.mxCellCodec.AfterEncode()</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxStylesheetCodec.html#a0d1d57effb1d0827d40ef39af0f4a5aa">com.mxgraph.mxStylesheetCodec.Encode()</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#af54fb528308bc68c772398c0f42862ff">com.mxgraph.mxObjectCodec.Encode()</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxModelCodec.html#acc086a36b6e6fe3119a4db05c73b68c9">com.mxgraph.mxModelCodec.EncodeObject()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#ad6b38c3626995256419d0d7f9d537b28">com.mxgraph.mxObjectCodec.WritePrimitiveAttribute()</a>.</p>
</div>
</div>
<a id="ab1f1547969b60eaf71b1aa5ac686ea2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1f1547969b60eaf71b1aa5ac686ea2a">&#9670;&nbsp;</a></span>IsEncodeDefaults</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool com.mxgraph.mxCodec.IsEncodeDefaults</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets or returns if default values of member variables should be encoded. </p>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a126ab2aba3fd6743cc55474b8044296e">com.mxgraph.mxObjectCodec.EncodeValue()</a>.</p>
</div>
</div>
<a id="ad5808ca1e07460f138eb34b3ae244e27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5808ca1e07460f138eb34b3ae244e27">&#9670;&nbsp;</a></span>Objects</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;string, object&gt; com.mxgraph.mxCodec.Objects</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the object lookup table. </p>
<p class="reference">Referenced by <a class="el" href="classcom_1_1mxgraph_1_1mxCellCodec.html#afef8d0281b5a8a7bc75fdf897c5d31b7">com.mxgraph.mxCellCodec.BeforeDecode()</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxStylesheetCodec.html#a0b91a548bbfba3a0c29b929ca223f7a4">com.mxgraph.mxStylesheetCodec.Decode()</a>, and <a class="el" href="classcom_1_1mxgraph_1_1mxObjectCodec.html#a27db4f4c90305c7707198e7e29ba1d09">com.mxgraph.mxObjectCodec.Decode()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/io/mxCodec.cs</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>