maxGraph/docs/js-api/files/util/mxUtils-js.html

327 lines
220 KiB
HTML
Raw Normal View History

2012-05-21 20:32:26 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>mxUtils</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.5 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
2013-10-28 08:56:36 +00:00
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="mxUtils"></a>mxUtils</h1><div class=CBody><p>A singleton class that provides cross-browser helper methods.&nbsp; This is a global functionality.&nbsp; To access the functions in this class, use the global classname appended by the functionname.&nbsp; You may have to load chrome://global/content/contentAreaUtils.js to disable certain security restrictions in Mozilla for the <a href="#mxUtils.open" class=LFunction id=link114 onMouseOver="ShowTip(event, 'tt34', 'link114')" onMouseOut="HideTip('tt34')">open</a>, <a href="#mxUtils.save" class=LFunction id=link115 onMouseOver="ShowTip(event, 'tt35', 'link115')" onMouseOut="HideTip('tt35')">save</a>, <a href="#mxUtils.saveAs" class=LFunction id=link116 onMouseOver="ShowTip(event, 'tt36', 'link116')" onMouseOut="HideTip('tt36')">saveAs</a> and <a href="#mxUtils.copy" class=LFunction id=link117 onMouseOver="ShowTip(event, 'tt37', 'link117')" onMouseOut="HideTip('tt37')">copy</a> function.</p><h4 class=CHeading>For example, the following code displays an error message</h4><blockquote><pre class="prettyprint">mxUtils.error('Browser is not supported!', 200, false);</pre></blockquote><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#mxUtils" >mxUtils</a></td><td class=SDescription>A singleton class that provides cross-browser helper methods. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxUtils.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxUtils.errorResource" >errorResource</a></td><td class=SDescription>Specifies the resource key for the title of the error window. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxUtils.closeResource" >closeResource</a></td><td class=SDescription>Specifies the resource key for the label of the close button. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxUtils.errorImage" >errorImage</a></td><td class=SDescription>Defines the image used for error dialogs.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxUtils.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxUtils.removeCursors" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">removeCursors</a></td><td class=SDescription>Removes the cursors from the style of the given DOM node and its descendants.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxUtils.getCurrentStyle" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">getCurrentStyle</a></td><td class=SDescription>Returns the current style of the specified element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxUtils.setPrefixedStyle" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">setPrefixedStyle</a></td><td class=SDescription>Adds the given style with the standard name and an optional vendor prefix for the current browser.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxUtils.hasScrollbars" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">hasScrollbars</a></td><td class=SDescription>Returns true if the overflow CSS property of the given node is either scroll or auto.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxUtils.bind" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">bind</a></td><td class=SDescription>Returns a wrapper function that locks the execution scope of the given function to the specified scope. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxUtils.eval" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">eval</a></td><td class=SDescription
2012-05-21 20:32:26 +00:00
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxUtils.Variables"></a>Variables</h3></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxUtils.errorResource"></a>errorResource</h3><div class=CBody><p>Specifies the resource key for the title of the error window.&nbsp; If the resource for this key does not exist then the value is used as the title.&nbsp; Default is &lsquo;error&rsquo;.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxUtils.closeResource"></a>closeResource</h3><div class=CBody><p>Specifies the resource key for the label of the close button.&nbsp; If the resource for this key does not exist then the value is used as the label.&nbsp; Default is &lsquo;close&rsquo;.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxUtils.errorImage"></a>errorImage</h3><div class=CBody><p>Defines the image used for error dialogs.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxUtils.Functions"></a>Functions</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.removeCursors"></a>removeCursors</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeCursors: function(</td><td class=PParameter nowrap>element</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes the cursors from the style of the given DOM node and its descendants.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>element</td><td class=CDLDescription>DOM node to remove the cursor style from.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getCurrentStyle"></a>getCurrentStyle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>getCurrentStyle: function()</td></tr></table></blockquote><p>Returns the current style of the specified element.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>element</td><td class=CDLDescription>DOM node whose current style should be returned.</td></tr></table></div></div></div>
2013-07-12 07:09:46 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.setPrefixedStyle"></a>setPrefixedStyle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>setPrefixedStyle: function()</td></tr></table></blockquote><p>Adds the given style with the standard name and an optional vendor prefix for the current browser.</p><blockquote><pre class="prettyprint">mxUtils.setPrefixedStyle(node.style, 'transformOrigin', '0% 0%');</pre></blockquote></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.hasScrollbars"></a>hasScrollbars</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>hasScrollbars: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the overflow CSS property of the given node is either scroll or auto.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node whose style should be checked for scrollbars.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.bind"></a>bind</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>bind: function(</td><td class=PParameter nowrap>scope,</td></tr><tr><td></td><td class=PParameter nowrap>funct</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a wrapper function that locks the execution scope of the given function to the specified scope.&nbsp; Inside funct, the &ldquo;this&rdquo; keyword becomes a reference to that scope.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.eval"></a>eval</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>eval: function(</td><td class=PParameter nowrap>expr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Evaluates the given expression using eval and returns the JavaScript object that represents the expression result.&nbsp; Supports evaluation of expressions that define functions and returns the function object for these expressions.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>expr</td><td class=CDLDescription>A string that represents a JavaScript expression.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.findNode"></a>findNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>findNode: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the first node where attr equals value.&nbsp; This implementation does not use XPath.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.findNodeByAttribute"></a>findNodeByAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>findNodeByAttribute: function()</td></tr></table></blockquote><p>Returns the first node where the given attribute matches the given value.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>Root node where the search should start.</td></tr><tr><td class=CDLEntry>attr</td><td class=CDLDescription>Name of the attribute to be checked.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the attribute to match.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getFunctionName"></a>getFunctionName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getFunctionName: function(</td><td class=PParameter nowrap>f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the name for the given function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>f</td><td class=CDLDescription>JavaScript object that represents a function.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.indexOf"></a>indexOf</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>indexOf: function(</td><td class=PParameter nowrap>array,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>array</td><td class=CDLDescription>Array to check for the given obj.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to find in the given array.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.remove"></a>remove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>remove: function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>array</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes all occurrences of the given object in the given array or object.&nbsp; If there are multiple occurrences of the object, be they associative or as an array entry, all occurrences are removed from the array or deleted from the object.&nbsp; By removing the object from the array, all elements following the removed element are shifted by one step towards the beginning of the array.</p><p>The length of arrays is not modified inside this function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to find in the given array.</td></tr><tr><td class=CDLEntry>array</td><td class=CDLDescription>Array to check for the given obj.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.isNode"></a>isNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isNode: function(</td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>nodeName,</td></tr><tr><td></td><td class=PParameter nowrap>attributeName,</td></tr><tr><td></td><td class=PParameter nowrap>attributeValue</td><td class=PAfterParameters nowrap>)</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 nodeType property is numeric, that is, if isNaN returns false for value.nodeType.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>value</td><td class=CDLDescription>Object that should be examined as a node.</td></tr><tr><td class=CDLEntry>nodeName</td><td class=CDLDescription>String that specifies the node name.</td></tr><tr><td class=CDLEntry>attributeName</td><td class=CDLDescription>Optional attribute name to check.</td></tr><tr><td class=CDLEntry>attributeValue</td><td class=CDLDescription>Optional attribute value to check.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getChildNodes"></a>getChildNodes</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getChildNodes: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>nodeType</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns an array of child nodes that are of the given node type.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>Parent DOM node to return the children from.</td></tr><tr><td class=CDLEntry>nodeType</td><td class=CDLDescription>Optional node type to return.&nbsp; Default is <a href="mxConstants-js.html#mxConstants.NODETYPE_ELEMENT" class=LVariable id=link118 onMouseOver="ShowTip(event, 'tt107', 'link118')" onMouseOut="HideTip('tt107')">mxConstants.NODETYPE_ELEMENT</a>.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.createXmlDocument"></a>createXmlDocument</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>createXmlDocument: function()</td></tr></table></blockquote><p>Returns a new, empty XML document.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.parseXml"></a>parseXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>parseXml: function()</td></tr></table></blockquote><p>Parses the specified XML string into a new XML document and returns the new document.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">var doc = mxUtils.parseXml(
'&lt;mxGraphModel&gt;&lt;root&gt;&lt;MyDiagram id=&quot;0&quot;&gt;&lt;mxCell/&gt;&lt;/MyDiagram&gt;'+
'&lt;MyLayer id=&quot;1&quot;&gt;&lt;mxCell parent=&quot;0&quot; /&gt;&lt;/MyLayer&gt;&lt;MyObject id=&quot;2&quot;&gt;'+
'&lt;mxCell style=&quot;strokeColor=blue;fillColor=red&quot; parent=&quot;1&quot; vertex=&quot;1&quot;&gt;'+
'&lt;mxGeometry x=&quot;10&quot; y=&quot;10&quot; width=&quot;80&quot; height=&quot;30&quot; as=&quot;geometry&quot;/&gt;'+
'&lt;/mxCell&gt;&lt;/MyObject&gt;&lt;/root&gt;&lt;/mxGraphModel&gt;');</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>xml</td><td class=CDLDescription>String that contains the XML data.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.clearSelection"></a>clearSelection</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>clearSelection: function()</td></tr></table></blockquote><p>Clears the current selection in the page.</p></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getPrettyXML"></a>getPrettyXML</h3><div class=CBody><p>Returns a pretty printed string that represents the XML tree for the given node.&nbsp; This method should only be used to print XML for reading, use <a href="#mxUtils.getXml" class=LFunction id=link119 onMouseOver="ShowTip(event, 'tt20', 'link119')" onMouseOut="HideTip('tt20')">getXml</a> instead to obtain a string for processing.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node to return the XML for.</td></tr><tr><td class=CDLEntry>tab</td><td class=CDLDescription>Optional string that specifies the indentation for one level.&nbsp; Default is two spaces.</td></tr><tr><td class=CDLEntry>indent</td><td class=CDLDescription>Optional string that represents the current indentation.&nbsp; Default is an empty string.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.removeWhitespace"></a>removeWhitespace</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeWhitespace: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>before</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes the sibling text nodes for the given node that only consists of tabs, newlines and spaces.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node whose siblings should be removed.</td></tr><tr><td class=CDLEntry>before</td><td class=CDLDescription>Optional boolean that specifies the direction of the traversal.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.htmlEntities"></a>htmlEntities</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>htmlEntities: function(</td><td class=PParameter nowrap>s,</td></tr><tr><td></td><td class=PParameter nowrap>newline</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Replaces characters (less than, greater than, newlines and quotes) with their HTML entities in the given string and returns the result.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>String that contains the characters to be converted.</td></tr><tr><td class=CDLEntry>newline</td><td class=CDLDescription>If newlines should be replaced.&nbsp; Default is true.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.isVml"></a>isVml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isVml: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given node is in the VML namespace.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node whose tag urn should be checked.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getXml"></a>getXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getXml: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>linefeed</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the XML content of the specified node.&nbsp; For Internet Explorer, all \r\n\t[\t]* are removed from the XML string and the remaining \r\n are replaced by \n.&nbsp; All \n are then replaced with linefeed, or &amp;#xa; if no linefeed is defined.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node to return the XML for.</td></tr><tr><td class=CDLEntry>linefeed</td><td class=CDLDescription>Optional string that linefeeds are converted into.&nbsp; Default is &amp;#xa;</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getTextContent"></a>getTextContent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getTextContent: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the text content of the specified node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node to return the text content for.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getInnerHtml"></a>getInnerHtml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>getInnerHtml: function()</td></tr></table></blockquote><p>Returns the inner HTML for the given node as a string or an empty string if no node was specified.&nbsp; The inner HTML is the text representing all children of the node, but not the node itself.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node to return the inner HTML for.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getOuterHtml"></a>getOuterHtml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>getOuterHtml: function()</td></tr></table></blockquote><p>Returns the outer HTML for the given node as a string or an empty string if no node was specified.&nbsp; The outer HTML is the text representing all children of the node including the node itself.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node to return the outer HTML for.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.write"></a>write</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>write: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a text node for the given string and appends it to the given parent.&nbsp; Returns the text node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to append the text node to.</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>String representing the text to be added.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.writeln"></a>writeln</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>writeln: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a text node for the given string and appends it to the given parent with an additional linefeed.&nbsp; Returns the text node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to append the text node to.</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>String representing the text to be added.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.br"></a>br</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>br: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>count</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Appends a linebreak to the given parent and returns the linebreak.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to append the linebreak to.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.button"></a>button</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>button: function(</td><td class=PParameter nowrap>label,</td></tr><tr><td></td><td class=PParameter nowrap>funct,</td></tr><tr><td></td><td class=PParameter nowrap>doc</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a new button with the given level and function as an onclick event handler.</p><blockquote><pre class="prettyprint">document.body.appendChild(mxUtils.button('Test', function(evt)
{
alert('Hello, World!');
}));</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>label</td><td class=CDLDescription>String that represents the label of the button.</td></tr><tr><td class=CDLEntry>funct</td><td class=CDLDescription>Function to be called if the button is pressed.</td></tr><tr><td class=CDLEntry>doc</td><td class=CDLDescription>Optional document to be used for creating the button.&nbsp; Default is the current document.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.para"></a>para</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>para: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Appends a new paragraph with the given text to the specified parent and returns the paragraph.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to append the text node to.</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>String representing the text for the new paragraph.</td></tr></table></div></div></div>
2013-05-23 16:14:48 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.addTransparentBackgroundFilter"></a>addTransparentBackgroundFilter</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addTransparentBackgroundFilter: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a transparent background to the filter of the given node.&nbsp; This background can be used in IE8 standards mode (native IE8 only) to pass events through the node.</p></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.linkAction"></a>linkAction</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>linkAction: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text,</td></tr><tr><td></td><td class=PParameter nowrap>editor,</td></tr><tr><td></td><td class=PParameter nowrap>action,</td></tr><tr><td></td><td class=PParameter nowrap>pad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a hyperlink to the specified parent that invokes action on the specified editor.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to contain the new link.</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>String that is used as the link label.</td></tr><tr><td class=CDLEntry>editor</td><td class=CDLDescription><a href="../editor/mxEditor-js.html#mxEditor" class=LClass id=link120 onMouseOver="ShowTip(event, 'tt108', 'link120')" onMouseOut="HideTip('tt108')">mxEditor</a> that will execute the action.</td></tr><tr><td class=CDLEntry>action</td><td class=CDLDescription>String that defines the name of the action to be executed.</td></tr><tr><td class=CDLEntry>pad</td><td class=CDLDescription>Optional left-padding for the link.&nbsp; Default is 0.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.linkInvoke"></a>linkInvoke</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>linkInvoke: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text,</td></tr><tr><td></td><td class=PParameter nowrap>editor,</td></tr><tr><td></td><td class=PParameter nowrap>functName,</td></tr><tr><td></td><td class=PParameter nowrap>arg,</td></tr><tr><td></td><td class=PParameter nowrap>pad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a hyperlink to the specified parent that invokes the specified function on the editor passing along the specified argument.&nbsp; The function name is the name of a function of the editor instance, not an action name.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to contain the new link.</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>String that is used as the link label.</td></tr><tr><td class=CDLEntry>editor</td><td class=CDLDescription><a href="../editor/mxEditor-js.html#mxEditor" class=LClass id=link121 onMouseOver="ShowTip(event, 'tt108', 'link121')" onMouseOut="HideTip('tt108')">mxEditor</a> instance to execute the function on.</td></tr><tr><td class=CDLEntry>functName</td><td class=CDLDescription>String that represents the name of the function.</td></tr><tr><td class=CDLEntry>arg</td><td class=CDLDescription>Object that represents the argument to the function.</td></tr><tr><td class=CDLEntry>pad</td><td class=CDLDescription>Optional left-padding for the link.&nbsp; Default is 0.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.link"></a>link</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>link: function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text,</td></tr><tr><td></td><td class=PParameter nowrap>funct,</td></tr><tr><td></td><td class=PParameter nowrap>pad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a hyperlink to the specified parent and invokes the given function when the link is clicked.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>DOM node to contain the new link.</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>String that is used as the link label.</td></tr><tr><td class=CDLEntry>funct</td><td class=CDLDescription>Function to execute when the link is clicked.</td></tr><tr><td class=CDLEntry>pad</td><td class=CDLDescription>Optional left-padding for the link.&nbsp; Default is 0.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.fit"></a>fit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>fit: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Makes sure the given node is inside the visible area of the window.&nbsp; This is done by setting the left and top in the style.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.open"></a>open</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>open: function(</td><td class=PParameter nowrap>filename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Opens the specified file from the local filesystem and returns the contents of the file as a string.&nbsp; This implementation requires an ActiveX object in IE and special privileges in Firefox.&nbsp; Relative filenames are only supported in IE and will go onto the users&rsquo; Desktop.&nbsp; You may have to load chrome://global/content/contentAreaUtils.js to disable certain security restrictions in Mozilla for this to work.</p><p>See known-issues before using this function.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">var data = mxUtils.open('C:\\temp\\test.txt');
mxUtils.alert('Data: '+data);</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>filename</td><td class=CDLDescription>String representing the local file name.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.save"></a>save</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>save: function(</td><td class=PParameter nowrap>filename,</td></tr><tr><td></td><td class=PParameter nowrap>content</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Saves the specified content in the given file on the local file system.&nbsp; This implementation requires an ActiveX object in IE and special privileges in Firefox.&nbsp; Relative filenames are only supported in IE and will be loaded from the users&rsquo; Desktop.&nbsp; You may have to load chrome://global/content/contentAreaUtils.js to disable certain security restrictions in Mozilla for this to work.</p><p>See known-issues before using this function.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">var data = 'Hello, World!';
mxUtils.save('C:\\test.txt', data);</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>filename</td><td class=CDLDescription>String representing the local file name.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.saveAs"></a>saveAs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>saveAs: function(</td><td class=PParameter nowrap>content</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Saves the specified content by displaying a dialog to save the content as a file on the local filesystem.&nbsp; This implementation does not use an ActiveX object in IE, however, it does require special privileges in Firefox.&nbsp; You may have to load chrome://global/content/contentAreaUtils.js to disable certain security restrictions in Mozilla for this to work.</p><p>See known-issues before using this function.&nbsp; It is not recommended using this function in production environment as access to the filesystem cannot be guaranteed in Firefox.&nbsp; The following code is used in Firefox to try and enable saving to the filesystem.</p><blockquote><pre class="prettyprint">netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');</pre></blockquote><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">mxUtils.saveAs('Hello, World!');</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>content</td><td class=CDLDescription>String representing the file&rsquo;s content.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.copy"></a>copy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>copy: function(</td><td class=PParameter nowrap>content</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copies the specified content to the local clipboard.&nbsp; This implementation requires special privileges in Firefox.&nbsp; You may have to load chrome://global/content/contentAreaUtils.js to disable certain security restrictions in Mozilla for this to work.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>content</td><td class=CDLDescription>String to be copied to the clipboard.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.load"></a>load</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>load: function(</td><td class=PParameter nowrap>url</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Loads the specified URL <b>synchronously</b> and returns the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link122 onMouseOver="ShowTip(event, 'tt39', 'link122')" onMouseOut="HideTip('tt39')">mxXmlRequest</a>.&nbsp; Throws an exception if the file cannot be loaded.&nbsp; See <a href="#mxUtils.get" class=LFunction id=link123 onMouseOver="ShowTip(event, 'tt40', 'link123')" onMouseOut="HideTip('tt40')">mxUtils.get</a> for an asynchronous implementation.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">try
2012-05-21 20:32:26 +00:00
{
var req = mxUtils.load(filename);
var root = req.getDocumentElement();
// Process XML DOM...
}
catch (ex)
{
mxUtils.alert('Cannot load '+filename+': '+ex);
}</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>URL to get the data from.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.get"></a>get</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>get: function(</td><td class=PParameter nowrap>url,</td></tr><tr><td></td><td class=PParameter nowrap>onload,</td></tr><tr><td></td><td class=PParameter nowrap>onerror</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Loads the specified URL <b>asynchronously</b> and invokes the given functions depending on the request status.&nbsp; Returns the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link124 onMouseOver="ShowTip(event, 'tt39', 'link124')" onMouseOut="HideTip('tt39')">mxXmlRequest</a> in use.&nbsp; Both functions take the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link125 onMouseOver="ShowTip(event, 'tt39', 'link125')" onMouseOut="HideTip('tt39')">mxXmlRequest</a> as the only parameter.&nbsp; See <a href="#mxUtils.load" class=LFunction id=link126 onMouseOver="ShowTip(event, 'tt38', 'link126')" onMouseOut="HideTip('tt38')">mxUtils.load</a> for a synchronous implementation.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">mxUtils.get(url, function(req)
2012-05-21 20:32:26 +00:00
{
var node = req.getDocumentElement();
// Process XML DOM...
});</pre></blockquote><p>So for example, to load a diagram into an existing graph model, the following code is used.</p><blockquote><pre class="prettyprint">mxUtils.get(url, function(req)
{
var node = req.getDocumentElement();
var dec = new mxCodec(node.ownerDocument);
dec.decode(node, graph.getModel());
});</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>URL to get the data from.</td></tr><tr><td class=CDLEntry>onload</td><td class=CDLDescription>Optional function to execute for a successful response.</td></tr><tr><td class=CDLEntry>onerror</td><td class=CDLDescription>Optional function to execute on error.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.post"></a>post</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>post: function(</td><td class=PParameter nowrap>url,</td></tr><tr><td></td><td class=PParameter nowrap>params,</td></tr><tr><td></td><td class=PParameter nowrap>onload,</td></tr><tr><td></td><td class=PParameter nowrap>onerror</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Posts the specified params to the given URL <b>asynchronously</b> and invokes the given functions depending on the request status.&nbsp; Returns the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link127 onMouseOver="ShowTip(event, 'tt39', 'link127')" onMouseOut="HideTip('tt39')">mxXmlRequest</a> in use.&nbsp; Both functions take the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link128 onMouseOver="ShowTip(event, 'tt39', 'link128')" onMouseOut="HideTip('tt39')">mxXmlRequest</a> as the only parameter.&nbsp; Make sure to use encodeURIComponent for the parameter values.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">mxUtils.post(url, 'key=value', function(req)
2012-05-21 20:32:26 +00:00
{
mxUtils.alert('Ready: '+req.isReady()+' Status: '+req.getStatus());
// Process req.getDocumentElement() using DOM API if OK...
});</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>URL to get the data from.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>Parameters for the post request.</td></tr><tr><td class=CDLEntry>onload</td><td class=CDLDescription>Optional function to execute for a successful response.</td></tr><tr><td class=CDLEntry>onerror</td><td class=CDLDescription>Optional function to execute on error.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.submit"></a>submit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>submit: function(</td><td class=PParameter nowrap>url,</td></tr><tr><td></td><td class=PParameter nowrap>params,</td></tr><tr><td></td><td class=PParameter nowrap>doc,</td></tr><tr><td></td><td class=PParameter nowrap>target</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Submits the given parameters to the specified URL using <a href="mxXmlRequest-js.html#mxXmlRequest.simulate" class=LFunction id=link129 onMouseOver="ShowTip(event, 'tt43', 'link129')" onMouseOut="HideTip('tt43')">mxXmlRequest.simulate</a> and returns the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link130 onMouseOver="ShowTip(event, 'tt39', 'link130')" onMouseOut="HideTip('tt39')">mxXmlRequest</a>.&nbsp; Make sure to use encodeURIComponent for the parameter values.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>URL to get the data from.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>Parameters for the form.</td></tr><tr><td class=CDLEntry>doc</td><td class=CDLDescription>Document to create the form in.</td></tr><tr><td class=CDLEntry>target</td><td class=CDLDescription>Target to send the form result to.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.loadInto"></a>loadInto</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>loadInto: function(</td><td class=PParameter nowrap>url,</td></tr><tr><td></td><td class=PParameter nowrap>doc,</td></tr><tr><td></td><td class=PParameter nowrap>onload</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Loads the specified URL <b>asynchronously</b> into the specified document, invoking onload after the document has been loaded.&nbsp; This implementation does not use <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link131 onMouseOver="ShowTip(event, 'tt39', 'link131')" onMouseOut="HideTip('tt39')">mxXmlRequest</a>, but the document.load method.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>URL to get the data from.</td></tr><tr><td class=CDLEntry>doc</td><td class=CDLDescription>The document to load the URL into.</td></tr><tr><td class=CDLEntry>onload</td><td class=CDLDescription>Function to execute when the URL has been loaded.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getValue"></a>getValue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getValue: function(</td><td class=PParameter nowrap>array,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>defaultValue</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the value for the given key in the given associative array or the given default value if the value is null.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>array</td><td class=CDLDescription>Associative array that contains the value for the key.</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key whose value should be returned.</td></tr><tr><td class=CDLEntry>defaultValue</td><td class=CDLDescription>Value to be returned if the value for the given key is null.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getNumber"></a>getNumber</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getNumber: function(</td><td class=PParameter nowrap>array,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>defaultValue</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the numeric value for the given key in the given associative array or the given default value (or 0) if the value is null.&nbsp; The value is converted to a numeric value using the Number function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>array</td><td class=CDLDescription>Associative array that contains the value for the key.</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key whose value should be returned.</td></tr><tr><td class=CDLEntry>defaultValue</td><td class=CDLDescription>Value to be returned if the value for the given key is null.&nbsp; Default is 0.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getColor"></a>getColor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getColor: function(</td><td class=PParameter nowrap>array,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>defaultValue</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the color value for the given key in the given associative array or the given default value if the value is null.&nbsp; If the value is <a href="mxConstants-js.html#mxConstants.NONE" class=LVariable id=link132 onMouseOver="ShowTip(event, 'tt109', 'link132')" onMouseOut="HideTip('tt109')">mxConstants.NONE</a> then null is returned.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>array</td><td class=CDLDescription>Associative array that contains the value for the key.</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key whose value should be returned.</td></tr><tr><td class=CDLEntry>defaultValue</td><td class=CDLDescription>Value to be returned if the value for the given key is null.&nbsp; Default is null.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.clone"></a>clone</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>clone: function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>transients,</td></tr><tr><td></td><td class=PParameter nowrap>shallow</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Recursively clones the specified object ignoring all fieldnames in the given array of transient fields.&nbsp; <a href="mxObjectIdentity-js.html#mxObjectIdentity.FIELD_NAME" class=LVariable id=link133 onMouseOver="ShowTip(event, 'tt110', 'link133')" onMouseOut="HideTip('tt110')">mxObjectIdentity.FIELD_NAME</a> is always ignored by this function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be cloned.</td></tr><tr><td class=CDLEntry>transients</td><td class=CDLDescription>Optional array of strings representing the fieldname to be ignored.</td></tr><tr><td class=CDLEntry>shallow</td><td class=CDLDescription>Optional boolean argument to specify if a shallow clone should be created, that is, one where all object references are not cloned or, in other words, one where only atomic (strings, numbers) values are cloned.&nbsp; Default is false.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.equalPoints"></a>equalPoints</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>equalPoints: function(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Compares all mxPoints in the given lists.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>Array of <a href="mxPoint-js.html#mxPoint" class=LClass id=link134 onMouseOver="ShowTip(event, 'tt64', 'link134')" onMouseOut="HideTip('tt64')">mxPoints</a> to be compared.</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>Array of <a href="mxPoint-js.html#mxPoint" class=LClass id=link135 onMouseOver="ShowTip(event, 'tt64', 'link135')" onMouseOut="HideTip('tt64')">mxPoints</a> to be compared.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.equalEntries"></a>equalEntries</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>equalEntries: function(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if all entries of the given objects are equal.&nbsp; Values with with Number.NaN are equal to Number.NaN and unequal to any other value.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link136 onMouseOver="ShowTip(event, 'tt95', 'link136')" onMouseOut="HideTip('tt95')">mxRectangle</a> to be compared.</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link137 onMouseOver="ShowTip(event, 'tt95', 'link137')" onMouseOut="HideTip('tt95')">mxRectangle</a> to be compared.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.isNaN"></a>isNaN</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isNaN: function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given value is of type number and isNaN returns true.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.extend"></a>extend</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>extend: function(</td><td class=PParameter nowrap>ctor,</td></tr><tr><td></td><td class=PParameter nowrap>superCtor</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Assigns a copy of the superclass prototype to the subclass prototype.&nbsp; Note that this does not call the constructor of the superclass at this point, the superclass constructor should be called explicitely in the subclass constructor.&nbsp; Below is an example.</p><blockquote><pre class="prettyprint">MyGraph = function(container, model, renderHint, stylesheet)
{
mxGraph.call(this, container, model, renderHint, stylesheet);
}
mxUtils.extend(MyGraph, mxGraph);</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ctor</td><td class=CDLDescription>Constructor of the subclass.</td></tr><tr><td class=CDLEntry>superCtor</td><td class=CDLDescription>Constructor of the superclass.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.toString"></a>toString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>toString: function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a textual representation of the specified object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to return the string representation for.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.toRadians"></a>toRadians</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>toRadians: function(</td><td class=PParameter nowrap>deg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts the given degree to radians.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.arcToCurves"></a>arcToCurves</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>arcToCurves: function(</td><td class=PParameter nowrap>x0,</td></tr><tr><td></td><td class=PParameter nowrap>y0,</td></tr><tr><td></td><td class=PParameter nowrap>r1,</td></tr><tr><td></td><td class=PParameter nowrap>r2,</td></tr><tr><td></td><td class=PParameter nowrap>angle,</td></tr><tr><td></td><td class=PParameter nowrap>largeArcFlag,</td></tr><tr><td></td><td class=PParameter nowrap>sweepFlag,</td></tr><tr><td></td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts the given arc to a series of curves.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getBoundingBox"></a>getBoundingBox</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getBoundingBox: function(</td><td class=PParameter nowrap>rect,</td></tr><tr><td></td><td class=PParameter nowrap>rotation</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the bounding box for the rotated rectangle.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getRotatedPoint"></a>getRotatedPoint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getRotatedPoint: function(</td><td class=PParameter nowrap>pt,</td></tr><tr><td></td><td class=PParameter nowrap>cos,</td></tr><tr><td></td><td class=PParameter nowrap>sin,</td></tr><tr><td></td><td class=PParameter nowrap>c</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Rotates the given point by the given cos and sin.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.reversePortConstraints"></a>reversePortConstraints</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>reversePortConstraints: function(</td><td class=PParameter nowrap>constraint</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Reverse the port constraint bitmask.&nbsp; For example, north | east becomes south | west</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.findNearestSegment"></a>findNearestSegment</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>findNearestSegment: function(</td><td class=PParameter nowrap>state,</td></tr><tr><td></td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Finds the index of the nearest segment on the given cell state for the specified coordinate pair.</p></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.rectangleIntersectsSegment"></a>rectangleIntersectsSegment</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>rectangleIntersectsSegment: function(</td><td class=PParameter nowrap>bounds,</td></tr><tr><td></td><td class=PParameter nowrap>p1,</td></tr><tr><td></td><td class=PParameter nowrap>p2</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given rectangle intersects the given segment.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>bounds</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link138 onMouseOver="ShowTip(event, 'tt95', 'link138')" onMouseOut="HideTip('tt95')">mxRectangle</a> that represents the rectangle.</td></tr><tr><td class=CDLEntry>p1</td><td class=CDLDescription><a href="mxPoint-js.html#mxPoint" class=LClass id=link139 onMouseOver="ShowTip(event, 'tt64', 'link139')" onMouseOut="HideTip('tt64')">mxPoint</a> that represents the first point of the segment.</td></tr><tr><td class=CDLEntry>p2</td><td class=CDLDescription><a href="mxPoint-js.html#mxPoint" class=LClass id=link140 onMouseOver="ShowTip(event, 'tt64', 'link140')" onMouseOut="HideTip('tt64')">mxPoint</a> that represents the second point of the segment.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.contains"></a>contains</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>contains: function(</td><td class=PParameter nowrap>bounds,</td></tr><tr><td></td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the specified point (x, y) is contained in the given rectangle.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>bounds</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link141 onMouseOver="ShowTip(event, 'tt95', 'link141')" onMouseOut="HideTip('tt95')">mxRectangle</a> that represents the area.</td></tr><tr><td class=CDLEntry>x</td><td class=CDLDescription>X-coordinate of the point.</td></tr><tr><td class=CDLEntry>y</td><td class=CDLDescription>Y-coordinate of the point.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.intersects"></a>intersects</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>intersects: function(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the two rectangles intersect.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link142 onMouseOver="ShowTip(event, 'tt95', 'link142')" onMouseOut="HideTip('tt95')">mxRectangle</a> to be checked for intersection.</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link143 onMouseOver="ShowTip(event, 'tt95', 'link143')" onMouseOut="HideTip('tt95')">mxRectangle</a> to be checked for intersection.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.intersects"></a>intersects</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>intersectsHotspot: function(</td><td class=PParameter nowrap>state,</td></tr><tr><td></td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>hotspot,</td></tr><tr><td></td><td class=PParameter nowrap>min,</td></tr><tr><td></td><td class=PParameter nowrap>max</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the two rectangles intersect.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link144 onMouseOver="ShowTip(event, 'tt95', 'link144')" onMouseOut="HideTip('tt95')">mxRectangle</a> to be checked for intersection.</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription><a href="mxRectangle-js.html#mxRectangle" class=LClass id=link145 onMouseOver="ShowTip(event, 'tt95', 'link145')" onMouseOut="HideTip('tt95')">mxRectangle</a> to be checked for intersection.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getOffset"></a>getOffset</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getOffset: function(</td><td class=PParameter nowrap>container,</td></tr><tr><td></td><td class=PParameter nowrap>scrollOffset</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the offset for the specified container as an <a href="mxPoint-js.html#mxPoint" class=LClass id=link146 onMouseOver="ShowTip(event, 'tt64', 'link146')" onMouseOut="HideTip('tt64')">mxPoint</a>.&nbsp; The offset is the distance from the top left corner of the container to the top left corner of the document.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>container</td><td class=CDLDescription>DOM node to return the offset for.</td></tr><tr><td class=CDLEntry>scollOffset</td><td class=CDLDescription>Optional boolean to add the scroll offset of the document.&nbsp; Default is false.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getScrollOrigin"></a>getScrollOrigin</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getScrollOrigin: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the top, left corner of the viewrect as an <a href="mxPoint-js.html#mxPoint" class=LClass id=link147 onMouseOver="ShowTip(event, 'tt64', 'link147')" onMouseOut="HideTip('tt64')">mxPoint</a>.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.convertPoint"></a>convertPoint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>convertPoint: function(</td><td class=PParameter nowrap>container,</td></tr><tr><td></td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts the specified point (x, y) using the offset of the specified container and returns a new <a href="mxPoint-js.html#mxPoint" class=LClass id=link148 onMouseOver="ShowTip(event, 'tt64', 'link148')" onMouseOut="HideTip('tt64')">mxPoint</a> with the result.</p><blockquote><pre class="prettyprint">var pt = mxUtils.convertPoint(graph.container,
2013-05-23 16:14:48 +00:00
mxEvent.getClientX(evt), mxEvent.getClientY(evt));</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>container</td><td class=CDLDescription>DOM node to use for the offset.</td></tr><tr><td class=CDLEntry>x</td><td class=CDLDescription>X-coordinate of the point to be converted.</td></tr><tr><td class=CDLEntry>y</td><td class=CDLDescription>Y-coordinate of the point to be converted.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.ltrim"></a>ltrim</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ltrim: function(</td><td class=PParameter nowrap>str,</td></tr><tr><td></td><td class=PParameter nowrap>chars</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Strips all whitespaces from the beginning of the string.&nbsp; Without the second parameter, Javascript function will trim these characters:</p><ul><li>&rdquo; &ldquo; (ASCII 32 (0x20)), an ordinary space</li><li>&rdquo;\t&rdquo; (ASCII 9 (0x09)), a tab</li><li>&rdquo;\n&rdquo; (ASCII 10 (0x0A)), a new line (line feed)</li><li>&rdquo;\r&rdquo; (ASCII 13 (0x0D)), a carriage return</li><li>&rdquo;\0&rdquo; (ASCII 0 (0x00)), the NUL-byte</li><li>&rdquo;\x0B&rdquo; (ASCII 11 (0x0B)), a vertical tab</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.rtrim"></a>rtrim</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>rtrim: function(</td><td class=PParameter nowrap>str,</td></tr><tr><td></td><td class=PParameter nowrap>chars</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Strips all whitespaces from the end of the string.&nbsp; Without the second parameter, Javascript function will trim these characters:</p><ul><li>&rdquo; &ldquo; (ASCII 32 (0x20)), an ordinary space</li><li>&rdquo;\t&rdquo; (ASCII 9 (0x09)), a tab</li><li>&rdquo;\n&rdquo; (ASCII 10 (0x0A)), a new line (line feed)</li><li>&rdquo;\r&rdquo; (ASCII 13 (0x0D)), a carriage return</li><li>&rdquo;\0&rdquo; (ASCII 0 (0x00)), the NUL-byte</li><li>&rdquo;\x0B&rdquo; (ASCII 11 (0x0B)), a vertical tab</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.trim"></a>trim</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>trim: function(</td><td class=PParameter nowrap>str,</td></tr><tr><td></td><td class=PParameter nowrap>chars</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Strips all whitespaces from both end of the string.&nbsp; Without the second parameter, Javascript function will trim these characters:</p><ul><li>&rdquo; &ldquo; (ASCII 32 (0x20)), an ordinary space</li><li>&rdquo;\t&rdquo; (ASCII 9 (0x09)), a tab</li><li>&rdquo;\n&rdquo; (ASCII 10 (0x0A)), a new line (line feed)</li><li>&rdquo;\r&rdquo; (ASCII 13 (0x0D)), a carriage return</li><li>&rdquo;\0&rdquo; (ASCII 0 (0x00)), the NUL-byte</li><li>&rdquo;\x0B&rdquo; (ASCII 11 (0x0B)), a vertical tab</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.isNumeric"></a>isNumeric</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isNumeric: function(</td><td class=PParameter nowrap>str</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the specified value is numeric, that is, if it is not null, not an empty string, not a HEX number and isNaN returns false.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>str</td><td class=CDLDescription>String representing the possibly numeric value.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.mod"></a>mod</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mod: function(</td><td class=PParameter nowrap>n,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the remainder of division of n by m.&nbsp; You should use this instead of the built-in operation as the built-in operation does not properly handle negative numbers.</p></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.intersection"></a>intersection</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>intersection: function (</td><td class=PParameter nowrap>x0,</td></tr><tr><td></td><td class=PParameter nowrap>y0,</td></tr><tr><td></td><td class=PParameter nowrap>x1,</td></tr><tr><td></td><td class=PParameter nowrap>y1,</td></tr><tr><td></td><td class=PParameter nowrap>x2,</td></tr><tr><td></td><td class=PParameter nowrap>y2,</td></tr><tr><td></td><td class=PParameter nowrap>x3,</td></tr><tr><td></td><td class=PParameter nowrap>y3</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the intersection of two lines as an <a href="mxPoint-js.html#mxPoint" class=LClass id=link149 onMouseOver="ShowTip(event, 'tt64', 'link149')" onMouseOut="HideTip('tt64')">mxPoint</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x0</td><td class=CDLDescription>X-coordinate of the first line&rsquo;s startpoint.</td></tr><tr><td class=CDLEntry>y0</td><td class=CDLDescription>X-coordinate of the first line&rsquo;s startpoint.</td></tr><tr><td class=CDLEntry>x1</td><td class=CDLDescription>X-coordinate of the first line&rsquo;s endpoint.</td></tr><tr><td class=CDLEntry>y1</td><td class=CDLDescription>Y-coordinate of the first line&rsquo;s endpoint.</td></tr><tr><td class=CDLEntry>x2</td><td class=CDLDescription>X-coordinate of the second line&rsquo;s startpoint.</td></tr><tr><td class=CDLEntry>y2</td><td class=CDLDescription>Y-coordinate of the second line&rsquo;s startpoint.</td></tr><tr><td class=CDLEntry>x3</td><td class=CDLDescription>X-coordinate of the second line&rsquo;s endpoint.</td></tr><tr><td class=CDLEntry>y3</td><td class=CDLDescription>Y-coordinate of the second line&rsquo;s endpoint.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.ptSeqDistSq"></a>ptSeqDistSq</h3><div class=CBody><p>Returns the square distance between a segment and a point.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x1</td><td class=CDLDescription>X-coordinate of the startpoint of the segment.</td></tr><tr><td class=CDLEntry>y1</td><td class=CDLDescription>Y-coordinate of the startpoint of the segment.</td></tr><tr><td class=CDLEntry>x2</td><td class=CDLDescription>X-coordinate of the endpoint of the segment.</td></tr><tr><td class=CDLEntry>y2</td><td class=CDLDescription>Y-coordinate of the endpoint of the segment.</td></tr><tr><td class=CDLEntry>px</td><td class=CDLDescription>X-coordinate of the point.</td></tr><tr><td class=CDLEntry>py</td><td class=CDLDescription>Y-coordinate of the point.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.relativeCcw"></a>relativeCcw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>relativeCcw: function(</td><td class=PParameter nowrap>x1,</td></tr><tr><td></td><td class=PParameter nowrap>y1,</td></tr><tr><td></td><td class=PParameter nowrap>x2,</td></tr><tr><td></td><td class=PParameter nowrap>y2,</td></tr><tr><td></td><td class=PParameter nowrap>px,</td></tr><tr><td></td><td class=PParameter nowrap>py</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns 1 if the given point on the right side of the segment, 0 if its on the segment, and -1 if the point is on the left side of the segment.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x1</td><td class=CDLDescription>X-coordinate of the startpoint of the segment.</td></tr><tr><td class=CDLEntry>y1</td><td class=CDLDescription>Y-coordinate of the startpoint of the segment.</td></tr><tr><td class=CDLEntry>x2</td><td class=CDLDescription>X-coordinate of the endpoint of the segment.</td></tr><tr><td class=CDLEntry>y2</td><td class=CDLDescription>Y-coordinate of the endpoint of the segment.</td></tr><tr><td class=CDLEntry>px</td><td class=CDLDescription>X-coordinate of the point.</td></tr><tr><td class=CDLEntry>py</td><td class=CDLDescription>Y-coordinate of the point.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.animateChanges"></a>animateChanges</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>animateChanges: function(</td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>changes</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>See <a href="mxEffects-js.html#mxEffects.animateChanges" class=LFunction id=link150 onMouseOver="ShowTip(event, 'tt75', 'link150')" onMouseOut="HideTip('tt75')">mxEffects.animateChanges</a>.&nbsp; This is for backwards compatibility and will be removed later.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.cascadeOpacity"></a>cascadeOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>cascadeOpacity: function(</td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>cell,</td></tr><tr><td></td><td class=PParameter nowrap>opacity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>See <a href="mxEffects-js.html#mxEffects.cascadeOpacity" class=LFunction id=link151 onMouseOver="ShowTip(event, 'tt77', 'link151')" onMouseOut="HideTip('tt77')">mxEffects.cascadeOpacity</a>.&nbsp; This is for backwards compatibility and will be removed later.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.fadeOut"></a>fadeOut</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>fadeOut: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>from,</td></tr><tr><td></td><td class=PParameter nowrap>remove,</td></tr><tr><td></td><td class=PParameter nowrap>step,</td></tr><tr><td></td><td class=PParameter nowrap>delay,</td></tr><tr><td></td><td class=PParameter nowrap>isEnabled</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>See <a href="mxEffects-js.html#mxEffects.fadeOut" class=LFunction id=link152 onMouseOver="ShowTip(event, 'tt79', 'link152')" onMouseOut="HideTip('tt79')">mxEffects.fadeOut</a>.&nbsp; This is for backwards compatibility and will be removed later.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.setOpacity"></a>setOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setOpacity: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the opacity of the specified DOM node to the given value in %.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM node to set the opacity for.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Opacity in %.&nbsp; Possible values are between 0 and 100.</td></tr></table></div></div></div>
2013-04-04 11:51:15 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.createImage"></a>createImage</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>createImage: function(</td><td class=PParameter nowrap>src</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates and returns an image (IMG node) or VML image (v:image) in IE6 in quirks mode.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>src</td><td class=CDLDescription>URL that points to the image to be displayed.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.sortCells"></a>sortCells</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>sortCells: function(</td><td class=PParameter nowrap>cells,</td></tr><tr><td></td><td class=PParameter nowrap>ascending</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sorts the given cells according to the order in the cell hierarchy.&nbsp; Ascending is optional and defaults to true.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getStylename"></a>getStylename</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getStylename: function(</td><td class=PParameter nowrap>style</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>style</td><td class=CDLDescription>String of the form [(stylename|key=value);].</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getStylenames"></a>getStylenames</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getStylenames: function(</td><td class=PParameter nowrap>style</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>style</td><td class=CDLDescription>String of the form [(stylename|key=value);].</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.indexOfStylename"></a>indexOfStylename</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>indexOfStylename: function(</td><td class=PParameter nowrap>style,</td></tr><tr><td></td><td class=PParameter nowrap>stylename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the index of the given stylename in the given style.&nbsp; 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>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.addStylename"></a>addStylename</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addStylename: function(</td><td class=PParameter nowrap>style,</td></tr><tr><td></td><td class=PParameter nowrap>stylename</td><td class=PAfterParameters nowrap>)</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>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.removeStylename"></a>removeStylename</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeStylename: function(</td><td class=PParameter nowrap>style,</td></tr><tr><td></td><td class=PParameter nowrap>stylename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes all occurrences of the specified stylename in the given style and returns the updated style.&nbsp; Trailing semicolons are not preserved.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.removeAllStylenames"></a>removeAllStylenames</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeAllStylenames: function(</td><td class=PParameter nowrap>style</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes all stylenames from the given style and returns the updated style.</p></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.setCellStyles"></a>setCellStyles</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setCellStyles: function(</td><td class=PParameter nowrap>model,</td></tr><tr><td></td><td class=PParameter nowrap>cells,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>model</td><td class=CDLDescription><a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link153 onMouseOver="ShowTip(event, 'tt111', 'link153')" onMouseOut="HideTip('tt111')">mxGraphModel</a> to execute the transaction in.</td></tr><tr><td class=CDLEntry>cells</td><td class=CDLDescription>Array of <a href="../model/mxCell-js.html#mxCell" class=LClass id=link154 onMouseOver="ShowTip(event, 'tt112', 'link154')" onMouseOut="HideTip('tt112')">mxCells</a> to be updated.</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key of the style to be changed.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>New value for the given key.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.setStyle"></a>setStyle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setStyle: function(</td><td class=PParameter nowrap>style,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds or removes the given key, value pair to the style and returns the new style.&nbsp; If value is null or zero length then the key is removed from the style.&nbsp; This is for cell styles, not for CSS styles.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>style</td><td class=CDLDescription>String of the form [(stylename|key=value);].</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key of the style to be changed.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>New value for the given key.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.setCellStyleFlags"></a>setCellStyleFlags</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setCellStyleFlags: function(</td><td class=PParameter nowrap>model,</td></tr><tr><td></td><td class=PParameter nowrap>cells,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>flag,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets or toggles the flag bit for the given key in the cell&rsquo;s styles.&nbsp; If value is null then the flag is toggled.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">var cells = graph.getSelectionCells();
mxUtils.setCellStyleFlags(graph.model,
cells,
mxConstants.STYLE_FONTSTYLE,
2013-10-28 08:56:36 +00:00
mxConstants.FONT_BOLD);</pre></blockquote><p>Toggles the bold font style.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>model</td><td class=CDLDescription><a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link155 onMouseOver="ShowTip(event, 'tt111', 'link155')" onMouseOut="HideTip('tt111')">mxGraphModel</a> that contains the cells.</td></tr><tr><td class=CDLEntry>cells</td><td class=CDLDescription>Array of <a href="../model/mxCell-js.html#mxCell" class=LClass id=link156 onMouseOver="ShowTip(event, 'tt112', 'link156')" onMouseOut="HideTip('tt112')">mxCells</a> to change the style for.</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key of the style to be changed.</td></tr><tr><td class=CDLEntry>flag</td><td class=CDLDescription>Integer for the bit to be changed.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Optional boolean value for the flag.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.setStyleFlag"></a>setStyleFlag</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setStyleFlag: function(</td><td class=PParameter nowrap>style,</td></tr><tr><td></td><td class=PParameter nowrap>key,</td></tr><tr><td></td><td class=PParameter nowrap>flag,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets or removes the given key from the specified style and returns the new style.&nbsp; If value is null then the flag is toggled.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>style</td><td class=CDLDescription>String of the form [(stylename|key=value);].</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>Key of the style to be changed.</td></tr><tr><td class=CDLEntry>flag</td><td class=CDLDescription>Integer for the bit to be changed.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Optional boolean value for the given flag.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getAlignmentAsPoint"></a>getAlignmentAsPoint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getAlignmentAsPoint: function(</td><td class=PParameter nowrap>align,</td></tr><tr><td></td><td class=PParameter nowrap>valign</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns an <a href="mxPoint-js.html#mxPoint" class=LClass id=link157 onMouseOver="ShowTip(event, 'tt64', 'link157')" onMouseOut="HideTip('tt64')">mxPoint</a> that represents the horizontal and vertical alignment for numeric computations.&nbsp; X is -0.5 for center, -1 for right and 0 for left alignment.&nbsp; Y is -0.5 for middle, -1 for bottom and 0 for top alignment.&nbsp; Default values for missing arguments is top, left.</p></div></div></div>
2013-05-23 16:14:48 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getSizeForString"></a>getSizeForString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getSizeForString: function(</td><td class=PParameter nowrap>text,</td></tr><tr><td></td><td class=PParameter nowrap>fontSize,</td></tr><tr><td></td><td class=PParameter nowrap>fontFamily,</td></tr><tr><td></td><td class=PParameter nowrap>textWidth</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns an <a href="mxRectangle-js.html#mxRectangle" class=LClass id=link158 onMouseOver="ShowTip(event, 'tt95', 'link158')" onMouseOut="HideTip('tt95')">mxRectangle</a> with the size (width and height in pixels) of the given string.&nbsp; The string may contain HTML markup.&nbsp; Newlines should be converted to <a href="#mxUtils.br" class=LFunction id=link159 onMouseOver="ShowTip(event, 'tt26', 'link159')" onMouseOut="HideTip('tt26')">br</a> before calling this method.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">var label = graph.getLabel(cell).replace(/\n/g, &quot;&lt;br&gt;&quot;);
var size = graph.getSizeForString(label);</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>text</td><td class=CDLDescription>String whose size should be returned.</td></tr><tr><td class=CDLEntry>fontSize</td><td class=CDLDescription>Integer that specifies the font size in pixels.&nbsp; Default is <a href="mxConstants-js.html#mxConstants.DEFAULT_FONTSIZE" class=LVariable id=link160 onMouseOver="ShowTip(event, 'tt113', 'link160')" onMouseOut="HideTip('tt113')">mxConstants.DEFAULT_FONTSIZE</a>.</td></tr><tr><td class=CDLEntry>fontFamily</td><td class=CDLDescription>String that specifies the name of the font family.&nbsp; Default is <a href="mxConstants-js.html#mxConstants.DEFAULT_FONTFAMILY" class=LVariable id=link161 onMouseOver="ShowTip(event, 'tt114', 'link161')" onMouseOut="HideTip('tt114')">mxConstants.DEFAULT_FONTFAMILY</a>.</td></tr><tr><td class=CDLEntry>textWidth</td><td class=CDLDescription>Optional width for text wrapping.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getViewXml"></a>getViewXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getViewXml: function(</td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>scale,</td></tr><tr><td></td><td class=PParameter nowrap>cells,</td></tr><tr><td></td><td class=PParameter nowrap>x0,</td></tr><tr><td></td><td class=PParameter nowrap>y0</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.getScaleForPageCount"></a>getScaleForPageCount</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getScaleForPageCount: function(</td><td class=PParameter nowrap>pageCount,</td></tr><tr><td></td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>pageFormat,</td></tr><tr><td></td><td class=PParameter nowrap>border</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the scale to be used for printing the graph with the given bounds across the specifies number of pages with the given format.&nbsp; The scale is always computed such that it given the given amount or fewer pages in the print output.&nbsp; See <a href="../view/mxPrintPreview-js.html#mxPrintPreview" class=LClass id=link162 onMouseOver="ShowTip(event, 'tt115', 'link162')" onMouseOut="HideTip('tt115')">mxPrintPreview</a> for an example.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>pageCount</td><td class=CDLDescription>Specifies the number of pages in the print output.</td></tr><tr><td class=CDLEntry>graph</td><td class=CDLDescription><a href="../view/mxGraph-js.html#mxGraph" class=LClass id=link163 onMouseOver="ShowTip(event, 'tt116', 'link163')" onMouseOut="HideTip('tt116')">mxGraph</a> that should be printed.</td></tr><tr><td class=CDLEntry>pageFormat</td><td class=CDLDescription>Optional <a href="mxRectangle-js.html#mxRectangle" class=LClass id=link164 onMouseOver="ShowTip(event, 'tt95', 'link164')" onMouseOut="HideTip('tt95')">mxRectangle</a> that specifies the page format.&nbsp; Default is <a href="mxConstants-js.html#mxConstants.PAGE_FORMAT_A4_PORTRAIT" class=LVariable id=link165 onMouseOver="ShowTip(event, 'tt117', 'link165')" onMouseOut="HideTip('tt117')">mxConstants.PAGE_FORMAT_A4_PORTRAIT</a>.</td></tr><tr><td class=CDLEntry>border</td><td class=CDLDescription>The border along each side of every page.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.show"></a>show</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>show: function(</td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>doc,</td></tr><tr><td></td><td class=PParameter nowrap>x0,</td></tr><tr><td></td><td class=PParameter nowrap>y0,</td></tr><tr><td></td><td class=PParameter nowrap>w,</td></tr><tr><td></td><td class=PParameter nowrap>h</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copies the styles and the markup from the graph&rsquo;s container into the given document and removes all cursor styles.&nbsp; The document is returned.</p><p>This function should be called from within the document with the graph.&nbsp; If you experience problems with missing stylesheets in IE then try adding the domain to the trusted sites.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>graph</td><td class=CDLDescription><a href="../view/mxGraph-js.html#mxGraph" class=LClass id=link166 onMouseOver="ShowTip(event, 'tt116', 'link166')" onMouseOut="HideTip('tt116')">mxGraph</a> to be copied.</td></tr><tr><td class=CDLEntry>doc</td><td class=CDLDescription>Document where the new graph is created.</td></tr><tr><td class=CDLEntry>x0</td><td class=CDLDescription>X-coordinate of the graph view origin.&nbsp; Default is 0.</td></tr><tr><td class=CDLEntry>y0</td><td class=CDLDescription>Y-coordinate of the graph view origin.&nbsp; Default is 0.</td></tr><tr><td class=CDLEntry>w</td><td class=CDLDescription>Optional width of the graph view.</td></tr><tr><td class=CDLEntry>h</td><td class=CDLDescription>Optional height of the graph view.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.printScreen"></a>printScreen</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>printScreen: function(</td><td class=PParameter nowrap>graph</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Prints the specified graph using a new window and the built-in print dialog.</p><p>This function should be called from within the document with the graph.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>graph</td><td class=CDLDescription><a href="../view/mxGraph-js.html#mxGraph" class=LClass id=link167 onMouseOver="ShowTip(event, 'tt116', 'link167')" onMouseOut="HideTip('tt116')">mxGraph</a> to be printed.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.popup"></a>popup</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>popup: function(</td><td class=PParameter nowrap>content,</td></tr><tr><td></td><td class=PParameter nowrap>isInternalWindow</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Shows the specified text content in a new <a href="mxWindow-js.html#mxWindow" class=LClass id=link168 onMouseOver="ShowTip(event, 'tt101', 'link168')" onMouseOut="HideTip('tt101')">mxWindow</a> or a new browser window if isInternalWindow is false.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>content</td><td class=CDLDescription>String that specifies the text to be displayed.</td></tr><tr><td class=CDLEntry>isInternalWindow</td><td class=CDLDescription>Optional boolean indicating if an mxWindow should be used instead of a new browser window.&nbsp; Default is false.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.alert"></a>alert</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>alert: function(</td><td class=PParameter nowrap>message</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Displayss the given alert in a new dialog.&nbsp; This implementation uses the built-in alert function.&nbsp; This is used to display validation errors when connections cannot be changed or created.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>message</td><td class=CDLDescription>String specifying the message to be displayed.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.prompt"></a>prompt</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>prompt: function(</td><td class=PParameter nowrap>message,</td></tr><tr><td></td><td class=PParameter nowrap>defaultValue</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Displays the given message in a prompt dialog.&nbsp; This implementation uses the built-in prompt function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>message</td><td class=CDLDescription>String specifying the message to be displayed.</td></tr><tr><td class=CDLEntry>defaultValue</td><td class=CDLDescription>Optional string specifying the default value.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.confirm"></a>confirm</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>confirm: function(</td><td class=PParameter nowrap>message</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Displays the given message in a confirm dialog.&nbsp; This implementation uses the built-in confirm function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>message</td><td class=CDLDescription>String specifying the message to be displayed.</td></tr></table></div></div></div>
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.error"></a>error</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>error: function(</td><td class=PParameter nowrap>message,</td></tr><tr><td></td><td class=PParameter nowrap>width,</td></tr><tr><td></td><td class=PParameter nowrap>close,</td></tr><tr><td></td><td class=PParameter nowrap>icon</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Displays the given error message in a new <a href="mxWindow-js.html#mxWindow" class=LClass id=link169 onMouseOver="ShowTip(event, 'tt101', 'link169')" onMouseOut="HideTip('tt101')">mxWindow</a> of the given width.&nbsp; If close is true then an additional close button is added to the window.&nbsp; The optional icon specifies the icon to be used for the window.&nbsp; Default is <a href="#mxUtils.errorImage" class=LVariable id=link170 onMouseOver="ShowTip(event, 'tt118', 'link170')" onMouseOut="HideTip('tt118')">mxUtils.errorImage</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>message</td><td class=CDLDescription>String specifying the message to be displayed.</td></tr><tr><td class=CDLEntry>width</td><td class=CDLDescription>Integer specifying the width of the window.</td></tr><tr><td class=CDLEntry>close</td><td class=CDLDescription>Optional boolean indicating whether to add a close button.</td></tr><tr><td class=CDLEntry>icon</td><td class=CDLDescription>Optional icon for the window decoration.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
2013-10-28 08:56:36 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxUtils.makeDraggable"></a>makeDraggable</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>makeDraggable: function(</td><td class=PParameter nowrap>element,</td></tr><tr><td></td><td class=PParameter nowrap>graphF,</td></tr><tr><td></td><td class=PParameter nowrap>funct,</td></tr><tr><td></td><td class=PParameter nowrap>dragElement,</td></tr><tr><td></td><td class=PParameter nowrap>dx,</td></tr><tr><td></td><td class=PParameter nowrap>dy,</td></tr><tr><td></td><td class=PParameter nowrap>autoscroll,</td></tr><tr><td></td><td class=PParameter nowrap>scalePreview,</td></tr><tr><td></td><td class=PParameter nowrap>highlightDropTargets,</td></tr><tr><td></td><td class=PParameter nowrap>getDropTarget</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Configures the given DOM element to act as a drag source for the specified graph.&nbsp; Returns a a new <a href="mxDragSource-js.html#mxDragSource" class=LClass id=link171 onMouseOver="ShowTip(event, 'tt119', 'link171')" onMouseOut="HideTip('tt119')">mxDragSource</a>.&nbsp; If &lt;mxDragSource.guideEnabled&gt; is enabled then the x and y arguments must be used in funct to match the preview location.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">var funct = function(graph, evt, cell, x, y)
2012-05-21 20:32:26 +00:00
{
if (graph.canImportCell(cell))
{
var parent = graph.getDefaultParent();
var vertex = null;
graph.getModel().beginUpdate();
try
{
vertex = graph.insertVertex(parent, null, 'Hello', x, y, 80, 30);
}
finally
{
graph.getModel().endUpdate();
}
graph.setSelectionCell(vertex);
}
}
var img = document.createElement('img');
img.setAttribute('src', 'editors/images/rectangle.gif');
img.style.position = 'absolute';
img.style.left = '0px';
img.style.top = '0px';
img.style.width = '16px';
img.style.height = '16px';
var dragImage = img.cloneNode(true);
dragImage.style.width = '32px';
dragImage.style.height = '32px';
mxUtils.makeDraggable(img, graph, funct, dragImage);
2013-10-28 08:56:36 +00:00
document.body.appendChild(img);</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>element</td><td class=CDLDescription>DOM element to make draggable.</td></tr><tr><td class=CDLEntry>graphF</td><td class=CDLDescription><a href="../view/mxGraph-js.html#mxGraph" class=LClass id=link172 onMouseOver="ShowTip(event, 'tt116', 'link172')" onMouseOut="HideTip('tt116')">mxGraph</a> that acts as the drop target or a function that takes a mouse event and returns the current <a href="../view/mxGraph-js.html#mxGraph" class=LClass id=link173 onMouseOver="ShowTip(event, 'tt116', 'link173')" onMouseOut="HideTip('tt116')">mxGraph</a>.</td></tr><tr><td class=CDLEntry>funct</td><td class=CDLDescription>Function to execute on a successful drop.</td></tr><tr><td class=CDLEntry>dragElement</td><td class=CDLDescription>Optional DOM node to be used for the drag preview.</td></tr><tr><td class=CDLEntry>dx</td><td class=CDLDescription>Optional horizontal offset between the cursor and the drag preview.</td></tr><tr><td class=CDLEntry>dy</td><td class=CDLDescription>Optional vertical offset between the cursor and the drag preview.</td></tr><tr><td class=CDLEntry>autoscroll</td><td class=CDLDescription>Optional boolean that specifies if autoscroll should be used.&nbsp; Default is mxGraph.autoscroll.</td></tr><tr><td class=CDLEntry>scalePreview</td><td class=CDLDescription>Optional boolean that specifies if the preview element should be scaled according to the graph scale.&nbsp; If this is true, then the offsets will also be scaled.&nbsp; Default is false.</td></tr><tr><td class=CDLEntry>highlightDropTargets</td><td class=CDLDescription>Optional boolean that specifies if dropTargets should be highlighted.&nbsp; Default is true.</td></tr><tr><td class=CDLEntry>getDropTarget</td><td class=CDLDescription>Optional function to return the drop target for a given location (x, y).&nbsp; Default is mxGraph.getCellAt.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
</div><!--Content-->
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
2013-08-09 09:08:09 +00:00
<div id=Menu><div class=MEntry><div class=MFile><a href="../index-txt.html">API Specification</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Editor</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../editor/mxDefaultKeyHandler-js.html">mxDefaultKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultPopupMenu-js.html">mxDefaultPopupMenu</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultToolbar-js.html">mxDefaultToolbar</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxEditor-js.html">mxEditor</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Handler</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../handler/mxCellHighlight-js.html">mxCellHighlight</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellMarker-js.html">mxCellMarker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellTracker-js.html">mxCellTracker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConnectionHandler-js.html">mxConnectionHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConstraintHandler-js.html">mxConstraintHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeHandler-js.html">mxEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeSegmentHandler-js.html">mxEdgeSegmentHandler.js</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxElbowEdgeHandler-js.html">mxElbowEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxGraphHandler-js.html">mxGraphHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxKeyHandler-js.html">mxKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPanningHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPopupMenuHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxRubberband-js.html">mxRubberband</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxSelectionCellsHandler-js.html">mxSelectionCellsHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxTooltipHandler-js.html">mxTooltipHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxVertexHandler-js.html">mxVertexHandler</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Io</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../io/mxCellCodec-js.html">mxCellCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxChildChangeCodec-js.html">mxChildChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxCodec-js.html">mxCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxCodecRegistry-js.html">mxCodecRegistry</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultKeyHandlerCodec-js.html">mxDefaultKeyHandlerCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultPopupMenuCodec-js.html">mxDefaultPopupMenuCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultToolbarCodec-js.html">mxDefaultToolbarCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxEditorCodec-js.html">mxEditorCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGenericChangeCodec-js.html">mxGenericChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGraphCodec-js.html">mxGraphCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGraphViewCodec-js.html">mxGraphViewCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxModelCodec-js.html">mxModelCodec</a></d
2012-05-21 20:32:26 +00:00
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Cookies">Cookies</option><option value="Events">Events</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([10], 13);// --></script></div><!--Menu-->
<!--START_ND_TOOLTIPS-->
2013-10-28 08:56:36 +00:00
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeCursors: function(</td><td class=PParameter nowrap>element</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Removes the cursors from the style of the given DOM node and its descendants.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>getCurrentStyle: function()</td></tr></table></blockquote>Returns the current style of the specified element.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>setPrefixedStyle: function()</td></tr></table></blockquote>Adds the given style with the standard name and an optional vendor prefix for the current browser.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>hasScrollbars: function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the overflow CSS property of the given node is either scroll or auto.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>bind: function(</td><td class=PParameter nowrap>scope,</td></tr><tr><td></td><td class=PParameter nowrap>funct</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a wrapper function that locks the execution scope of the given function to the specified scope. </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>eval: function(</td><td class=PParameter nowrap>expr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Evaluates the given expression using eval and returns the JavaScript object that represents the expression result. </div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>findNode: function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the first node where attr equals value. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>findNodeByAttribute: function()</td></tr></table></blockquote>Returns the first node where the given attribute matches the given value.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getFunctionName: function(</td><td class=PParameter nowrap>f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the name for the given function.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>indexOf: function(</td><td class=PParameter n
2012-05-21 20:32:26 +00:00
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>