<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxUtils"></a>mxUtils</h1><divclass=CBody><p>Helper methods.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxUtils">mxUtils</a></td><tdclass=SDescription>Helper methods.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxUtils.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUtils.getLabelSize"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">getLabelSize</a></td><tdclass=SDescription>Returns the size of the given label.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxUtils.getLabelPaintBounds"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">getLabelPaintBounds</a></td><tdclass=SDescription>Returns the paint bounds for the given label.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUtils.getScaledLabelBounds"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">getScaledLabelBounds</a></td><tdclass=SDescription>Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxUtils.getSizeForString"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">getSizeForString</a></td><tdclass=SDescription>Returns an <ahref="mxRectangle-php.html#mxRectangle"class=LClassid=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">mxRectangle</a> with the size (width and height in pixels) of the given string. </td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUtils.flipImage"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">flipImage</a></td><tdclass=SDescription>Flips the given image horizontally and/or vertically and returns a new image instance.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxUtils.toRadians"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">toRadians</a></td><tdclass=SDescription>Converts the given degree to radians.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUtils.getBoundingBox"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">getBoundingBox</a></td><tdclass=SDescription>Returns the bounding box for the rotated rectangle.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxUtils.getRotatedPoint"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">getRotatedPoint</a></td><tdclass=SDescription>Rotates the given point by the given cos and sin.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUtils.translatePoints"id=link10onMouseOver="ShowTip(event, 'tt10', 'link10')"onMouseOut="HideTip('tt10')">translatePoints</a></td><tdclass=SDescription>Creates a new list of new points obtained by translating the points in the given list by the given vector. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxUtils.contains"id=link11onMouseOver="ShowTip(event, 'tt11', 'link11')"onMouseOut="HideTip('tt11')">contains</a></td><tdclass=SDescription>Returns true if the specified point (x, y) is contained in the given rectangle.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxUtils.intersection"id=link12onMouseOver="ShowTip(event, 'tt12', 'link12')"onMouseOut="HideTip('tt12')">intersection</a></td><tdclass=SDescription>Returns the intersection of two lines as an <ahref="mxPoint-php.html#mxPoint"class=LClassid=link13onMouseOver="ShowTip(event, 'tt13', 'link13')"onMouseO
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getLabelSize"></a>getLabelSize</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getLabelSize(</td><tdclass=PParameternowrap>$label,</td></tr><tr><td></td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the size of the given label.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getLabelPaintBounds"></a>getLabelPaintBounds</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getLabelPaintBounds(</td><tdclass=PParameternowrap>$label,</td></tr><tr><td></td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$isHtml,</td></tr><tr><td></td><tdclass=PParameternowrap>$offset,</td></tr><tr><td></td><tdclass=PParameternowrap>$vertexBounds,</td></tr><tr><td></td><tdclass=PParameternowrap>$scale</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the paint bounds for the given label.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getScaledLabelBounds"></a>getScaledLabelBounds</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getScaledLabelBounds(</td><tdclass=PParameternowrap>$x,</td></tr><tr><td></td><tdclass=PParameternowrap>$y,</td></tr><tr><td></td><tdclass=PParameternowrap>$size,</td></tr><tr><td></td><tdclass=PParameternowrap>$outerWidth,</td></tr><tr><td></td><tdclass=PParameternowrap>$outerHeight,</td></tr><tr><td></td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$scale</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label. (For edge labels this width and height is 0.) The scale is used to scale the given size and the spacings in the specified style.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getSizeForString"></a>getSizeForString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getSizeForString(</td><tdclass=PParameternowrap>$text,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$fontSize</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> 0,</td></tr><tr><td></td><tdclass=PParameternowrap>$fontFamily</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns an <ahref="mxRectangle-php.html#mxRectangle"class=LClassid=link40onMouseOver="ShowTip(event, 'tt5', 'link40')"onMouseOut="HideTip('tt5')">mxRectangle</a> with the size (width and height in pixels) of the given string. The string may contain HTML markup. Newlines should be converted to <br> before calling this method.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>text</td><tdclass=CDLDescription>String whose size should be returned.</td></tr><tr><tdclass=CDLEntry>fontSize</td><tdclass=CDLDescription>Integer that specifies the font size in pixels. Default is <ahref="mxConstants-php.html#mxConstants.DEFAULT_FONTSIZE"class=LVariableid=link41onMouseOver="ShowTip(event, 'tt40', 'link41')"onMouseOut="HideTip('tt40')">mxConstants.DEFAULT_FONTSIZE</a>.</td></tr><tr><tdclass=CDLEntry>fontFamily</td><tdclass=CDLDescription>String that specifies the name of the font famil.y Default is <ahref="mxConstants-php.html#mxConstants.DEFAULT_FONTFAMILY"class=LVariableid=link42onMouseOver="ShowTip(event, 'tt41', 'link42')"onMouseOut="HideTip('tt41')">mxConstants.DEFAULT_FONTFAMILY</a>.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.flipImage"></a>flipImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function flipImage(</td><tdclass=PParameternowrap>$img,</td></tr><tr><td></td><tdclass=PParameternowrap>$flipH,</td></tr><tr><td></td><tdclass=PParameternowrap>$flipV</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Flips the given image horizontally and/or vertically and returns a new image instance.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.toRadians"></a>toRadians</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function toRadians(</td><tdclass=PParameternowrap>$deg</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts the given degree to radians.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getBoundingBox"></a>getBoundingBox</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getBoundingBox(</td><tdclass=PParameternowrap>$rect,</td></tr><tr><td></td><tdclass=PParameternowrap>$rotation</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the bounding box for the rotated rectangle.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getRotatedPoint"></a>getRotatedPoint</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getRotatedPoint(</td><tdclass=PParameternowrap>$pt,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$cos,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$sin,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$cx</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Rotates the given point by the given cos and sin.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.translatePoints"></a>translatePoints</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function translatePoints(</td><tdclass=PParameternowrap>$pts,</td></tr><tr><td></td><tdclass=PParameternowrap>$dx,</td></tr><tr><td></td><tdclass=PParameternowrap>$dy</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new list of new points obtained by translating the points in the given list by the given vector. Elements that are not mxPoints are added to the result as-is.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.contains"></a>contains</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function contains(</td><tdclass=PParameternowrap>$state,</td></tr><tr><td></td><tdclass=PParameternowrap>$x,</td></tr><tr><td></td><tdclass=PParameternowrap>$y</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the specified point (x, y) is contained in the given rectangle.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>bounds</td><tdclass=CDLDescription><ahref="mxRectangle-php.html#mxRectangle"class=LClassid=link43onMouseOver="ShowTip(event, 'tt5', 'link43')"onMouseOut="HideTip('tt5')">mxRectangle</a> that represents the area.</td></tr><tr><tdclass=CDLEntry>x</td><tdclass=CDLDescription>X-coordinate of the point.</td></tr><tr><tdclass=CDLEntry>y</td><tdclass=CDLDescription>Y-coordinate of the point.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.intersection"></a>intersection</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function intersection(</td><tdclass=PParameternowrap>$x0,</td></tr><tr><td></td><tdclass=PParameternowrap>$y0,</td></tr><tr><td></td><tdclass=PParameternowrap>$x1,</td></tr><tr><td></td><tdclass=PParameternowrap>$y1,</td></tr><tr><td></td><tdclass=PParameternowrap>$x2,</td></tr><tr><td></td><tdclass=PParameternowrap>$y2,</td></tr><tr><td></td><tdclass=PParameternowrap>$x3,</td></tr><tr><td></td><tdclass=PParameternowrap>$y3</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the intersection of two lines as an <ahref="mxPoint-php.html#mxPoint"class=LClassid=link44onMouseOver="ShowTip(event, 'tt13', 'link44')"onMouseOut="HideTip('tt13')">mxPoint</a>.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>x0</td><tdclass=CDLDescription>X-coordinate of the first line’s startpoint.</td></tr><tr><tdclass=CDLEntry>y0</td><tdclass=CDLDescription>X-coordinate of the first line’s startpoint.</td></tr><tr><tdclass=CDLEntry>x1</td><tdclass=CDLDescription>X-coordinate of the first line’s endpoint.</td></tr><tr><tdclass=CDLEntry>y1</td><tdclass=CDLDescription>Y-coordinate of the first line’s endpoint.</td></tr><tr><tdclass=CDLEntry>x2</td><tdclass=CDLDescription>X-coordinate of the second line’s startpoint.</td></tr><tr><tdclass=CDLEntry>y2</td><tdclass=CDLDescription>Y-coordinate of the second line’s startpoint.</td></tr><tr><tdclass=CDLEntry>x3</td><tdclass=CDLDescription>X-coordinate of the second line’s endpoint.</td></tr><tr><tdclass=CDLEntry>y3</td><tdclass=CDLDescription>Y-coordinate of the second line’s endpoint.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.encodeImage"></a>encodeImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function encodeImage(</td><tdclass=PParameternowrap>$image,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$format</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%>null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the given image using the GD image encoding routines. Supported formats are gif, jpg and png (default).</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>image</td><tdclass=CDLDescription>GD image to be encoded.</td></tr><tr><tdclass=CDLEntry>format</td><tdclass=CDLDescription>String that defines the encoding format. Default is png.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getStylename"></a>getStylename</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getStylename(</td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the stylename in a style of the form [stylename;|key=value;] or an empty string if the given style does not contain a stylename.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>String of the form [stylename;|key=value;].</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getStylenames"></a>getStylenames</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getStylenames(</td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the stylenames in a style of the form [stylename;|key=value;] or an empty array if the given style does not contain any stylenames.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>String of the form [stylename;|key=value;].</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.indexOfStylename"></a>indexOfStylename</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function indexOfStylename(</td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$stylename</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the index of the given stylename in the given style. This returns -1 if the given stylename does not occur (as a stylename) in the given style, otherwise it returns the index of the first character.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.addStylename"></a>addStylename</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function addStylename(</td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$stylename</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds the specified stylename to the given style if it does not already contain the stylename.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.removeStylename"></a>removeStylename</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function removeStylename(</td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$stylename</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes all occurrences of the specified stylename in the given style and returns the updated style. Trailing semicolons are preserved.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.removeAllStylenames"></a>removeAllStylenames</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function removeAllStylenames(</td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes all stylenames from the given style and returns the updated style.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.setCellStyles"></a>setCellStyles</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function setCellStyles(</td><tdclass=PParameternowrap>$model,</td></tr><tr><td></td><tdclass=PParameternowrap>$cells,</td></tr><tr><td></td><tdclass=PParameternowrap>$key,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Assigns the value for the given key in the styles of the given cells, or removes the key from the styles if the value is null.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>model</td><tdclass=CDLDescription><ahref="../model/mxGraphModel-php.html#mxGraphModel"class=LClassid=link45onMouseOver="ShowTip(event, 'tt42', 'link45')"onMouseOut="HideTip('tt42')">mxGraphModel</a> to execute the transaction in.</td></tr><tr><tdclass=CDLEntry>cells</td><tdclass=CDLDescription>Array of <ahref="../model/mxCell-php.html#mxCell"class=LClassid=link46onMouseOver="ShowTip(event, 'tt43', 'link46')"onMouseOut="HideTip('tt43')">mxCells</a> to be updated.</td></tr><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>Key of the style to be changed.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>New value for the given key.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.setStyle"></a>setStyle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function setStyle(</td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$key,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds or removes the given key, value pair to the style and returns the new style. If value is null or zero length then the key is removed from the style.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>String of the form stylename[;key=value]</td></tr><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>Key of the style to be changed.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>New value for the given key.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.setCellStyleFlags"></a>setCellStyleFlags</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function setCellStyleFlags(</td><tdclass=PParameternowrap>$model,</td></tr><tr><td></td><tdclass=PParameternowrap>$cells,</td></tr><tr><td></td><tdclass=PParameternowrap>$key,</td></tr><tr><td></td><tdclass=PParameternowrap>$flag,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets or toggles the flag bit for the given key in the cell’s styles. If value is null then the flag is toggled.</p><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint">var cells = graph.getSelectionCells();
mxConstants.FONT_BOLD);</pre></blockquote><p>Toggles the bold font style.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>model</td><tdclass=CDLDescription><ahref="../model/mxGraphModel-php.html#mxGraphModel"class=LClassid=link47onMouseOver="ShowTip(event, 'tt42', 'link47')"onMouseOut="HideTip('tt42')">mxGraphModel</a> that contains the cells.</td></tr><tr><tdclass=CDLEntry>cells</td><tdclass=CDLDescription>Array of <ahref="../model/mxCell-php.html#mxCell"class=LClassid=link48onMouseOver="ShowTip(event, 'tt43', 'link48')"onMouseOut="HideTip('tt43')">mxCells</a> to change the style for.</td></tr><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>Key of the style to be changed.</td></tr><tr><tdclass=CDLEntry>flag</td><tdclass=CDLDescription>Integer for the bit to be changed.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>Optional boolean value for the flag.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.setStyleFlag"></a>setStyleFlag</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function setStyleFlag(</td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$key,</td></tr><tr><td></td><tdclass=PParameternowrap>$flag,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets or removes the given key from the specified style and returns the new style. If value is null then the flag is toggled.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>String of the form stylename[;key=value].</td></tr><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>Key of the style to be changed.</td></tr><tr><tdclass=CDLEntry>flag</td><tdclass=CDLDescription>Integer for the bit to be changed.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>Optional boolean value for the given flag.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getValue"></a>getValue</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getValue(</td><tdclass=PParameternowrap>$dict,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$key,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$default</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%>null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the value for key in dictionary or the given default value if no value is defined for the key.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>dict</td><tdclass=CDLDescription>Dictionary that contains the key, value pairs.</td></tr><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>Key whose value should be returned.</td></tr><tr><tdclass=CDLEntry>default</td><tdclass=CDLDescription>Default value to return if the key is undefined. Default is null.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getNumber"></a>getNumber</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getNumber(</td><tdclass=PParameternowrap>$dict,</td><tdclass=PDefaultValuePrefix> </td></tr><tr><td></td><tdclass=PParameternowrap>$key,</td><tdclass=PDefaultValuePrefix> </td></tr><tr><td></td><tdclass=PParameternowrap>$default</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the value for key in dictionary or 0 if no value is defined for the key.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>dict</td><tdclass=CDLDescription>Dictionary that contains the key, value pairs.</td></tr><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>Key whose value should be returned.</td></tr><tr><tdclass=CDLEntry>default</td><tdclass=CDLDescription>Optional default value to return if no value is defined for the given key. Default is 0.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.indexOf"></a>indexOf</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function indexOf(</td><tdclass=PParameternowrap>$array,</td></tr><tr><td></td><tdclass=PParameternowrap>$object</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the index of obj in array or -1 if the array does not contains the given object.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>array</td><tdclass=CDLDescription>Array to check for the given obj.</td></tr><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>Object to find in the given array.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.readFile"></a>readFile</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function readFile(</td><tdclass=PParameternowrap>$filename</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the given filename into a string. Shortcut for file_get_contents.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>filename</td><tdclass=CDLDescription>The name of the file to read.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.isNode"></a>isNode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function isNode(</td><tdclass=PParameternowrap>$value,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$nodeName</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null,</td></tr><tr><td></td><tdclass=PParameternowrap>$attributeName</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null,</td></tr><tr><td></td><tdclass=PParameternowrap>$attributeValue</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given value is an XML node with the node name and if the optional attribute has the specified value.</p><p>This implementation assumes that the given value is a DOM node if the nodeName property is not null.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>Object that should be examined as a node.</td></tr><tr><tdclass=CDLEntry>nodeName</td><tdclass=CDLDescription>String that specifies the node name.</td></tr><tr><tdclass=CDLEntry>attributeName</td><tdclass=CDLDescription>Optional attribute name to check.</td></tr><tr><tdclass=CDLEntry>attributeValue</td><tdclass=CDLDescription>Optional attribute value to check.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.loadImage"></a>loadImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function loadImage(</td><tdclass=PParameternowrap>$url</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Loads an image from the local filesystem, a data URI or any other URL.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.createXmlDocument"></a>createXmlDocument</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>static function createXmlDocument()</td></tr></table></blockquote><p>Returns a new, empty XML document.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.loadXmlDocument"></a>loadXmlDocument</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function loadXmlDocument(</td><tdclass=PParameternowrap>$uri</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a new DOM document for the given URI.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.parseXml"></a>parseXml</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function parseXml(</td><tdclass=PParameternowrap>$xml</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a new DOM document for the given XML string.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.evaluate"></a>evaluate</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function evaluate(</td><tdclass=PParameternowrap>$expression</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Evaluates an expression to a class member. The range of supported expressions is limited to static class members with a dot-notation, such as mxEdgeStyle.ElbowConnector.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.findNode"></a>findNode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function findNode(</td><tdclass=PParameternowrap>$node,</td></tr><tr><td></td><tdclass=PParameternowrap>$attr,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the first node where attr equals value. This implementation does not use XPath.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getTrueTypeFont"></a>getTrueTypeFont</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getTrueTypeFont(</td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the truetype font to be used to draw the text with the given style.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getTrueTypeFontSize"></a>getTrueTypeFontSize</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getTrueTypeFontSize(</td><tdclass=PParameternowrap>$size</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the truetype font size to be used to draw the text with the given style. This returns the fontSize in the style of the default fontsize multiplied with <ttfSizeFactor>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.getFixedFontSize"></a>getFixedFontSize</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getFixedFontSize(</td><tdclass=PParameternowrap>$fontSize,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$fontFamily,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$fontStyle</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%>null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the fixed font size for GD (1 t0 5) for the given font properties</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxUtils.stackTrace"></a>stackTrace</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>static function stackTrace()</td></tr></table></blockquote><p>Prints a simple stack trace in the error log.</p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getLabelSize(</td><tdclass=PParameternowrap>$label,</td></tr><tr><td></td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the size of the given label.</div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getLabelPaintBounds(</td><tdclass=PParameternowrap>$label,</td></tr><tr><td></td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$isHtml,</td></tr><tr><td></td><tdclass=PParameternowrap>$offset,</td></tr><tr><td></td><tdclass=PParameternowrap>$vertexBounds,</td></tr><tr><td></td><tdclass=PParameternowrap>$scale</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the paint bounds for the given label.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getScaledLabelBounds(</td><tdclass=PParameternowrap>$x,</td></tr><tr><td></td><tdclass=PParameternowrap>$y,</td></tr><tr><td></td><tdclass=PParameternowrap>$size,</td></tr><tr><td></td><tdclass=PParameternowrap>$outerWidth,</td></tr><tr><td></td><tdclass=PParameternowrap>$outerHeight,</td></tr><tr><td></td><tdclass=PParameternowrap>$style,</td></tr><tr><td></td><tdclass=PParameternowrap>$scale</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label. </div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getSizeForString(</td><tdclass=PParameternowrap>$text,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$fontSize</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> 0,</td></tr><tr><td></td><tdclass=PParameternowrap>$fontFamily</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns an mxRectangle with the size (width and height in pixels) of the given string. </div></div><divclass=CToolTipid="tt5"><divclass=CClass>Implements a 2-dimensional rectangle with double precision coordinates.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function flipImage(</td><tdclass=PParameternowrap>$img,</td></tr><tr><td></td><tdclass=PParameternowrap>$flipH,</td></tr><tr><td></td><tdclass=PParameternowrap>$flipV</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Flips the given image horizontally and/or vertically and returns a new image instance.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function toRadians(</td><tdclass=PParameternowrap>$deg</t