<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="SvgCanvas"></a>SvgCanvas</h1><divclass=CBody><p>The main SvgCanvas class that manages all SVG-related functions</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>container</td><tdclass=CDLDescription>The container HTML element that should hold the SVG root element</td></tr><tr><tdclass=CDLEntry>config</td><tdclass=CDLDescription>An object that contains configuration data</td></tr></table><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#SvgCanvas">SvgCanvas</a></td><tdclass=SDescription>The main SvgCanvas class that manages all SVG-related functions</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SvgCanvas.Utils.toXml">Utils.<wbr>toXml</a></td><tdclass=SDescription>Converts characters in a string to XML-friendly entities.</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SvgCanvas.Utils.fromXml">Utils.<wbr>fromXml</a></td><tdclass=SDescription>Converts XML entities in a string to single characters. </td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SvgCanvas.Utils.encode64">Utils.<wbr>encode64</a></td><tdclass=SDescription>Converts a string to base64</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SvgCanvas.Utils.decode64">Utils.<wbr>decode64</a></td><tdclass=SDescription>Converts a string from base64</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SvgCanvas.Utils.convertToXMLReferences">Utils.<wbr>convertToXMLReferences</a></td><tdclass=SDescription>Converts a string to use XML references</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SvgCanvas.rectsIntersect"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">rectsIntersect</a></td><tdclass=SDescription>Check if two rectangles (BBoxes objects) intersect each other</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SvgCanvas.snapToAngle"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">snapToAngle</a></td><tdclass=SDescription>Returns a 45 degree angle coordinate associated with the two given coordinates</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SvgCanvas.text2xml"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">text2xml</a></td><tdclass=SDescription>Cross-browser compatible method of converting a string to an XML tree found this function here: <ahref="http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f"class=LURLtarget=_top>http://groups.google.com<wbr>/group<wbr>/jquery-dev<wbr>/browse_thread<wbr>/thread<wbr>/c6d11387c580a77f</a></td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#SvgCanvas.Unit_conversion_functions">Unit conversion functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#SvgCanvas.convertToNum"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">convertToNum</a></td><tdclass=SDescription>Converts given values to numbers. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#SvgCanvas.setUnitAttr"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">setUnitAttr</a></td><tdclass=SDescription>Sets an element’s attribute based on the unit in its current value.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#SvgCanvas.isValidUnit"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">isValidUnit</a></td><tdclass=SDescription>Check if an attribute’s value is in a valid format</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#SvgCanvas.Undo/Redo_history_management">Undo/<wbr>Redo history manageme
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.Utils.toXml"></a>Utils.<wbr>toXml</h3><divclass=CBody><p>Converts characters in a string to XML-friendly entities.</p><p>Example: “&” becomes “&amp;”</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>str</td><tdclass=CDLDescription>The string to be converted</td></tr></table><h4class=CHeading>Returns</h4><p>The converted string</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.Utils.fromXml"></a>Utils.<wbr>fromXml</h3><divclass=CBody><p>Converts XML entities in a string to single characters. Example: “&amp;” becomes “&”</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>str</td><tdclass=CDLDescription>The string to be converted</td></tr></table><h4class=CHeading>Returns</h4><p>The converted string</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.Utils.encode64"></a>Utils.<wbr>encode64</h3><divclass=CBody><p>Converts a string to base64</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.Utils.decode64"></a>Utils.<wbr>decode64</h3><divclass=CBody><p>Converts a string from base64</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.Utils.convertToXMLReferences"></a>Utils.<wbr>convertToXMLReferences</h3><divclass=CBody><p>Converts a string to use XML references</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.rectsIntersect"></a>rectsIntersect</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>"rectsIntersect": function(</td><tdclass=PParameternowrap>r1,</td></tr><tr><td></td><tdclass=PParameternowrap>r2</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if two rectangles (BBoxes objects) intersect each other</p><h4class=CHeading>Paramaters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>r1</td><tdclass=CDLDescription>The first BBox-like object</td></tr><tr><tdclass=CDLEntry>r2</td><tdclass=CDLDescription>The second BBox-like object</td></tr></table><h4class=CHeading>Returns</h4><p>Boolean that’s true if rectangles intersect</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.snapToAngle"></a>snapToAngle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>"snapToAngle": function(</td><tdclass=PParameternowrap>x1,</td></tr><tr><td></td><tdclass=PParameternowrap>y1,</td></tr><tr><td></td><tdclass=PParameternowrap>x2,</td></tr><tr><td></td><tdclass=PParameternowrap>y2</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a 45 degree angle coordinate associated with the two given coordinates</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>x1</td><tdclass=CDLDescription>First coordinate’s x value</td></tr><tr><tdclass=CDLEntry>x2</td><tdclass=CDLDescription>Second coordinate’s x value</td></tr><tr><tdclass=CDLEntry>y1</td><tdclass=CDLDescription>First coordinate’s y value</td></tr><tr><tdclass=CDLEntry>y2</td><tdclass=CDLDescription>Second coordinate’s y value</td></tr></table><h4class=CHeading>Returns</h4><p>Object with the following values: x - The angle-snapped x value y - The angle-snapped y value snapangle - The angle at which to snap</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.text2xml"></a>text2xml</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>"text2xml": function(</td><tdclass=PParameternowrap>sXML</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Cross-browser compatible method of converting a string to an XML tree found this function here: <ahref="http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f"class=LURLtarget=_top>http://groups.google.com<wbr>/group<wbr>/jquery-dev<wbr>/browse_thread<wbr>/thread<wbr>/c6d11387c580a77f</a></p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.convertToNum"></a>convertToNum</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>convertToNum = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts given values to numbers. Attributes must be supplied in case a percentage is given</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attr</td><tdclass=CDLDescription>String with the name of the attribute associated with the value</td></tr><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the attribute value to convert</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.setUnitAttr"></a>setUnitAttr</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>setUnitAttr = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets an element’s attribute based on the unit in its current value.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element to be changed</td></tr><tr><tdclass=CDLEntry>attr</td><tdclass=CDLDescription>String with the name of the attribute associated with the value</td></tr><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the attribute value to convert</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.isValidUnit"></a>isValidUnit</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>canvas.isValidUnit = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if an attribute’s value is in a valid format</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attr</td><tdclass=CDLDescription>String with the name of the attribute associated with the value</td></tr><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the attribute value to check</td></tr></table></div></div></div>
<divclass="CGroup"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.Undo/Redo_history_management"></a>Undo/<wbr>Redo history management</h3></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.ChangeElementCommand"></a>ChangeElementCommand</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var ChangeElementCommand = this.undoCmd.changeElement = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>attrs,</td></tr><tr><td></td><tdclass=PParameternowrap>text</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>History command to make a change to an element. Usually an attribute change, but can also be textcontent.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The DOM element that was changed</td></tr><tr><tdclass=CDLEntry>attrs</td><tdclass=CDLDescription>An object with the attributes to be changed and the values they had <b>before</b> the change</td></tr><tr><tdclass=CDLEntry>text</td><tdclass=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.ChangeElementCommand.apply"></a>ChangeElementCommand.<wbr>apply</h3><divclass=CBody><p>Performs the stored change action</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.ChangeElementCommand.unapply"></a>ChangeElementCommand.<wbr>unapply</h3><divclass=CBody><p>Reverses the stored change action</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.ChangeElementCommand.elements"></a>ChangeElementCommand.<wbr>elements</h3><divclass=CBody><p>Returns array with element associated with this command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.InsertElementCommand"></a>InsertElementCommand</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var InsertElementCommand = this.undoCmd.insertElement = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>text</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>History command for an element that was added to the DOM</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The newly added DOM element</td></tr><tr><tdclass=CDLEntry>text</td><tdclass=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.InsertElementCommand.apply"></a>InsertElementCommand.<wbr>apply</h3><divclass=CBody><p>Re-Inserts the new element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.InsertElementCommand.unapply"></a>InsertElementCommand.<wbr>unapply</h3><divclass=CBody><p>Removes the element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.InsertElementCommand.elements"></a>InsertElementCommand.<wbr>elements</h3><divclass=CBody><p>Returns array with element associated with this command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.RemoveElementCommand"></a>RemoveElementCommand</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var RemoveElementCommand = this.undoCmd.removeElement = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>text</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>History command for an element removed from the DOM</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The removed DOM element</td></tr><tr><tdclass=CDLEntry>parent</td><tdclass=CDLDescription>The DOM element’s parent</td></tr><tr><tdclass=CDLEntry>text</td><tdclass=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.RemoveElementCommand.apply"></a>RemoveElementCommand.<wbr>apply</h3><divclass=CBody><p>Re-removes the new element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.RemoveElementCommand.unapply"></a>RemoveElementCommand.<wbr>unapply</h3><divclass=CBody><p>Re-adds the new element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.RemoveElementCommand.elements"></a>RemoveElementCommand.<wbr>elements</h3><divclass=CBody><p>Returns array with element associated with this command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.MoveElementCommand"></a>MoveElementCommand</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var MoveElementCommand = this.undoCmd.moveElement = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>oldNextSibling,</td></tr><tr><td></td><tdclass=PParameternowrap>oldParent,</td></tr><tr><td></td><tdclass=PParameternowrap>text</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>History command for an element that had its DOM position changed</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The DOM element that was moved</td></tr><tr><tdclass=CDLEntry>oldNextSibling</td><tdclass=CDLDescription>The element’s next sibling before it was moved</td></tr><tr><tdclass=CDLEntry>oldParent</td><tdclass=CDLDescription>The element’s parent before it was moved</td></tr><tr><tdclass=CDLEntry>text</td><tdclass=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.MoveElementCommand.unapply"></a>MoveElementCommand.<wbr>unapply</h3><divclass=CBody><p>Re-positions the element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.MoveElementCommand.unapply"></a>MoveElementCommand.<wbr>unapply</h3><divclass=CBody><p>Positions the element back to its original location</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.MoveElementCommand.elements"></a>MoveElementCommand.<wbr>elements</h3><divclass=CBody><p>Returns array with element associated with this command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.BatchCommand"></a>BatchCommand</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var BatchCommand = this.undoCmd.batch = function(</td><tdclass=PParameternowrap>text</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>History command that can contain/execute multiple other commands</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>text</td><tdclass=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.BatchCommand.apply"></a>BatchCommand.<wbr>apply</h3><divclass=CBody><p>Runs “apply” on all subcommands</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.BatchCommand.unapply"></a>BatchCommand.<wbr>unapply</h3><divclass=CBody><p>Runs “unapply” on all subcommands</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.BatchCommand.elements"></a>BatchCommand.<wbr>elements</h3><divclass=CBody><p>Iterate through all our subcommands and returns all the elements we are changing</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.BatchCommand.addSubCommand"></a>BatchCommand.<wbr>addSubCommand</h3><divclass=CBody><p>Adds a given command to the history stack</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>cmd</td><tdclass=CDLDescription>The undo command object to add</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.BatchCommand.isEmpty"></a>BatchCommand.<wbr>isEmpty</h3><divclass=CBody><p>Returns a boolean indicating whether or not the batch command is empty</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.resetUndoStack"></a>resetUndoStack</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>resetUndoStack = function()</td></tr></table></blockquote><p>Resets the undo stack, effectively clearing the undo/redo history</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.undoMgr.getUndoStackSize"></a>undoMgr.<wbr>getUndoStackSize</h3><divclass=CBody><h4class=CHeading>Returns</h4><p>Integer with the current size of the undo history stack</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.undoMgr.getRedoStackSize"></a>undoMgr.<wbr>getRedoStackSize</h3><divclass=CBody><h4class=CHeading>Returns</h4><p>Integer with the current size of the redo history stack</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.undoMgr.getNextUndoCommandText"></a>undoMgr.<wbr>getNextUndoCommandText</h3><divclass=CBody><h4class=CHeading>Returns</h4><p>String associated with the next undo command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.undoMgr.getNextRedoCommandText"></a>undoMgr.<wbr>getNextRedoCommandText</h3><divclass=CBody><h4class=CHeading>Returns</h4><p>String associated with the next redo command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.undoMgr.undo"></a>undoMgr.undo</h3><divclass=CBody><p>Performs an undo step</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.undoMgr.redo"></a>undoMgr.redo</h3><divclass=CBody><p>Performs a redo step</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.addCommandToHistory"></a>addCommandToHistory</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>addCommandToHistory = c.undoCmd.add = function(</td><tdclass=PParameternowrap>cmd</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a command object to the undo history stack</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>cmd</td><tdclass=CDLDescription>The command object to add</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.beginUndoableChange"></a>beginUndoableChange</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>c.beginUndoableChange = function(</td><tdclass=PParameternowrap>attrName,</td></tr><tr><td></td><tdclass=PParameternowrap>elems</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>This function tells the canvas to remember the old values of the attrName attribute for each element sent in. The elements and values are stored on a stack, so the next call to finishUndoableChange() will pop the elements and old values off the stack, gets the current values from the DOM and uses all of these to construct the undo-able command.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attrName</td><tdclass=CDLDescription>The name of the attribute being changed</td></tr><tr><tdclass=CDLEntry>elems</td><tdclass=CDLDescription>Array of DOM elements being changed</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SvgCanvas.finishUndoableChange"></a>finishUndoableChange</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>c.finishUndoableChange = function()</td></tr></table></blockquote><p>This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called. The command can then be added to the command history</p><h4class=CHeading>Returns</h4><p>Batch command object with resulting changes</p></div></div></div>
<divclass="CInterface"><divclass=CTopic><h2class=CTitle><aname="Selector"></a>Selector</h2><divclass=CBody><p>Private class for DOM element selection boxes</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>id</td><tdclass=CDLDescription>integer to internally indentify the selector</td></tr><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element associated with this selector</td></tr></table><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SGroup"><tdclass=SEntry><ahref="#Selector.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#Selector.Selector.reset">Selector.<wbr>reset</a></td><tdclass=SDescription>Used to reset the id and element that the selector is attached to</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#Selector.Selector.showGrips">Selector.<wbr>showGrips</a></td><tdclass=SDescription>Show the resize grips of this selector</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#Selector.Selector.updateGripCursors">Selector.<wbr>updateGripCursors</a></td><tdclass=SDescription>Updates cursors for corner grips on rotation so arrows point the right way</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#Selector.Selector.resize">Selector.<wbr>resize</a></td><tdclass=SDescription>Updates the selector to match the element’s size</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="Selector.Selector.reset"></a>Selector.<wbr>reset</h3><divclass=CBody><p>Used to reset the id and element that the selector is attached to</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>e</td><tdclass=CDLDescription>DOM element associated with this selector</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="Selector.Selector.showGrips"></a>Selector.<wbr>showGrips</h3><divclass=CBody><p>Show the resize grips of this selector</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>show</td><tdclass=CDLDescription>boolean indicating whether grips should be shown or not</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="Selector.Selector.updateGripCursors"></a>Selector.<wbr>updateGripCursors</h3><divclass=CBody><p>Updates cursors for corner grips on rotation so arrows point the right way</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>angle</td><tdclass=CDLDescription>Float indicating current rotation angle in degrees</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="Selector.Selector.resize"></a>Selector.<wbr>resize</h3><divclass=CBody><p>Updates the selector to match the element’s size</p></div></div></div>
<divclass="CInterface"><divclass=CTopic><h2class=CTitle><aname="SelectorManager"></a>SelectorManager</h2><divclass=CBody><p>Public class to manage all selector objects (selection boxes)</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SFunction"><tdclass=SEntry><ahref="#SelectorManager.SelectorManager.initGroup">SelectorManager.<wbr>initGroup</a></td><tdclass=SDescription>Resets the parent selector group element</td></tr><trclass="SFunction SMarked"><tdclass=SEntry><ahref="#SelectorManager.SelectorManager.requestSelector">SelectorManager.<wbr>requestSelector</a></td><tdclass=SDescription>Returns the selector based on the given element</td></tr><trclass="SFunction"><tdclass=SEntry><ahref="#SelectorManager.SelectorManager.releaseSelector">SelectorManager.<wbr>releaseSelector</a></td><tdclass=SDescription>Removes the selector of the given element (hides selection box)</td></tr><trclass="SFunction SMarked"><tdclass=SEntry><ahref="#SelectorManager.SelectorManager.getRubberBandBox">SelectorManager.<wbr>getRubberBandBox</a></td><tdclass=SDescription>Returns the rubberBandBox DOM element. </td></tr><trclass="SGroup"><tdclass=SEntry><ahref="#SelectorManager.Helper_functions">Helper functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SelectorManager.walkTree"id=link141onMouseOver="ShowTip(event, 'tt16', 'link141')"onMouseOut="HideTip('tt16')">walkTree</a></td><tdclass=SDescription>Walks the tree and executes the callback on each element in a top-down fashion</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SelectorManager.walkTreePost"id=link142onMouseOver="ShowTip(event, 'tt17', 'link142')"onMouseOut="HideTip('tt17')">walkTreePost</a></td><tdclass=SDescription>Walks the tree and executes the callback on each element in a depth-first fashion</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SelectorManager.assignAttributes"id=link143onMouseOver="ShowTip(event, 'tt18', 'link143')"onMouseOut="HideTip('tt18')">assignAttributes</a></td><tdclass=SDescription>Assigns multiple attributes to an element.</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SelectorManager.cleanupElement"id=link144onMouseOver="ShowTip(event, 'tt19', 'link144')"onMouseOut="HideTip('tt19')">cleanupElement</a></td><tdclass=SDescription>Remove unneeded (default) attributes, makes resulting SVG smaller</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SelectorManager.addSvgElementFromJson"id=link145onMouseOver="ShowTip(event, 'tt20', 'link145')"onMouseOut="HideTip('tt20')">addSvgElementFromJson</a></td><tdclass=SDescription>Create a new SVG element based on the given object keys/values and add it to the current layer The element will be ran through cleanupElement before being returned</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SelectorManager.addExtension"id=link146onMouseOver="ShowTip(event, 'tt21', 'link146')"onMouseOut="HideTip('tt21')">addExtension</a></td><tdclass=SDescription>Add an extension to the editor</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SelectorManager.shortFloat"id=link147onMouseOver="ShowTip(event, 'tt22', 'link147')"onMouseOut="HideTip('tt22')">shortFloat</a></td><tdclass=SDescription>Rounds a given value to a float with number of digits defined in save_options</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#SelectorManager.getStrokedBBox"id=link148onMouseOver="ShowTip(event, 'tt23', 'link148')"onMouseOut="HideTip('tt23')">getStrokedBBox</a></td><tdclass=SDescription>Get the bounding box for one or more stroked and/or transformed elements</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#SelectorManager.getVisibleElements"id=link149onMouseOver="ShowTip(event, 'tt24', 'link149')"onMouseOut="HideTip('tt24')">getVisibleElements
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.SelectorManager.initGroup"></a>SelectorManager.<wbr>initGroup</h3><divclass=CBody><p>Resets the parent selector group element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.SelectorManager.requestSelector"></a>SelectorManager.<wbr>requestSelector</h3><divclass=CBody><p>Returns the selector based on the given element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element to get the selector for</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.SelectorManager.releaseSelector"></a>SelectorManager.<wbr>releaseSelector</h3><divclass=CBody><p>Removes the selector of the given element (hides selection box)</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element to remove the selector for</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.SelectorManager.getRubberBandBox"></a>SelectorManager.<wbr>getRubberBandBox</h3><divclass=CBody><p>Returns the rubberBandBox DOM element. This is the rectangle drawn by the user for selecting/zooming</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.walkTree"></a>walkTree</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function walkTree(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>cbFn</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Walks the tree and executes the callback on each element in a top-down fashion</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element to traverse</td></tr><tr><tdclass=CDLEntry>cbFn</td><tdclass=CDLDescription>Callback function to run on each element</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.walkTreePost"></a>walkTreePost</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function walkTreePost(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>cbFn</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Walks the tree and executes the callback on each element in a depth-first fashion</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element to traverse</td></tr><tr><tdclass=CDLEntry>cbFn</td><tdclass=CDLDescription>Callback function to run on each element</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.assignAttributes"></a>assignAttributes</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var assignAttributes = this.assignAttributes = function(</td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>attrs,</td></tr><tr><td></td><tdclass=PParameternowrap>suspendLength,</td></tr><tr><td></td><tdclass=PParameternowrap>unitCheck</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Assigns multiple attributes to an element.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>node</td><tdclass=CDLDescription>DOM element to apply new attribute values to</td></tr><tr><tdclass=CDLEntry>attrs</td><tdclass=CDLDescription>Object with attribute keys/values</td></tr><tr><tdclass=CDLEntry>suspendLength</td><tdclass=CDLDescription>Optional integer of milliseconds to suspend redraw</td></tr><tr><tdclass=CDLEntry>unitCheck</td><tdclass=CDLDescription>Boolean to indicate the need to use setUnitAttr</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.cleanupElement"></a>cleanupElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var cleanupElement = this.cleanupElement = function(</td><tdclass=PParameternowrap>element</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Remove unneeded (default) attributes, makes resulting SVG smaller</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>element</td><tdclass=CDLDescription>DOM element to clean up</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.addSvgElementFromJson"></a>addSvgElementFromJson</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var addSvgElementFromJson = this.addSvgElementFromJson = function(</td><tdclass=PParameternowrap>data</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a new SVG element based on the given object keys/values and add it to the current layer The element will be ran through cleanupElement before being returned</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>data</td><tdclass=CDLDescription>Object with the following keys/values:</td></tr></table><ul><li>element - DOM element to create</li><li>attr - Object with attributes/values to assign to the new element</li><li>curStyles - Boolean indicating that current style attributes should be applied first</li></ul><p>Returns: The new element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.addExtension"></a>addExtension</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.addExtension = function(</td><tdclass=PParameternowrap>name,</td></tr><tr><td></td><tdclass=PParameternowrap>ext_func</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Add an extension to the editor</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>String with the ID of the extension</td></tr><tr><tdclass=CDLEntry>ext_func</td><tdclass=CDLDescription>Function supplied by the extension with its data</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.shortFloat"></a>shortFloat</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var shortFloat = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Rounds a given value to a float with number of digits defined in save_options</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>The value as a String, Number or Array of two numbers to be rounded</td></tr></table><h4class=CHeading>Returns</h4><p>If a string/number was given, returns a Float. If an array, return a string with comma-seperated floats</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getStrokedBBox"></a>getStrokedBBox</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getStrokedBBox = this.getStrokedBBox = function(</td><tdclass=PParameternowrap>elems</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the bounding box for one or more stroked and/or transformed elements</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elems</td><tdclass=CDLDescription>Array with DOM elements to check</td></tr></table><h4class=CHeading>Returns</h4><p>A single bounding box object</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getVisibleElements"></a>getVisibleElements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getVisibleElements = this.getVisibleElements = function(</td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>includeBBox</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get all elements that have a BBox (excludes <defs>, <title>, etc). Note that 0-opacity, off-screen etc elements are still considered “visible” for this function</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>parent</td><tdclass=CDLDescription>The parent DOM element to search within</td></tr><tr><tdclass=CDLEntry>includeBBox</td><tdclass=CDLDescription>Boolean to indicate that an object should return with the element and its bbox</td></tr></table><h4class=CHeading>Returns</h4><p>An array with all “visible” elements, or if includeBBox is true, an array with objects that include:</p><ul><li>elem - The element</li><li>bbox - The element’s BBox as retrieved from getStrokedBBox</li></ul></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.copyElem"></a>copyElem</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var copyElem = function(</td><tdclass=PParameternowrap>el</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a clone of an element, updating its ID and its children’s IDs when needed</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>el</td><tdclass=CDLDescription>DOM element to clone</td></tr></table><p>Returns: The cloned element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getElem"></a>getElem</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getElem(</td><tdclass=PParameternowrap>id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get a DOM element by ID within the SVG root element.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>id</td><tdclass=CDLDescription>String with the element’s new ID</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getId"></a>getId</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>getId = c.getId = function()</td></tr></table></blockquote><p>Returns the last created DOM element ID string</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getNextId"></a>getNextId</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>getNextId = c.getNextId = function()</td></tr></table></blockquote><p>Creates and returns a unique ID string for a DOM element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.bind"></a>bind</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>c.bind = function(</td><tdclass=PParameternowrap>event,</td></tr><tr><td></td><tdclass=PParameternowrap>f</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Attaches a callback function to an event</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>event</td><tdclass=CDLDescription>String indicating the name of the event</td></tr><tr><tdclass=CDLEntry>f</td><tdclass=CDLDescription>The callback function to bind to the event</td></tr></table><h4class=CHeading>Return</h4><p>The previous event</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setIdPrefix"></a>setIdPrefix</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>c.setIdPrefix = function(</td><tdclass=PParameternowrap>p</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Changes the ID prefix to the given value</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>p</td><tdclass=CDLDescription>String with the new prefix</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.sanitizeSvg"></a>sanitizeSvg</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var sanitizeSvg = this.sanitizeSvg = function(</td><tdclass=PParameternowrap>node</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>node</td><tdclass=CDLDescription>The DOM element to be checked, will also check its children</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getUrlFromAttr"></a>getUrlFromAttr</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getUrlFromAttr = this.getUrlFromAttr = function(</td><tdclass=PParameternowrap>attrVal</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Extracts the URL from the url(...) syntax of some attributes. Three variants:</p><ul><li><circle fill=”url(someFile.svg#foo)” /></li><li><circle fill=”url(‘someFile.svg#foo’)” /></li><li><circle fill=’url(“someFile.svg#foo”)’ /></li></ul><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attrVal</td><tdclass=CDLDescription>The attribute value as a string</td></tr></table><h4class=CHeading>Returns</h4><p>String with just the URL, like someFile.svg#foo</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getBBox"></a>getBBox</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getBBox = this.getBBox = function(</td><tdclass=PParameternowrap>elem</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the given/selected element’s bounding box object, convert it to be more usable when necessary</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>Optional DOM element to get the BBox for</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.ffClone"></a>ffClone</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var ffClone = function(</td><tdclass=PParameternowrap>elem</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Hack for Firefox bugs where text element features aren’t updated. This function clones the element and re-selects it TODO: Test for this bug on load and add it to “support” object instead of browser sniffing</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The (text) DOM element to clone</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getPathBBox"></a>getPathBBox</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getPathBBox = function(</td><tdclass=PParameternowrap>path</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get correct BBox for a path in Webkit Converted from code found here: <ahref="http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html"class=LURLtarget=_top>http://blog.hackers-cafe.net<wbr>/2009<wbr>/06<wbr>/how-to-calculate-bezier-curves-bounding.html</a></p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>path</td><tdclass=CDLDescription>The path DOM element to get the BBox for</td></tr></table><h4class=CHeading>Returns</h4><p>A BBox-like object</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getRotationAngle"></a>getRotationAngle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getRotationAngle = this.getRotationAngle = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>to_rad</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the rotation angle of the given/selected DOM element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>Optional DOM element to get the angle for</td></tr><tr><tdclass=CDLEntry>to_rad</td><tdclass=CDLDescription>Boolean that when true returns the value in radians rather than degrees</td></tr></table><h4class=CHeading>Returns</h4><p>Float with the angle in degrees or radians</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setRotationAngle"></a>setRotationAngle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setRotationAngle = function(</td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>preventUndo</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes any old rotations if present, prepends a new rotation at the transformed center</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>The new rotation angle in degrees</td></tr><tr><tdclass=CDLEntry>preventUndo</td><tdclass=CDLDescription>Boolean indicating whether the action should be undoable or not</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getTransformList"></a>getTransformList</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getTransformList = this.getTransformList = function(</td><tdclass=PParameternowrap>elem</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns an object that behaves like a SVGTransformList for the given DOM element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>DOM element to get a transformlist from</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.recalculateAllSelectedDimensions"></a>recalculateAllSelectedDimensions</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>var recalculateAllSelectedDimensions = this.recalculateAllSelectedDimensions = function()</td></tr></table></blockquote><p>Runs recalculateDimensions on the selected elements, adding the changes to a single batch command</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.remapElement"></a>remapElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var remapElement = this.remapElement = function(</td><tdclass=PParameternowrap>selected,</td></tr><tr><td></td><tdclass=PParameternowrap>changes,</td></tr><tr><td></td><tdclass=PParameternowrap>m</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Applies coordinate changes to an element based on the given matrix</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>selected</td><tdclass=CDLDescription>DOM element to be changed</td></tr><tr><tdclass=CDLEntry>changes</td><tdclass=CDLDescription>Object with changes to be remapped</td></tr><tr><tdclass=CDLEntry>m</td><tdclass=CDLDescription>Matrix object to use for remapping coordinates</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.recalculateDimensions"></a>recalculateDimensions</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var recalculateDimensions = this.recalculateDimensions = function(</td><tdclass=PParameternowrap>selected</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Decides the course of action based on the element’s transform list</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>selected</td><tdclass=CDLDescription>The DOM element to recalculate</td></tr></table><h4class=CHeading>Returns</h4><p>Undo command object with the resulting change</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.transformPoint"></a>transformPoint</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var transformPoint = function(</td><tdclass=PParameternowrap>x,</td></tr><tr><td></td><tdclass=PParameternowrap>y,</td></tr><tr><td></td><tdclass=PParameternowrap>m</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>A (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>x</td><tdclass=CDLDescription>Float representing the x coordinate</td></tr><tr><tdclass=CDLEntry>y</td><tdclass=CDLDescription>Float representing the y coordinate</td></tr><tr><tdclass=CDLEntry>m</td><tdclass=CDLDescription>Matrix object to transform the point with Returns a x,y object representing the transformed point</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.isIdentity"></a>isIdentity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var isIdentity = function(</td><tdclass=PParameternowrap>m</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Helper function to check if the matrix performs no actual transform (i.e. exists for identity purposes)</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>m</td><tdclass=CDLDescription>The matrix object to check</td></tr></table><h4class=CHeading>Returns</h4><p>Boolean indicating whether or not the matrix is 1,0,0,1,0,0</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.matrixMultiply"></a>matrixMultiply</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>var matrixMultiply = this.matrixMultiply = function()</td></tr></table></blockquote><p>This function tries to return a SVGMatrix that is the multiplication m1*m2. We also round to zero when it’s near zero</p><h4class=CHeading>Parameters</h4><blockquote><pre>= 2 Matrix objects to multiply</pre></blockquote><h4class=CHeading>Returns</h4><p>The matrix object resulting from the calculation</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.transformListToTransform"></a>transformListToTransform</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var transformListToTransform = this.transformListToTransform = function(</td><tdclass=PParameternowrap>tlist,</td></tr><tr><td></td><tdclass=PParameternowrap>min,</td></tr><tr><td></td><tdclass=PParameternowrap>max</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>This returns a single matrix Transform for a given Transform List (this is the equivalent of SVGTransformList.consolidate() but unlike that method, this one does not modify the actual SVGTransformList) This function is very liberal with its min,max arguments</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>tlist</td><tdclass=CDLDescription>The transformlist object</td></tr><tr><tdclass=CDLEntry>min</td><tdclass=CDLDescription>Optional integer indicating start transform position</td></tr><tr><tdclass=CDLEntry>max</td><tdclass=CDLDescription>Optional integer indicating end transform position</td></tr></table><h4class=CHeading>Returns</h4><p>A single matrix transform object</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.hasMatrixTransform"></a>hasMatrixTransform</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var hasMatrixTransform = this.hasMatrixTransform = function(</td><tdclass=PParameternowrap>tlist</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>See if the given transformlist includes a non-indentity matrix transform</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>tlist</td><tdclass=CDLDescription>The transformlist to check</td></tr></table><h4class=CHeading>Returns</h4><p>Boolean on whether or not a matrix transform was found</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getMatrix"></a>getMatrix</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getMatrix = function(</td><tdclass=PParameternowrap>elem</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the matrix object for a given element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The DOM element to check</td></tr></table><h4class=CHeading>Returns</h4><p>The matrix object associated with the element’s transformlist</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.transformBox"></a>transformBox</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var transformBox = this.transformBox = function(</td><tdclass=PParameternowrap>l,</td></tr><tr><td></td><tdclass=PParameternowrap>t,</td></tr><tr><td></td><tdclass=PParameternowrap>w,</td></tr><tr><td></td><tdclass=PParameternowrap>h,</td></tr><tr><td></td><tdclass=PParameternowrap>m</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Transforms a rectangle based on the given matrix</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>l</td><tdclass=CDLDescription>Float with the box’s left coordinate</td></tr><tr><tdclass=CDLEntry>t</td><tdclass=CDLDescription>Float with the box’s top coordinate</td></tr><tr><tdclass=CDLEntry>w</td><tdclass=CDLDescription>Float with the box width</td></tr><tr><tdclass=CDLEntry>h</td><tdclass=CDLDescription>Float with the box height</td></tr><tr><tdclass=CDLEntry>m</td><tdclass=CDLDescription>Matrix object to transform the box by</td></tr></table><h4class=CHeading>Returns</h4><p>An object with the following values:</p><ul><li>tl - The top left coordinate (x,y object)</li><li>tr - The top right coordinate (x,y object)</li><li>bl - The bottom left coordinate (x,y object)</li><li>br - The bottom right coordinate (x,y object)</li><li>aabox - Object with the following values:</li><li>Float with the axis-aligned x coordinate</li><li>Float with the axis-aligned y coordinate</li><li>Float with the axis-aligned width coordinate</li><li>Float with the axis-aligned height coordinate</li></ul></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.clearSelection"></a>clearSelection</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var clearSelection = this.clearSelection = function(</td><tdclass=PParameternowrap>noCall</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Clears the selection. The ‘selected’ handler is then called. Parameters: noCall - Optional boolean that when true does not call the “selected” handler</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.addToSelection"></a>addToSelection</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var addToSelection = this.addToSelection = function(</td><tdclass=PParameternowrap>elemsToAdd,</td></tr><tr><td></td><tdclass=PParameternowrap>showGrips</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a list of elements to the selection. The ‘selected’ handler is then called.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elemsToAdd</td><tdclass=CDLDescription>an array of DOM elements to add to the selection</td></tr><tr><tdclass=CDLEntry>showGrips</td><tdclass=CDLDescription>a boolean flag indicating whether the resize grips should be shown</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.removeFromSelection"></a>removeFromSelection</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var removeFromSelection = this.removeFromSelection = function(</td><tdclass=PParameternowrap>elemsToRemove</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes elements from the selection.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elemsToRemove</td><tdclass=CDLDescription>an array of elements to remove from selection</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.selectAllInCurrentLayer"></a>selectAllInCurrentLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.selectAllInCurrentLayer = function()</td></tr></table></blockquote><p>Clears the selection, then adds all elements in the current layer to the selection. This function then fires the selected event.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.smoothControlPoints"></a>smoothControlPoints</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var smoothControlPoints = this.smoothControlPoints = function(</td><tdclass=PParameternowrap>ct1,</td></tr><tr><td></td><tdclass=PParameternowrap>ct2,</td></tr><tr><td></td><tdclass=PParameternowrap>pt</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Takes three points and creates a smoother line based on them</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>ct1</td><tdclass=CDLDescription>Object with x and y values (first control point)</td></tr><tr><tdclass=CDLEntry>ct2</td><tdclass=CDLDescription>Object with x and y values (second control point)</td></tr><tr><tdclass=CDLEntry>pt</td><tdclass=CDLDescription>Object with x and y values (third point)</td></tr></table><h4class=CHeading>Returns</h4><p>Array of two “smoothed” point objects</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getMouseTarget"></a>getMouseTarget</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var getMouseTarget = this.getMouseTarget = function(</td><tdclass=PParameternowrap>evt</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Gets the desired element from a mouse event</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>evt</td><tdclass=CDLDescription>Event object from the mouse event</td></tr></table><h4class=CHeading>Returns</h4><p>DOM element we want</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.preventClickDefault"></a>preventClickDefault</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var preventClickDefault = function(</td><tdclass=PParameternowrap>img</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Prevents default browser click behaviour on the given element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>img</td><tdclass=CDLDescription>The DOM element to prevent the cilck on</td></tr></table></div></div></div>
<divclass="CGroup"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.Text_edit_functions"></a>Text edit functions</h3><divclass=CBody><p>Functions relating to editing text elements</p></div></div></div>
<divclass="CGroup"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.Path_edit_functions"></a>Path edit functions</h3><divclass=CBody><p>Functions relating to editing path elements</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.removeUnusedDefElems"></a>removeUnusedDefElems</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>var removeUnusedDefElems = this.removeUnusedDefElems = function()</td></tr></table></blockquote><p>Looks at DOM elements inside the <defs> to see if they are referred to, removes them from the DOM if they are not.</p><h4class=CHeading>Returns</h4><p>The amount of elements that were removed</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.svgCanvasToString"></a>svgCanvasToString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>var svgCanvasToString = this.svgCanvasToString = function()</td></tr></table></blockquote><p>Main function to set up the SVG content for output</p><h4class=CHeading>Returns</h4><p>String containing the SVG image for output</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.svgToString"></a>svgToString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var svgToString = this.svgToString = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>indent</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sub function ran on each SVG element to convert it to a string as desired</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The SVG element to convert</td></tr><tr><tdclass=CDLEntry>indent</td><tdclass=CDLDescription>Integer with the amount of spaces to indent this tag</td></tr></table><h4class=CHeading>Returns</h4><p>String with the given element as an SVG tag</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.embedImage"></a>embedImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.embedImage = function(</td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>callback</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts a given image file to a data URL when possible, then runs a given callback</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the path/URL of the image</td></tr><tr><tdclass=CDLEntry>callback</td><tdclass=CDLDescription>Optional function to run when image data is found, supplies the result (data URL or false) as first parameter.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.save"></a>save</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.save = function(</td><tdclass=PParameternowrap>opts</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler. This function also includes the XML prolog. Clients of the SvgCanvas bind their save function to the ‘saved’ event.</p><h4class=CHeading>Returns</h4><p>Nothing</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.rasterExport"></a>rasterExport</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.rasterExport = function()</td></tr></table></blockquote><p>Generates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getSvgString"></a>getSvgString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getSvgString = function()</td></tr></table></blockquote><p>Returns the current drawing as raw SVG XML text.</p><h4class=CHeading>Returns</h4><p>The current drawing as raw SVG XML text.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setSvgString"></a>setSvgString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setSvgString = function(</td><tdclass=PParameternowrap>xmlString</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>This function sets the current drawing as the input SVG XML.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>xmlString</td><tdclass=CDLDescription>The SVG as XML text.</td></tr></table><h4class=CHeading>Returns</h4><p>This function returns false if the set was unsuccessful, true otherwise.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.importSvgString"></a>importSvgString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.importSvgString = function(</td><tdclass=PParameternowrap>xmlString</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>This function imports the input SVG XML into the current layer in the drawing</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>xmlString</td><tdclass=CDLDescription>The SVG as XML text.</td></tr></table><h4class=CHeading>Returns</h4><p>This function returns false if the import was unsuccessful, true otherwise. TODO:</p><ul><li>properly handle if namespace is introduced by imported content (must add to svgcontent and update all prefixes in the imported node)</li><li>properly handle recalculating dimensions, recalculateDimensions() doesn’t handle arbitrary transform lists, but makes some assumptions about how the transform list was obtained</li><li>import should happen in top-left of current zoomed viewport</li><li>create a new layer for the imported SVG</li></ul></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.createLayer"></a>createLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.createLayer = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler. This is an undoable action.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>The given name</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.deleteCurrentLayer"></a>deleteCurrentLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.deleteCurrentLayer = function()</td></tr></table></blockquote><p>Deletes the current layer from the drawing and then clears the selection. This function then calls the ‘changed’ handler. This is an undoable action.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getNumLayers"></a>getNumLayers</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getNumLayers = function()</td></tr></table></blockquote><p>Returns the number of layers in the current drawing.</p><h4class=CHeading>Returns</h4><p>The number of layers in the current drawing.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getLayer"></a>getLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.getLayer = function(</td><tdclass=PParameternowrap>i</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the name of the ith layer. If the index is out of range, an empty string is returned.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>i</td><tdclass=CDLDescription>the zero-based index of the layer you are querying.</td></tr></table><h4class=CHeading>Returns</h4><p>The name of the ith layer</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getCurrentLayer"></a>getCurrentLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getCurrentLayer = function()</td></tr></table></blockquote><p>Returns the name of the currently selected layer. If an error occurs, an empty string is returned.</p><h4class=CHeading>Returns</h4><p>The name of the currently active layer.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setCurrentLayer"></a>setCurrentLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setCurrentLayer = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the current layer. If the name is not a valid layer name, then this function returns false. Otherwise it returns true. This is not an undo-able action.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>the name of the layer you want to switch to.</td></tr></table><h4class=CHeading>Returns</h4><p>true if the current layer was switched, otherwise false</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.renameCurrentLayer"></a>renameCurrentLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.renameCurrentLayer = function(</td><tdclass=PParameternowrap>newname</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Renames the current layer. If the layer name is not valid (i.e. unique), then this function does nothing and returns false, otherwise it returns true. This is an undo-able action.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>newname</td><tdclass=CDLDescription>the new name you want to give the current layer. This name must be unique among all layer names.</td></tr></table><h4class=CHeading>Returns</h4><p>true if the rename succeeded, false otherwise.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setCurrentLayerPosition"></a>setCurrentLayerPosition</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setCurrentLayerPosition = function(</td><tdclass=PParameternowrap>newpos</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Changes the position of the current layer to the new value. If the new index is not valid, this function does nothing and returns false, otherwise it returns true. This is an undo-able action.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>newpos</td><tdclass=CDLDescription>The zero-based index of the new position of the layer. This should be between</td></tr><tr><tdclass=CDLEntry>0 and (number of layers</td><tdclass=CDLDescription>1)</td></tr></table><h4class=CHeading>Returns</h4><p>true if the current layer position was changed, false otherwise.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getLayerVisibility"></a>getLayerVisibility</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.getLayerVisibility = function(</td><tdclass=PParameternowrap>layername</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns whether the layer is visible. If the layer name is not valid, then this function returns false.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>layername</td><tdclass=CDLDescription>the name of the layer which you want to query.</td></tr></table><h4class=CHeading>Returns</h4><p>The visibility state of the layer, or false if the layer name was invalid.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setLayerVisibility"></a>setLayerVisibility</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setLayerVisibility = function(</td><tdclass=PParameternowrap>layername,</td></tr><tr><td></td><tdclass=PParameternowrap>bVisible</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the visibility of the layer. If the layer name is not valid, this function return false, otherwise it returns true. This is an undo-able action.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>layername</td><tdclass=CDLDescription>the name of the layer to change the visibility</td></tr><tr><tdclass=CDLEntry>bVisible</td><tdclass=CDLDescription>true/false, whether the layer should be visible</td></tr></table><h4class=CHeading>Returns</h4><p>true if the layer’s visibility was set, false otherwise</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.moveSelectedToLayer"></a>moveSelectedToLayer</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.moveSelectedToLayer = function(</td><tdclass=PParameternowrap>layername</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Moves the selected elements to layername. If the name is not a valid layer name, then false is returned. Otherwise it returns true. This is an undo-able action.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>layername</td><tdclass=CDLDescription>the name of the layer you want to which you want to move the selected elements</td></tr></table><h4class=CHeading>Returns</h4><p>true if the selected elements were moved to the layer, false otherwise.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getLayerOpacity"></a>getLayerOpacity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.getLayerOpacity = function(</td><tdclass=PParameternowrap>layername</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the opacity of the given layer. If the input name is not a layer, null is returned.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>layername</td><tdclass=CDLDescription>name of the layer on which to get the opacity</td></tr></table><h4class=CHeading>Returns</h4><p>The opacity value of the given layer. This will be a value between 0.0 and 1.0, or null if layername is not a valid layer</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setLayerOpacity"></a>setLayerOpacity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setLayerOpacity = function(</td><tdclass=PParameternowrap>layername,</td></tr><tr><td></td><tdclass=PParameternowrap>opacity</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the opacity of the given layer. If the input name is not a layer, nothing happens. This is not an undo-able action. NOTE: this function exists solely to apply a highlighting/de-emphasis effect to a layer, when it is possible for a user to affect the opacity of a layer, we will need to allow this function to produce an undo-able action. If opacity is not a value between 0.0 and 1.0, then nothing happens.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>layername</td><tdclass=CDLDescription>name of the layer on which to set the opacity</td></tr><tr><tdclass=CDLEntry>opacity</td><tdclass=CDLDescription>a float value in the range 0.0-1.0</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.clear"></a>clear</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.clear = function()</td></tr></table></blockquote><p>Clears the current document. This is not an undoable action.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getContentElem"></a>getContentElem</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getContentElem = function()</td></tr></table></blockquote><p>Returns the content DOM element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getRootElem"></a>getRootElem</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getRootElem = function()</td></tr></table></blockquote><p>Returns the root DOM element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getSelectedElems"></a>getSelectedElems</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getSelectedElems = function()</td></tr></table></blockquote><p>Returns the array with selected DOM elements</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getResolution"></a>getResolution</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>var getResolution = this.getResolution = function()</td></tr></table></blockquote><p>Returns the current dimensions and zoom level in an object</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getZoom"></a>getZoom</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getZoom = function()</td></tr></table></blockquote><p>Returns the current zoom level</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getVersion"></a>getVersion</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getVersion = function()</td></tr></table></blockquote><p>Returns a string which describes the revision number of SvgCanvas.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setUiStrings"></a>setUiStrings</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setUiStrings = function(</td><tdclass=PParameternowrap>strs</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Update interface strings with given values</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>strs</td><tdclass=CDLDescription>Object with strings (see uiStrings for examples)</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setConfig"></a>setConfig</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setConfig = function(</td><tdclass=PParameternowrap>opts</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Update configuration options with given values</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>opts</td><tdclass=CDLDescription>Object with options (see curConfig for examples)</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getDocumentTitle"></a>getDocumentTitle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getDocumentTitle = function()</td></tr></table></blockquote><p>Returns the current document title or an empty string if not found</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setDocumentTitle"></a>setDocumentTitle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setDocumentTitle = function(</td><tdclass=PParameternowrap>newtitle</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds/updates a title element for the document with the given name. This is an undoable action</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>newtitle</td><tdclass=CDLDescription>String with the new title</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getEditorNS"></a>getEditorNS</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.getEditorNS = function(</td><tdclass=PParameternowrap>add</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the editor’s namespace URL, optionally adds it to root element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>add</td><tdclass=CDLDescription>Boolean to indicate whether or not to add the namespace value</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setResolution"></a>setResolution</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setResolution = function(</td><tdclass=PParameternowrap>x,</td></tr><tr><td></td><tdclass=PParameternowrap>y</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Changes the document’s dimensions to the given size</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>x</td><tdclass=CDLDescription>Number with the width of the new dimensions in user units. Can also be the string “fit” to indicate “fit to content”</td></tr><tr><tdclass=CDLEntry>y</td><tdclass=CDLDescription>Number with the height of the new dimensions in user units.</td></tr></table><h4class=CHeading>Returns</h4><p>Boolean to indicate if resolution change was succesful. It will fail on “fit to content” option with no content to fit to.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getOffset"></a>getOffset</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getOffset = function()</td></tr></table></blockquote><p>Returns an object with x, y values indicating the svgcontent element’s position in the editor’s canvas.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setBBoxZoom"></a>setBBoxZoom</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setBBoxZoom = function(</td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>editor_w,</td></tr><tr><td></td><tdclass=PParameternowrap>editor_h</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the zoom level on the canvas-side based on the given value</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>Bounding box object to zoom to or string indicating zoom option</td></tr><tr><tdclass=CDLEntry>editor_w</td><tdclass=CDLDescription>Integer with the editor’s workarea box’s width</td></tr><tr><tdclass=CDLEntry>editor_h</td><tdclass=CDLDescription>Integer with the editor’s workarea box’s height</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setZoom"></a>setZoom</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setZoom = function(</td><tdclass=PParameternowrap>zoomlevel</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the zoom to the given level</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>zoomlevel</td><tdclass=CDLDescription>Float indicating the zoom level to change to</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getMode"></a>getMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getMode = function()</td></tr></table></blockquote><p>Returns the current editor mode string</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setMode"></a>setMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setMode = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the editor’s mode to the given string</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>String with the new mode to change to</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getColor"></a>getColor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.getColor = function(</td><tdclass=PParameternowrap>type</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the current fill/stroke option</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setColor"></a>setColor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setColor = function(</td><tdclass=PParameternowrap>type,</td></tr><tr><td></td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>preventUndo</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Change the current stroke/fill color/gradient value</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>type</td><tdclass=CDLDescription>String indicating fill or stroke</td></tr><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>The value to set the stroke attribute to</td></tr><tr><tdclass=CDLEntry>preventUndo</td><tdclass=CDLDescription>Boolean indicating whether or not this should be and undoable option</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.findDefs"></a>findDefs</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>var findDefs = function()</td></tr></table></blockquote><p>Return the document’s <defs> element, create it first if necessary</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setGradient"></a>setGradient</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var setGradient = this.setGradient = function(</td><tdclass=PParameternowrap>type</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Apply the current gradient to selected element’s fill or stroke</p><p>Parameters type - String indicating “fill” or “stroke” to apply to an element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.findDuplicateGradient"></a>findDuplicateGradient</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var findDuplicateGradient = function(</td><tdclass=PParameternowrap>grad</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if exact gradient already exists</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>grad</td><tdclass=CDLDescription>The gradient DOM element to compare to others</td></tr></table><h4class=CHeading>Returns</h4><p>The existing gradient if found, null if not</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setPaint"></a>setPaint</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setPaint = function(</td><tdclass=PParameternowrap>type,</td></tr><tr><td></td><tdclass=PParameternowrap>paint</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Set a color/gradient to a fill/stroke</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>type</td><tdclass=CDLDescription>String with “fill” or “stroke”</td></tr><tr><tdclass=CDLEntry>paint</td><tdclass=CDLDescription>The jGraduate paint object to apply</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getStrokeWidth"></a>getStrokeWidth</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getStrokeWidth = function()</td></tr></table></blockquote><p>Returns the current stroke-width value</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setStrokeWidth"></a>setStrokeWidth</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setStrokeWidth = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the stroke width for the current selected elements When attempting to set a line’s width to 0, this changes it to 1 instead</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>A Float indicating the new stroke width value</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setStrokeAttr"></a>setStrokeAttr</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setStrokeAttr = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Set the given stroke-related attribute the given value for selected elements</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attr</td><tdclass=CDLDescription>String with the attribute name</td></tr><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String or number with the attribute value</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getOpacity"></a>getOpacity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getOpacity = function()</td></tr></table></blockquote><p>Returns the current opacity</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setOpacity"></a>setOpacity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setOpacity = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the given opacity to the current selected elements</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getOpacity"></a>getOpacity</h3><divclass=CBody><p>Returns the current fill opacity</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getStrokeOpacity"></a>getStrokeOpacity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getStrokeOpacity = function()</td></tr></table></blockquote><p>Returns the current stroke opacity</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setPaintOpacity"></a>setPaintOpacity</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setPaintOpacity = function(</td><tdclass=PParameternowrap>type,</td></tr><tr><td></td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>preventUndo</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the current fill/stroke opacity</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>type</td><tdclass=CDLDescription>String with “fill” or “stroke”</td></tr><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>Float with the new opacity value</td></tr><tr><tdclass=CDLEntry>preventUndo</td><tdclass=CDLDescription>Boolean indicating whether or not this should be an undoable action</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getBlur"></a>getBlur</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.getBlur = function(</td><tdclass=PParameternowrap>elem</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Gets the stdDeviation blur value of the given element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The element to check the blur value for</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setBlurNoUndo"></a>setBlurNoUndo</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>canvas.setBlurNoUndo = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the stdDeviation blur value on the selected element without being undoable</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>The new stdDeviation value</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setBlurOffsets"></a>setBlurOffsets</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>canvas.setBlurOffsets = function(</td><tdclass=PParameternowrap>filter,</td></tr><tr><td></td><tdclass=PParameternowrap>stdDev</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the x, y, with, height values of the filter element in order to make the blur not be clipped. Removes them if not neeeded</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>filter</td><tdclass=CDLDescription>The filter DOM element to update</td></tr><tr><tdclass=CDLEntry>stdDev</td><tdclass=CDLDescription>The standard deviation value on which to base the offset size</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setBlur"></a>setBlur</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>canvas.setBlur = function(</td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>complete</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds/updates the blur filter to the selected element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>Float with the new stdDeviation blur value</td></tr><tr><tdclass=CDLEntry>complete</td><tdclass=CDLDescription>Boolean indicating whether or not the action should be completed (to add to the undo manager)</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getBold"></a>getBold</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getBold = function()</td></tr></table></blockquote><p>Check whether selected element is bold or not</p><h4class=CHeading>Returns</h4><p>Boolean indicating whether or not element is bold</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setBold"></a>setBold</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setBold = function(</td><tdclass=PParameternowrap>b</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Make the selected element bold or normal</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>b</td><tdclass=CDLDescription>Boolean indicating bold (true) or normal (false)</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getItalic"></a>getItalic</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getItalic = function()</td></tr></table></blockquote><p>Check whether selected element is italic or not</p><h4class=CHeading>Returns</h4><p>Boolean indicating whether or not element is italic</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setItalic"></a>setItalic</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setItalic = function(</td><tdclass=PParameternowrap>i</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Make the selected element italic or normal</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>b</td><tdclass=CDLDescription>Boolean indicating italic (true) or normal (false)</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getFontFamily"></a>getFontFamily</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getFontFamily = function()</td></tr></table></blockquote><p>Returns the current font family</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setFontFamily"></a>setFontFamily</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setFontFamily = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Set the new font family</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the new font family</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getFontSize"></a>getFontSize</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getFontSize = function()</td></tr></table></blockquote><p>Returns the current font size</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setFontSize"></a>setFontSize</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setFontSize = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Applies the given font size to the selected element</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>Float with the new font size</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.getText"></a>getText</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.getText = function()</td></tr></table></blockquote><p>Returns the current text (textContent) of the selected element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setTextContent"></a>setTextContent</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setTextContent = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Updates the text element with the given string</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the new text</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setImageURL"></a>setImageURL</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setImageURL = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the new image URL for the selected image element. Updates its size if a new URL is given</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>String with the image URL/path</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setRectRadius"></a>setRectRadius</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setRectRadius = function(</td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the rx & ry values to the selected rect element to change its corner radius</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>val</td><tdclass=CDLDescription>The new radius</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setSegType"></a>setSegType</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setSegType = function(</td><tdclass=PParameternowrap>new_type</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the new segment type to the selected segment(s).</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>new_type</td><tdclass=CDLDescription>Integer with the new segment type See <ahref="http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg"class=LURLtarget=_top>http://www.w3.org<wbr>/TR<wbr>/SVG<wbr>/paths.html#InterfaceSVGPathSeg</a> for list</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.convertToPath"></a>convertToPath</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.convertToPath = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>getBBox</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Convert selected element to a path, or get the BBox of an element-as-path</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>elem</td><tdclass=CDLDescription>The DOM element to be converted</td></tr><tr><tdclass=CDLEntry>getBBox</td><tdclass=CDLDescription>Boolean on whether or not to only return the path’s BBox</td></tr></table><h4class=CHeading>Returns</h4><p>If the getBBox flag is true, the resulting path’s bounding box object. Otherwise the resulting path element is returned.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.changeSelectedAttributeNoUndo"></a>changeSelectedAttributeNoUndo</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var changeSelectedAttributeNoUndo = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>newValue,</td></tr><tr><td></td><tdclass=PParameternowrap>elems</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>This function makes the changes to the elements. It does not add the change to the history stack.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attr</td><tdclass=CDLDescription>String with the attribute name</td></tr><tr><tdclass=CDLEntry>newValue</td><tdclass=CDLDescription>String or number with the new attribute value</td></tr><tr><tdclass=CDLEntry>elems</td><tdclass=CDLDescription>The DOM elements to apply the change to</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.changeSelectedAttribute"></a>changeSelectedAttribute</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var changeSelectedAttribute = this.changeSelectedAttribute = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val,</td></tr><tr><td></td><tdclass=PParameternowrap>elems</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Change the given/selected element and add the original value to the history stack If you want to change all selectedElements, ignore the elems argument. If you want to change only a subset of selectedElements, then send the subset to this function in the elems argument.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>attr</td><tdclass=CDLDescription>String with the attribute name</td></tr><tr><tdclass=CDLEntry>newValue</td><tdclass=CDLDescription>String or number with the new attribute value</td></tr><tr><tdclass=CDLEntry>elems</td><tdclass=CDLDescription>The DOM elements to apply the change to</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.deleteSelectedElements"></a>deleteSelectedElements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.deleteSelectedElements = function()</td></tr></table></blockquote><p>Removes all selected elements from the DOM and adds the change to the history stack</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.groupSelectedElements"></a>groupSelectedElements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.groupSelectedElements = function()</td></tr></table></blockquote><p>Wraps all the selected elements in a group (g) element</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.ungroupSelectedElement"></a>ungroupSelectedElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.ungroupSelectedElement = function()</td></tr></table></blockquote><p>Unwraps all the elements in a selected group (g) element. This requires significant recalculations to apply group’s transforms, etc to its children</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.moveToTopSelectedElement"></a>moveToTopSelectedElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.moveToTopSelectedElement = function()</td></tr></table></blockquote><p>Repositions the selected element to the bottom in the DOM to appear on top of other elements</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.moveToBottomSelectedElement"></a>moveToBottomSelectedElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.moveToBottomSelectedElement = function()</td></tr></table></blockquote><p>Repositions the selected element to the top in the DOM to appear under other elements</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.moveSelectedElements"></a>moveSelectedElements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.moveSelectedElements = function(</td><tdclass=PParameternowrap>dx,</td></tr><tr><td></td><tdclass=PParameternowrap>dy,</td></tr><tr><td></td><tdclass=PParameternowrap>undoable</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Moves selected elements on the X/Y axis</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>dx</td><tdclass=CDLDescription>Float with the distance to move on the x-axis</td></tr><tr><tdclass=CDLEntry>dy</td><tdclass=CDLDescription>Float with the distance to move on the y-axis</td></tr><tr><tdclass=CDLEntry>undoable</td><tdclass=CDLDescription>Boolean indicating whether or not the action should be undoable</td></tr></table><h4class=CHeading>Returns</h4><p>Batch command for the move</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.cloneSelectedElements"></a>cloneSelectedElements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.cloneSelectedElements = function()</td></tr></table></blockquote><p>Create deep DOM copies (clones) of all selected elements and move them slightly from their originals</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.alignSelectedElements"></a>alignSelectedElements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.alignSelectedElements = function(</td><tdclass=PParameternowrap>type,</td></tr><tr><td></td><tdclass=PParameternowrap>relative_to</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Aligns selected elements</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>type</td><tdclass=CDLDescription>String with single character indicating the alignment type</td></tr><tr><tdclass=CDLEntry>relative_to</td><tdclass=CDLDescription>String that must be one of the following: “selected”, “largest”, “smallest”, “page”</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.updateCanvas"></a>updateCanvas</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.updateCanvas = function(</td><tdclass=PParameternowrap>w,</td></tr><tr><td></td><tdclass=PParameternowrap>h</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Updates the editor canvas width/height/position after a zoom has occurred</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>w</td><tdclass=CDLDescription>Float with the new width</td></tr><tr><tdclass=CDLEntry>h</td><tdclass=CDLDescription>Float with the new height</td></tr></table><h4class=CHeading>Returns</h4><p>Object with the following values:</p><ul><li>x - The canvas’ new x coordinate</li><li>y - The canvas’ new y coordinate</li><li>old_x - The canvas’ old x coordinate</li><li>old_y - The canvas’ old y coordinate</li><li>d_x - The x position difference</li><li>d_y - The y position difference</li></ul></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.setBackground"></a>setBackground</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.setBackground = function(</td><tdclass=PParameternowrap>color,</td></tr><tr><td></td><tdclass=PParameternowrap>url</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Set the background of the editor (NOT the actual document)</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>color</td><tdclass=CDLDescription>String with fill color to apply</td></tr><tr><tdclass=CDLEntry>url</td><tdclass=CDLDescription>URL or path to image to use</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="SelectorManager.cycleElement"></a>cycleElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>this.cycleElement = function(</td><tdclass=PParameternowrap>next</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Select the next/previous element within the current layer</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>next</td><tdclass=CDLDescription>Boolean where true = next and false = previous element</td></tr></table></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>"rectsIntersect": function(</td><tdclass=PParameternowrap>r1,</td></tr><tr><td></td><tdclass=PParameternowrap>r2</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Check if two rectangles (BBoxes objects) intersect each other</div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>"snapToAngle": function(</td><tdclass=PParameternowrap>x1,</td></tr><tr><td></td><tdclass=PParameternowrap>y1,</td></tr><tr><td></td><tdclass=PParameternowrap>x2,</td></tr><tr><td></td><tdclass=PParameternowrap>y2</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns a 45 degree angle coordinate associated with the two given coordinates</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>"text2xml": function(</td><tdclass=PParameternowrap>sXML</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Cross-browser compatible method of converting a string to an XML tree found this function here: http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f</div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>convertToNum = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Converts given values to numbers. </div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>setUnitAttr = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Sets an element’s attribute based on the unit in its current value.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>canvas.isValidUnit = function(</td><tdclass=PParameternowrap>attr,</td></tr><tr><td></td><tdclass=PParameternowrap>val</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Check if an attribute’s value is in a valid format</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var ChangeElementCommand = this.undoCmd.changeElement = function(</td><tdclass=PParameternowrap>elem,</td></tr><tr><td></td><tdclass=PParameternowrap>attrs,</td></tr><tr><td></td><tdclass=PParameternowrap>text</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>History command to make a change to an element. </div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>var InsertElementCommand = this.undoCmd.insertElement = function(</td><tdclass=PParameternowrap>elem,</td></