<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxGraphViewImageReader"></a>mxGraphViewImageReader</h1><divclass=CBody><p>A display XML to image converter. This allows to create an image of a graph without having to parse and create the graph model using the XML file created for the mxGraphView object in the thin client.</p><h4class=CHeading>To create the XML for the mxGraphView on the client</h4><blockquote><preclass="prettyprint">var enc = new mxCodec(mxUtils.createXMLDocument());
var node = enc.encode(editor.graph.view);
var xml = mxUtils.getXML(node);</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxGraphViewImageReader">mxGraphViewImageReader</a></td><tdclass=SDescription>A display XML to image converter. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxGraphViewImageReader.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.canvas"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">canvas</a></td><tdclass=SDescription>Holds the canvas.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxGraphViewImageReader.scale"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">scale</a></td><tdclass=SDescription>Holds the global scale of the graph. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.parser"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">parser</a></td><tdclass=SDescription>Holds the SAX parser.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxGraphViewImageReader.background"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">background</a></td><tdclass=SDescription>Holds the background color.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.border"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">border</a></td><tdclass=SDescription>Holds the border size. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxGraphViewImageReader.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.mxGraphViewImageReader"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">mxGraphViewImageReader</a></td><tdclass=SDescription>Constructs a new image graph view reader.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxGraphViewImageReader.createCanvas"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">createCanvas</a></td><tdclass=SDescription>Returns the canvas to be used for rendering.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.read"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">read</a></td><tdclass=SDescription>Reads the specified view XML string.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxGraphViewImageReader.readFile"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">readFile</a></td><tdclass=SDescription>Reads the specified view XML file in blocks of 4096 bytes.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.startElement"id=link10onMouseOver="ShowTip(event, 'tt10', 'link10')"onMouseOut="HideTip('tt10')">startElement</a></td><tdclass=SDescription>Invoked by the SAX parser when an element starts.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxGraphViewImageReader.parseState"id=link11onMouseOver="ShowTip(event, 'tt11', 'link11')"onMouseOut="HideTip('tt11')">parseState</a></td><tdclass=SDescription>Parses the bounds, absolute points and label information from the style of the state into its respective fields and returns the label of the cell.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphViewImageReader.parsePoints"id=link12onMouseOver="ShowTip(event, 'tt12', 'link12')"onMouseOut="HideTip('tt12')">parsePoints</a></td><tdclass=SDescription>Parses a string that represents a list of points into an array of <ahref="../util/mxPoint-php.html#mxPoint"class=LClassid=link13onMouseOver="ShowTip(event, 'tt13', 'link13')"on
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.canvas"></a>canvas</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $canvas</td></tr></table></blockquote><p>Holds the canvas.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.scale"></a>scale</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $scale</td></tr></table></blockquote><p>Holds the global scale of the graph. This is set just before createCanvas is called.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.parser"></a>parser</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $parser</td></tr></table></blockquote><p>Holds the SAX parser.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.background"></a>background</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $background</td></tr></table></blockquote><p>Holds the background color.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.border"></a>border</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $border</td></tr></table></blockquote><p>Holds the border size. Default is 0.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.mxGraphViewImageReader"></a>mxGraphViewImageReader</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxGraphViewImageReader(</td><tdclass=PParameternowrap>$background</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null,</td></tr><tr><td></td><tdclass=PParameternowrap>$border</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> 0</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new image graph view reader.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.createCanvas"></a>createCanvas</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function createCanvas(</td><tdclass=PParameternowrap>$attrs</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the canvas to be used for rendering.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.read"></a>read</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function read(</td><tdclass=PParameternowrap>$string</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the specified view XML string.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.readFile"></a>readFile</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function readFile(</td><tdclass=PParameternowrap>$filename</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the specified view XML file in blocks of 4096 bytes.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.startElement"></a>startElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function startElement(</td><tdclass=PParameternowrap>$parser,</td></tr><tr><td></td><tdclass=PParameternowrap>$name,</td></tr><tr><td></td><tdclass=PParameternowrap>$attrs</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Invoked by the SAX parser when an element starts.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.parseState"></a>parseState</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function parseState(</td><tdclass=PParameternowrap>$state,</td></tr><tr><td></td><tdclass=PParameternowrap>$edge</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Parses the bounds, absolute points and label information from the style of the state into its respective fields and returns the label of the cell.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.parsePoints"></a>parsePoints</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function parsePoints(</td><tdclass=PParameternowrap>$str</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Parses a string that represents a list of points into an array of <ahref="../util/mxPoint-php.html#mxPoint"class=LClassid=link18onMouseOver="ShowTip(event, 'tt13', 'link18')"onMouseOut="HideTip('tt13')">mxPoints</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.endElement"></a>endElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function endElement(</td><tdclass=PParameternowrap>$parser,</td></tr><tr><td></td><tdclass=PParameternowrap>$name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Invoked by the SAX parser when an element ends.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.destroy"></a>destroy</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>function destroy()</td></tr></table></blockquote><p>Destroy all allocated resources for this reader.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.convert"></a>convert</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function convert(</td><tdclass=PParameternowrap>$string,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$background</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates the image for the given display XML string.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphViewImageReader.convertFile"></a>convertFile</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function convertFile(</td><tdclass=PParameternowrap>$filename,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$background</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates the image for the given display XML file.</p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $canvas</td></tr></table></blockquote>Holds the canvas.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $scale</td></tr></table></blockquote>Holds the global scale of the graph. </div></div><divclass=CToolTipid="tt3"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $parser</td></tr></table></blockquote>Holds the SAX parser.</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $background</td></tr></table></blockquote>Holds the background color.</div></div><divclass=CToolTipid="tt5"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $border</td></tr></table></blockquote>Holds the border size. </div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxGraphViewImageReader(</td><tdclass=PParameternowrap>$background</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null,</td></tr><tr><td></td><tdclass=PParameternowrap>$border</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> 0</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new image graph view reader.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function createCanvas(</td><tdclass=PParameternowrap>$attrs</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the canvas to be used for rendering.</div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function read(</td><tdclass=PParameternowrap>$string</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Reads the specified view XML string.</div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function readFile(</td><tdclass=PParameternowrap>$filename</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Reads the specified view XML file in blocks of 4096 bytes.</div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function startElement(</td><tdclass=PParameternowrap>$parser,</td></tr><tr><td></td><tdclass=PParameternowrap>$name,</td></tr><tr><td></td><tdclass=PParameternowrap>$attrs</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Invoked by the SAX parser when an element starts.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function parseState(</td><tdclass=PParameternowrap>$state,</td></tr><tr><td></td><tdclass=PParameternowrap>$edge</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Parse