view htdocs/svg-edit/docs/files/svgcanvas-js.html @ 632:8c00e2be925e

inital veraion 2.7 r2891 of svg-edit
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 05 Feb 2015 16:37:37 +0100
parents
children
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>SvgCanvas</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="SvgCanvas"></a>SvgCanvas</h1><div class=CBody><p>The main SvgCanvas class that manages all SVG-related functions</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>container</td><td class=CDLDescription>The container HTML element that should hold the SVG root element</td></tr><tr><td class=CDLEntry>config</td><td class=CDLDescription>An object that contains configuration data</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#SvgCanvas" >SvgCanvas</a></td><td class=SDescription>The main SvgCanvas class that manages all SVG-related functions</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SvgCanvas.Utils.toXml" >Utils.<wbr>toXml</a></td><td class=SDescription>Converts characters in a string to XML-friendly entities.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SvgCanvas.Utils.fromXml" >Utils.<wbr>fromXml</a></td><td class=SDescription>Converts XML entities in a string to single characters. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SvgCanvas.Utils.encode64" >Utils.<wbr>encode64</a></td><td class=SDescription>Converts a string to base64</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SvgCanvas.Utils.decode64" >Utils.<wbr>decode64</a></td><td class=SDescription>Converts a string from base64</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SvgCanvas.Utils.convertToXMLReferences" >Utils.<wbr>convertToXMLReferences</a></td><td class=SDescription>Converts a string to use XML references</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SvgCanvas.rectsIntersect" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">rectsIntersect</a></td><td class=SDescription>Check if two rectangles (BBoxes objects) intersect each other</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SvgCanvas.snapToAngle" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">snapToAngle</a></td><td class=SDescription>Returns a 45 degree angle coordinate associated with the two given coordinates</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SvgCanvas.text2xml" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">text2xml</a></td><td class=SDescription>Cross-browser compatible method of converting a string to an XML tree found this function here: <a href="http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f" class=LURL target=_top>http://groups.google.com<wbr>/group<wbr>/jquery-dev<wbr>/browse_thread<wbr>/thread<wbr>/c6d11387c580a77f</a></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SvgCanvas.Unit_conversion_functions" >Unit conversion functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.convertToNum" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">convertToNum</a></td><td class=SDescription>Converts given values to numbers. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.setUnitAttr" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">setUnitAttr</a></td><td class=SDescription>Sets an element&rsquo;s attribute based on the unit in its current value.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.isValidUnit" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">isValidUnit</a></td><td class=SDescription>Check if an attribute&rsquo;s value is in a valid format</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SvgCanvas.Undo/Redo_history_management" >Undo/<wbr>Redo history management</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.ChangeElementCommand" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">ChangeElementCommand</a></td><td class=SDescription>History command to make a change to an element. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.ChangeElementCommand.apply" >ChangeElementCommand.<wbr>apply</a></td><td class=SDescription>Performs the stored change action</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.ChangeElementCommand.unapply" >ChangeElementCommand.<wbr>unapply</a></td><td class=SDescription>Reverses the stored change action</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.ChangeElementCommand.elements" >ChangeElementCommand.<wbr>elements</a></td><td class=SDescription>Returns array with element associated with this command</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.InsertElementCommand" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">InsertElementCommand</a></td><td class=SDescription>History command for an element that was added to the DOM</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.InsertElementCommand.apply" >InsertElementCommand.<wbr>apply</a></td><td class=SDescription>Re-Inserts the new element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.InsertElementCommand.unapply" >InsertElementCommand.<wbr>unapply</a></td><td class=SDescription>Removes the element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.InsertElementCommand.elements" >InsertElementCommand.<wbr>elements</a></td><td class=SDescription>Returns array with element associated with this command</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.RemoveElementCommand" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">RemoveElementCommand</a></td><td class=SDescription>History command for an element removed from the DOM</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.RemoveElementCommand.apply" >RemoveElementCommand.<wbr>apply</a></td><td class=SDescription>Re-removes the new element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.RemoveElementCommand.unapply" >RemoveElementCommand.<wbr>unapply</a></td><td class=SDescription>Re-adds the new element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.RemoveElementCommand.elements" >RemoveElementCommand.<wbr>elements</a></td><td class=SDescription>Returns array with element associated with this command</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.MoveElementCommand" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">MoveElementCommand</a></td><td class=SDescription>History command for an element that had its DOM position changed</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.MoveElementCommand.unapply" >MoveElementCommand.<wbr>unapply</a></td><td class=SDescription>Re-positions the element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.MoveElementCommand.unapply" >MoveElementCommand.<wbr>unapply</a></td><td class=SDescription>Positions the element back to its original location</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.MoveElementCommand.elements" >MoveElementCommand.<wbr>elements</a></td><td class=SDescription>Returns array with element associated with this command</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.BatchCommand" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">BatchCommand</a></td><td class=SDescription>History command that can contain/execute multiple other commands</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.BatchCommand.apply" >BatchCommand.<wbr>apply</a></td><td class=SDescription>Runs &ldquo;apply&rdquo; on all subcommands</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.BatchCommand.unapply" >BatchCommand.<wbr>unapply</a></td><td class=SDescription>Runs &ldquo;unapply&rdquo; on all subcommands</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.BatchCommand.elements" >BatchCommand.<wbr>elements</a></td><td class=SDescription>Iterate through all our subcommands and returns all the elements we are changing</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.BatchCommand.addSubCommand" >BatchCommand.<wbr>addSubCommand</a></td><td class=SDescription>Adds a given command to the history stack</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.BatchCommand.isEmpty" >BatchCommand.<wbr>isEmpty</a></td><td class=SDescription>Returns a boolean indicating whether or not the batch command is empty</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.resetUndoStack" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">resetUndoStack</a></td><td class=SDescription>Resets the undo stack, effectively clearing the undo/redo history</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.undoMgr.getUndoStackSize" >undoMgr.<wbr>getUndoStackSize</a></td><td class=SDescription>Integer with the current size of the undo history stack</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.undoMgr.getRedoStackSize" >undoMgr.<wbr>getRedoStackSize</a></td><td class=SDescription>Integer with the current size of the redo history stack</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.undoMgr.getNextUndoCommandText" >undoMgr.<wbr>getNextUndoCommandText</a></td><td class=SDescription>String associated with the next undo command</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.undoMgr.getNextRedoCommandText" >undoMgr.<wbr>getNextRedoCommandText</a></td><td class=SDescription>String associated with the next redo command</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.undoMgr.undo" >undoMgr.undo</a></td><td class=SDescription>Performs an undo step</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.undoMgr.redo" >undoMgr.redo</a></td><td class=SDescription>Performs a redo step</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.addCommandToHistory" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">addCommandToHistory</a></td><td class=SDescription>Adds a command object to the undo history stack</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SvgCanvas.beginUndoableChange" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">beginUndoableChange</a></td><td class=SDescription>This function tells the canvas to remember the old values of the attrName attribute for each element sent in. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SvgCanvas.finishUndoableChange" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">finishUndoableChange</a></td><td class=SDescription>This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called. </td></tr><tr class="SInterface"><td class=SEntry><a href="#Selector" >Selector</a></td><td class=SDescription>Private class for DOM element selection boxes</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Selector.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Selector.Selector.reset" >Selector.<wbr>reset</a></td><td class=SDescription>Used to reset the id and element that the selector is attached to</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Selector.Selector.showGrips" >Selector.<wbr>showGrips</a></td><td class=SDescription>Show the resize grips of this selector</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Selector.Selector.updateGripCursors" >Selector.<wbr>updateGripCursors</a></td><td class=SDescription>Updates cursors for corner grips on rotation so arrows point the right way</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Selector.Selector.resize" >Selector.<wbr>resize</a></td><td class=SDescription>Updates the selector to match the element&rsquo;s size</td></tr><tr class="SInterface"><td class=SEntry><a href="#SelectorManager" >SelectorManager</a></td><td class=SDescription>Public class to manage all selector objects (selection boxes)</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.SelectorManager.initGroup" >SelectorManager.<wbr>initGroup</a></td><td class=SDescription>Resets the parent selector group element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.SelectorManager.requestSelector" >SelectorManager.<wbr>requestSelector</a></td><td class=SDescription>Returns the selector based on the given element</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.SelectorManager.releaseSelector" >SelectorManager.<wbr>releaseSelector</a></td><td class=SDescription>Removes the selector of the given element (hides selection box)</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.SelectorManager.getRubberBandBox" >SelectorManager.<wbr>getRubberBandBox</a></td><td class=SDescription>Returns the rubberBandBox DOM element. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Helper_functions" >Helper functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.walkTree" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">walkTree</a></td><td class=SDescription>Walks the tree and executes the callback on each element in a top-down fashion</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.walkTreePost" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">walkTreePost</a></td><td class=SDescription>Walks the tree and executes the callback on each element in a depth-first fashion</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.assignAttributes" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">assignAttributes</a></td><td class=SDescription>Assigns multiple attributes to an element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.cleanupElement" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">cleanupElement</a></td><td class=SDescription>Remove unneeded (default) attributes, makes resulting SVG smaller</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.addSvgElementFromJson" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">addSvgElementFromJson</a></td><td class=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><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.addExtension" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">addExtension</a></td><td class=SDescription>Add an extension to the editor</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.shortFloat" id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">shortFloat</a></td><td class=SDescription>Rounds a given value to a float with number of digits defined in save_options</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getStrokedBBox" id=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">getStrokedBBox</a></td><td class=SDescription>Get the bounding box for one or more stroked and/or transformed elements</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getVisibleElements" id=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">getVisibleElements</a></td><td class=SDescription>Get all elements that have a BBox (excludes &lt;defs&gt;, &lt;title&gt;, etc). </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.copyElem" id=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">copyElem</a></td><td class=SDescription>Create a clone of an element, updating its ID and its children&rsquo;s IDs when needed</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getElem" id=link26 onMouseOver="ShowTip(event, 'tt26', 'link26')" onMouseOut="HideTip('tt26')">getElem</a></td><td class=SDescription>Get a DOM element by ID within the SVG root element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getId" id=link27 onMouseOver="ShowTip(event, 'tt27', 'link27')" onMouseOut="HideTip('tt27')">getId</a></td><td class=SDescription>Returns the last created DOM element ID string</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getNextId" id=link28 onMouseOver="ShowTip(event, 'tt28', 'link28')" onMouseOut="HideTip('tt28')">getNextId</a></td><td class=SDescription>Creates and returns a unique ID string for a DOM element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.bind" id=link29 onMouseOver="ShowTip(event, 'tt29', 'link29')" onMouseOut="HideTip('tt29')">bind</a></td><td class=SDescription>Attaches a callback function to an event</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setIdPrefix" id=link30 onMouseOver="ShowTip(event, 'tt30', 'link30')" onMouseOut="HideTip('tt30')">setIdPrefix</a></td><td class=SDescription>Changes the ID prefix to the given value</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.sanitizeSvg" id=link31 onMouseOver="ShowTip(event, 'tt31', 'link31')" onMouseOut="HideTip('tt31')">sanitizeSvg</a></td><td class=SDescription>Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getUrlFromAttr" id=link32 onMouseOver="ShowTip(event, 'tt32', 'link32')" onMouseOut="HideTip('tt32')">getUrlFromAttr</a></td><td class=SDescription>Extracts the URL from the url(...)</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getBBox" id=link33 onMouseOver="ShowTip(event, 'tt33', 'link33')" onMouseOut="HideTip('tt33')">getBBox</a></td><td class=SDescription>Get the given/selected element&rsquo;s bounding box object, convert it to be more usable when necessary</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.ffClone" id=link34 onMouseOver="ShowTip(event, 'tt34', 'link34')" onMouseOut="HideTip('tt34')">ffClone</a></td><td class=SDescription>Hack for Firefox bugs where text element features aren&rsquo;t updated. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getPathBBox" id=link35 onMouseOver="ShowTip(event, 'tt35', 'link35')" onMouseOut="HideTip('tt35')">getPathBBox</a></td><td class=SDescription>Get correct BBox for a path in Webkit Converted from code found here: <a href="http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html" class=LURL target=_top>http://blog.hackers-cafe.net<wbr>/2009<wbr>/06<wbr>/how-to-calculate-bezier-curves-bounding.html</a></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Element_Transforms" >Element Transforms</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getRotationAngle" id=link36 onMouseOver="ShowTip(event, 'tt36', 'link36')" onMouseOut="HideTip('tt36')">getRotationAngle</a></td><td class=SDescription>Get the rotation angle of the given/selected DOM element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setRotationAngle" id=link37 onMouseOver="ShowTip(event, 'tt37', 'link37')" onMouseOut="HideTip('tt37')">setRotationAngle</a></td><td class=SDescription>Removes any old rotations if present, prepends a new rotation at the transformed center</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getTransformList" id=link38 onMouseOver="ShowTip(event, 'tt38', 'link38')" onMouseOut="HideTip('tt38')">getTransformList</a></td><td class=SDescription>Returns an object that behaves like a SVGTransformList for the given DOM element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.recalculateAllSelectedDimensions" id=link39 onMouseOver="ShowTip(event, 'tt39', 'link39')" onMouseOut="HideTip('tt39')">recalculateAllSelectedDimensions</a></td><td class=SDescription>Runs recalculateDimensions on the selected elements, adding the changes to a single batch command</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.remapElement" id=link40 onMouseOver="ShowTip(event, 'tt40', 'link40')" onMouseOut="HideTip('tt40')">remapElement</a></td><td class=SDescription>Applies coordinate changes to an element based on the given matrix</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.recalculateDimensions" id=link41 onMouseOver="ShowTip(event, 'tt41', 'link41')" onMouseOut="HideTip('tt41')">recalculateDimensions</a></td><td class=SDescription>Decides the course of action based on the element&rsquo;s transform list</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.transformPoint" id=link42 onMouseOver="ShowTip(event, 'tt42', 'link42')" onMouseOut="HideTip('tt42')">transformPoint</a></td><td class=SDescription>A (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.isIdentity" id=link43 onMouseOver="ShowTip(event, 'tt43', 'link43')" onMouseOut="HideTip('tt43')">isIdentity</a></td><td class=SDescription>Helper function to check if the matrix performs no actual transform (i.e. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.matrixMultiply" id=link44 onMouseOver="ShowTip(event, 'tt44', 'link44')" onMouseOut="HideTip('tt44')">matrixMultiply</a></td><td class=SDescription>This function tries to return a SVGMatrix that is the multiplication m1*m2. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.transformListToTransform" id=link45 onMouseOver="ShowTip(event, 'tt45', 'link45')" onMouseOut="HideTip('tt45')">transformListToTransform</a></td><td class=SDescription>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</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.hasMatrixTransform" id=link46 onMouseOver="ShowTip(event, 'tt46', 'link46')" onMouseOut="HideTip('tt46')">hasMatrixTransform</a></td><td class=SDescription>See if the given transformlist includes a non-indentity matrix transform</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getMatrix" id=link47 onMouseOver="ShowTip(event, 'tt47', 'link47')" onMouseOut="HideTip('tt47')">getMatrix</a></td><td class=SDescription>Get the matrix object for a given element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.transformBox" id=link48 onMouseOver="ShowTip(event, 'tt48', 'link48')" onMouseOut="HideTip('tt48')">transformBox</a></td><td class=SDescription>Transforms a rectangle based on the given matrix</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Selection" >Selection</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.clearSelection" id=link49 onMouseOver="ShowTip(event, 'tt49', 'link49')" onMouseOut="HideTip('tt49')">clearSelection</a></td><td class=SDescription>Clears the selection. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.addToSelection" id=link50 onMouseOver="ShowTip(event, 'tt50', 'link50')" onMouseOut="HideTip('tt50')">addToSelection</a></td><td class=SDescription>Adds a list of elements to the selection. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.removeFromSelection" id=link51 onMouseOver="ShowTip(event, 'tt51', 'link51')" onMouseOut="HideTip('tt51')">removeFromSelection</a></td><td class=SDescription>Removes elements from the selection.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.selectAllInCurrentLayer" id=link52 onMouseOver="ShowTip(event, 'tt52', 'link52')" onMouseOut="HideTip('tt52')">selectAllInCurrentLayer</a></td><td class=SDescription>Clears the selection, then adds all elements in the current layer to the selection. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.smoothControlPoints" id=link53 onMouseOver="ShowTip(event, 'tt53', 'link53')" onMouseOut="HideTip('tt53')">smoothControlPoints</a></td><td class=SDescription>Takes three points and creates a smoother line based on them</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getMouseTarget" id=link54 onMouseOver="ShowTip(event, 'tt54', 'link54')" onMouseOut="HideTip('tt54')">getMouseTarget</a></td><td class=SDescription>Gets the desired element from a mouse event</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.preventClickDefault" id=link55 onMouseOver="ShowTip(event, 'tt55', 'link55')" onMouseOut="HideTip('tt55')">preventClickDefault</a></td><td class=SDescription>Prevents default browser click behaviour on the given element</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Text_edit_functions" >Text edit functions</a></td><td class=SDescription>Functions relating to editing text elements</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Path_edit_functions" >Path edit functions</a></td><td class=SDescription>Functions relating to editing path elements</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Serialization" >Serialization</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.removeUnusedDefElems" id=link56 onMouseOver="ShowTip(event, 'tt56', 'link56')" onMouseOut="HideTip('tt56')">removeUnusedDefElems</a></td><td class=SDescription>Looks at DOM elements inside the &lt;defs&gt; to see if they are referred to, removes them from the DOM if they are not.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.svgCanvasToString" id=link57 onMouseOver="ShowTip(event, 'tt57', 'link57')" onMouseOut="HideTip('tt57')">svgCanvasToString</a></td><td class=SDescription>Main function to set up the SVG content for output</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.svgToString" id=link58 onMouseOver="ShowTip(event, 'tt58', 'link58')" onMouseOut="HideTip('tt58')">svgToString</a></td><td class=SDescription>Sub function ran on each SVG element to convert it to a string as desired</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.embedImage" id=link59 onMouseOver="ShowTip(event, 'tt59', 'link59')" onMouseOut="HideTip('tt59')">embedImage</a></td><td class=SDescription>Converts a given image file to a data URL when possible, then runs a given callback</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.save" id=link60 onMouseOver="ShowTip(event, 'tt60', 'link60')" onMouseOut="HideTip('tt60')">save</a></td><td class=SDescription>Serializes the current drawing into SVG XML text and returns it to the &lsquo;saved&rsquo; handler. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.rasterExport" id=link61 onMouseOver="ShowTip(event, 'tt61', 'link61')" onMouseOut="HideTip('tt61')">rasterExport</a></td><td class=SDescription>Generates a PNG Data URL based on the current image, then calls &ldquo;exported&rdquo; with an object including the string and any issues found</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getSvgString" id=link62 onMouseOver="ShowTip(event, 'tt62', 'link62')" onMouseOut="HideTip('tt62')">getSvgString</a></td><td class=SDescription>Returns the current drawing as raw SVG XML text.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setSvgString" id=link63 onMouseOver="ShowTip(event, 'tt63', 'link63')" onMouseOut="HideTip('tt63')">setSvgString</a></td><td class=SDescription>This function sets the current drawing as the input SVG XML.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.importSvgString" id=link64 onMouseOver="ShowTip(event, 'tt64', 'link64')" onMouseOut="HideTip('tt64')">importSvgString</a></td><td class=SDescription>This function imports the input SVG XML into the current layer in the drawing</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Layers" >Layers</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.identifyLayers" id=link65 onMouseOver="ShowTip(event, 'tt65', 'link65')" onMouseOut="HideTip('tt65')">identifyLayers</a></td><td class=SDescription>Updates layer system</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.createLayer" id=link66 onMouseOver="ShowTip(event, 'tt66', 'link66')" onMouseOut="HideTip('tt66')">createLayer</a></td><td class=SDescription>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 &lsquo;changed&rsquo; handler. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.deleteCurrentLayer" id=link67 onMouseOver="ShowTip(event, 'tt67', 'link67')" onMouseOut="HideTip('tt67')">deleteCurrentLayer</a></td><td class=SDescription>Deletes the current layer from the drawing and then clears the selection. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getNumLayers" id=link68 onMouseOver="ShowTip(event, 'tt68', 'link68')" onMouseOut="HideTip('tt68')">getNumLayers</a></td><td class=SDescription>Returns the number of layers in the current drawing.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getLayer" id=link69 onMouseOver="ShowTip(event, 'tt69', 'link69')" onMouseOut="HideTip('tt69')">getLayer</a></td><td class=SDescription>Returns the name of the ith layer. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getCurrentLayer" id=link70 onMouseOver="ShowTip(event, 'tt70', 'link70')" onMouseOut="HideTip('tt70')">getCurrentLayer</a></td><td class=SDescription>Returns the name of the currently selected layer. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setCurrentLayer" id=link71 onMouseOver="ShowTip(event, 'tt71', 'link71')" onMouseOut="HideTip('tt71')">setCurrentLayer</a></td><td class=SDescription>Sets the current layer. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.renameCurrentLayer" id=link72 onMouseOver="ShowTip(event, 'tt72', 'link72')" onMouseOut="HideTip('tt72')">renameCurrentLayer</a></td><td class=SDescription>Renames the current layer. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setCurrentLayerPosition" id=link73 onMouseOver="ShowTip(event, 'tt73', 'link73')" onMouseOut="HideTip('tt73')">setCurrentLayerPosition</a></td><td class=SDescription>Changes the position of the current layer to the new value. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getLayerVisibility" id=link74 onMouseOver="ShowTip(event, 'tt74', 'link74')" onMouseOut="HideTip('tt74')">getLayerVisibility</a></td><td class=SDescription>Returns whether the layer is visible. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setLayerVisibility" id=link75 onMouseOver="ShowTip(event, 'tt75', 'link75')" onMouseOut="HideTip('tt75')">setLayerVisibility</a></td><td class=SDescription>Sets the visibility of the layer. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.moveSelectedToLayer" id=link76 onMouseOver="ShowTip(event, 'tt76', 'link76')" onMouseOut="HideTip('tt76')">moveSelectedToLayer</a></td><td class=SDescription>Moves the selected elements to layername. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getLayerOpacity" id=link77 onMouseOver="ShowTip(event, 'tt77', 'link77')" onMouseOut="HideTip('tt77')">getLayerOpacity</a></td><td class=SDescription>Returns the opacity of the given layer. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setLayerOpacity" id=link78 onMouseOver="ShowTip(event, 'tt78', 'link78')" onMouseOut="HideTip('tt78')">setLayerOpacity</a></td><td class=SDescription>Sets the opacity of the given layer. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Document_functions" >Document functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.clear" id=link79 onMouseOver="ShowTip(event, 'tt79', 'link79')" onMouseOut="HideTip('tt79')">clear</a></td><td class=SDescription>Clears the current document. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.linkControlPoints" >linkControlPoints</a></td><td class=SDescription>Alias function</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getContentElem" id=link80 onMouseOver="ShowTip(event, 'tt80', 'link80')" onMouseOut="HideTip('tt80')">getContentElem</a></td><td class=SDescription>Returns the content DOM element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getRootElem" id=link81 onMouseOver="ShowTip(event, 'tt81', 'link81')" onMouseOut="HideTip('tt81')">getRootElem</a></td><td class=SDescription>Returns the root DOM element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getSelectedElems" id=link82 onMouseOver="ShowTip(event, 'tt82', 'link82')" onMouseOut="HideTip('tt82')">getSelectedElems</a></td><td class=SDescription>Returns the array with selected DOM elements</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getResolution" id=link83 onMouseOver="ShowTip(event, 'tt83', 'link83')" onMouseOut="HideTip('tt83')">getResolution</a></td><td class=SDescription>Returns the current dimensions and zoom level in an object</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getZoom" id=link84 onMouseOver="ShowTip(event, 'tt84', 'link84')" onMouseOut="HideTip('tt84')">getZoom</a></td><td class=SDescription>Returns the current zoom level</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getVersion" id=link85 onMouseOver="ShowTip(event, 'tt85', 'link85')" onMouseOut="HideTip('tt85')">getVersion</a></td><td class=SDescription>Returns a string which describes the revision number of SvgCanvas.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setUiStrings" id=link86 onMouseOver="ShowTip(event, 'tt86', 'link86')" onMouseOut="HideTip('tt86')">setUiStrings</a></td><td class=SDescription>Update interface strings with given values</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setConfig" id=link87 onMouseOver="ShowTip(event, 'tt87', 'link87')" onMouseOut="HideTip('tt87')">setConfig</a></td><td class=SDescription>Update configuration options with given values</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getDocumentTitle" id=link88 onMouseOver="ShowTip(event, 'tt88', 'link88')" onMouseOut="HideTip('tt88')">getDocumentTitle</a></td><td class=SDescription>Returns the current document title or an empty string if not found</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setDocumentTitle" id=link89 onMouseOver="ShowTip(event, 'tt89', 'link89')" onMouseOut="HideTip('tt89')">setDocumentTitle</a></td><td class=SDescription>Adds/updates a title element for the document with the given name. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getEditorNS" id=link90 onMouseOver="ShowTip(event, 'tt90', 'link90')" onMouseOut="HideTip('tt90')">getEditorNS</a></td><td class=SDescription>Returns the editor&rsquo;s namespace URL, optionally adds it to root element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setResolution" id=link91 onMouseOver="ShowTip(event, 'tt91', 'link91')" onMouseOut="HideTip('tt91')">setResolution</a></td><td class=SDescription>Changes the document&rsquo;s dimensions to the given size</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getOffset" id=link92 onMouseOver="ShowTip(event, 'tt92', 'link92')" onMouseOut="HideTip('tt92')">getOffset</a></td><td class=SDescription>Returns an object with x, y values indicating the svgcontent element&rsquo;s position in the editor&rsquo;s canvas.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setBBoxZoom" id=link93 onMouseOver="ShowTip(event, 'tt93', 'link93')" onMouseOut="HideTip('tt93')">setBBoxZoom</a></td><td class=SDescription>Sets the zoom level on the canvas-side based on the given value</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setZoom" id=link94 onMouseOver="ShowTip(event, 'tt94', 'link94')" onMouseOut="HideTip('tt94')">setZoom</a></td><td class=SDescription>Sets the zoom to the given level</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getMode" id=link95 onMouseOver="ShowTip(event, 'tt95', 'link95')" onMouseOut="HideTip('tt95')">getMode</a></td><td class=SDescription>Returns the current editor mode string</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setMode" id=link96 onMouseOver="ShowTip(event, 'tt96', 'link96')" onMouseOut="HideTip('tt96')">setMode</a></td><td class=SDescription>Sets the editor&rsquo;s mode to the given string</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Element_Styling" >Element Styling</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getColor" id=link97 onMouseOver="ShowTip(event, 'tt97', 'link97')" onMouseOut="HideTip('tt97')">getColor</a></td><td class=SDescription>Returns the current fill/stroke option</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setColor" id=link98 onMouseOver="ShowTip(event, 'tt98', 'link98')" onMouseOut="HideTip('tt98')">setColor</a></td><td class=SDescription>Change the current stroke/fill color/gradient value</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.findDefs" id=link99 onMouseOver="ShowTip(event, 'tt99', 'link99')" onMouseOut="HideTip('tt99')">findDefs</a></td><td class=SDescription>Return the document&rsquo;s &lt;defs&gt; element, create it first if necessary</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setGradient" id=link100 onMouseOver="ShowTip(event, 'tt100', 'link100')" onMouseOut="HideTip('tt100')">setGradient</a></td><td class=SDescription>Apply the current gradient to selected element&rsquo;s fill or stroke</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.findDuplicateGradient" id=link101 onMouseOver="ShowTip(event, 'tt101', 'link101')" onMouseOut="HideTip('tt101')">findDuplicateGradient</a></td><td class=SDescription>Check if exact gradient already exists</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setPaint" id=link102 onMouseOver="ShowTip(event, 'tt102', 'link102')" onMouseOut="HideTip('tt102')">setPaint</a></td><td class=SDescription>Set a color/gradient to a fill/stroke</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getStrokeWidth" id=link103 onMouseOver="ShowTip(event, 'tt103', 'link103')" onMouseOut="HideTip('tt103')">getStrokeWidth</a></td><td class=SDescription>Returns the current stroke-width value</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setStrokeWidth" id=link104 onMouseOver="ShowTip(event, 'tt104', 'link104')" onMouseOut="HideTip('tt104')">setStrokeWidth</a></td><td class=SDescription>Sets the stroke width for the current selected elements When attempting to set a line&rsquo;s width to 0, this changes it to 1 instead</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setStrokeAttr" id=link105 onMouseOver="ShowTip(event, 'tt105', 'link105')" onMouseOut="HideTip('tt105')">setStrokeAttr</a></td><td class=SDescription>Set the given stroke-related attribute the given value for selected elements</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getOpacity" id=link106 onMouseOver="ShowTip(event, 'tt106', 'link106')" onMouseOut="HideTip('tt106')">getOpacity</a></td><td class=SDescription>Returns the current opacity</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setOpacity" id=link107 onMouseOver="ShowTip(event, 'tt107', 'link107')" onMouseOut="HideTip('tt107')">setOpacity</a></td><td class=SDescription>Sets the given opacity to the current selected elements</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.getOpacity" >getOpacity</a></td><td class=SDescription>Returns the current fill opacity</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getStrokeOpacity" id=link108 onMouseOver="ShowTip(event, 'tt108', 'link108')" onMouseOut="HideTip('tt108')">getStrokeOpacity</a></td><td class=SDescription>Returns the current stroke opacity</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setPaintOpacity" id=link109 onMouseOver="ShowTip(event, 'tt109', 'link109')" onMouseOut="HideTip('tt109')">setPaintOpacity</a></td><td class=SDescription>Sets the current fill/stroke opacity</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getBlur" id=link110 onMouseOver="ShowTip(event, 'tt110', 'link110')" onMouseOut="HideTip('tt110')">getBlur</a></td><td class=SDescription>Gets the stdDeviation blur value of the given element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setBlurNoUndo" id=link111 onMouseOver="ShowTip(event, 'tt111', 'link111')" onMouseOut="HideTip('tt111')">setBlurNoUndo</a></td><td class=SDescription>Sets the stdDeviation blur value on the selected element without being undoable</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setBlurOffsets" id=link112 onMouseOver="ShowTip(event, 'tt112', 'link112')" onMouseOut="HideTip('tt112')">setBlurOffsets</a></td><td class=SDescription>Sets the x, y, with, height values of the filter element in order to make the blur not be clipped. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setBlur" id=link113 onMouseOver="ShowTip(event, 'tt113', 'link113')" onMouseOut="HideTip('tt113')">setBlur</a></td><td class=SDescription>Adds/updates the blur filter to the selected element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getBold" id=link114 onMouseOver="ShowTip(event, 'tt114', 'link114')" onMouseOut="HideTip('tt114')">getBold</a></td><td class=SDescription>Check whether selected element is bold or not</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setBold" id=link115 onMouseOver="ShowTip(event, 'tt115', 'link115')" onMouseOut="HideTip('tt115')">setBold</a></td><td class=SDescription>Make the selected element bold or normal</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getItalic" id=link116 onMouseOver="ShowTip(event, 'tt116', 'link116')" onMouseOut="HideTip('tt116')">getItalic</a></td><td class=SDescription>Check whether selected element is italic or not</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setItalic" id=link117 onMouseOver="ShowTip(event, 'tt117', 'link117')" onMouseOut="HideTip('tt117')">setItalic</a></td><td class=SDescription>Make the selected element italic or normal</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getFontFamily" id=link118 onMouseOver="ShowTip(event, 'tt118', 'link118')" onMouseOut="HideTip('tt118')">getFontFamily</a></td><td class=SDescription>Returns the current font family</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setFontFamily" id=link119 onMouseOver="ShowTip(event, 'tt119', 'link119')" onMouseOut="HideTip('tt119')">setFontFamily</a></td><td class=SDescription>Set the new font family</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getFontSize" id=link120 onMouseOver="ShowTip(event, 'tt120', 'link120')" onMouseOut="HideTip('tt120')">getFontSize</a></td><td class=SDescription>Returns the current font size</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setFontSize" id=link121 onMouseOver="ShowTip(event, 'tt121', 'link121')" onMouseOut="HideTip('tt121')">setFontSize</a></td><td class=SDescription>Applies the given font size to the selected element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.getText" id=link122 onMouseOver="ShowTip(event, 'tt122', 'link122')" onMouseOut="HideTip('tt122')">getText</a></td><td class=SDescription>Returns the current text (textContent) of the selected element</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setTextContent" id=link123 onMouseOver="ShowTip(event, 'tt123', 'link123')" onMouseOut="HideTip('tt123')">setTextContent</a></td><td class=SDescription>Updates the text element with the given string</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setImageURL" id=link124 onMouseOver="ShowTip(event, 'tt124', 'link124')" onMouseOut="HideTip('tt124')">setImageURL</a></td><td class=SDescription>Sets the new image URL for the selected image element. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setRectRadius" id=link125 onMouseOver="ShowTip(event, 'tt125', 'link125')" onMouseOut="HideTip('tt125')">setRectRadius</a></td><td class=SDescription>Sets the rx &amp; ry values to the selected rect element to change its corner radius</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Element_manipulation" >Element manipulation</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.setSegType" id=link126 onMouseOver="ShowTip(event, 'tt126', 'link126')" onMouseOut="HideTip('tt126')">setSegType</a></td><td class=SDescription>Sets the new segment type to the selected segment(s).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.convertToPath" id=link127 onMouseOver="ShowTip(event, 'tt127', 'link127')" onMouseOut="HideTip('tt127')">convertToPath</a></td><td class=SDescription>Convert selected element to a path, or get the BBox of an element-as-path</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.changeSelectedAttributeNoUndo" id=link128 onMouseOver="ShowTip(event, 'tt128', 'link128')" onMouseOut="HideTip('tt128')">changeSelectedAttributeNoUndo</a></td><td class=SDescription>This function makes the changes to the elements. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.changeSelectedAttribute" id=link129 onMouseOver="ShowTip(event, 'tt129', 'link129')" onMouseOut="HideTip('tt129')">changeSelectedAttribute</a></td><td class=SDescription>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. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.deleteSelectedElements" id=link130 onMouseOver="ShowTip(event, 'tt130', 'link130')" onMouseOut="HideTip('tt130')">deleteSelectedElements</a></td><td class=SDescription>Removes all selected elements from the DOM and adds the change to the history stack</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.groupSelectedElements" id=link131 onMouseOver="ShowTip(event, 'tt131', 'link131')" onMouseOut="HideTip('tt131')">groupSelectedElements</a></td><td class=SDescription>Wraps all the selected elements in a group (g) element</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.ungroupSelectedElement" id=link132 onMouseOver="ShowTip(event, 'tt132', 'link132')" onMouseOut="HideTip('tt132')">ungroupSelectedElement</a></td><td class=SDescription>Unwraps all the elements in a selected group (g) element. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.moveToTopSelectedElement" id=link133 onMouseOver="ShowTip(event, 'tt133', 'link133')" onMouseOut="HideTip('tt133')">moveToTopSelectedElement</a></td><td class=SDescription>Repositions the selected element to the bottom in the DOM to appear on top of other elements</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.moveToBottomSelectedElement" id=link134 onMouseOver="ShowTip(event, 'tt134', 'link134')" onMouseOut="HideTip('tt134')">moveToBottomSelectedElement</a></td><td class=SDescription>Repositions the selected element to the top in the DOM to appear under other elements</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.moveSelectedElements" id=link135 onMouseOver="ShowTip(event, 'tt135', 'link135')" onMouseOut="HideTip('tt135')">moveSelectedElements</a></td><td class=SDescription>Moves selected elements on the X/Y axis</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.cloneSelectedElements" id=link136 onMouseOver="ShowTip(event, 'tt136', 'link136')" onMouseOut="HideTip('tt136')">cloneSelectedElements</a></td><td class=SDescription>Create deep DOM copies (clones) of all selected elements and move them slightly from their originals</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.alignSelectedElements" id=link137 onMouseOver="ShowTip(event, 'tt137', 'link137')" onMouseOut="HideTip('tt137')">alignSelectedElements</a></td><td class=SDescription>Aligns selected elements</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SelectorManager.Additional_editor_tools" >Additional editor tools</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.updateCanvas" id=link138 onMouseOver="ShowTip(event, 'tt138', 'link138')" onMouseOut="HideTip('tt138')">updateCanvas</a></td><td class=SDescription>Updates the editor canvas width/height/position after a zoom has occurred</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SelectorManager.setBackground" id=link139 onMouseOver="ShowTip(event, 'tt139', 'link139')" onMouseOut="HideTip('tt139')">setBackground</a></td><td class=SDescription>Set the background of the editor (NOT the actual document)</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SelectorManager.cycleElement" id=link140 onMouseOver="ShowTip(event, 'tt140', 'link140')" onMouseOut="HideTip('tt140')">cycleElement</a></td><td class=SDescription>Select the next/previous element within the current layer</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Utils.toXml"></a>Utils.<wbr>toXml</h3><div class=CBody><p>Converts characters in a string to XML-friendly entities.</p><p>Example: &ldquo;&amp;&rdquo; becomes &ldquo;&amp;amp;&rdquo;</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>str</td><td class=CDLDescription>The string to be converted</td></tr></table><h4 class=CHeading>Returns</h4><p>The converted string</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Utils.fromXml"></a>Utils.<wbr>fromXml</h3><div class=CBody><p>Converts XML entities in a string to single characters.&nbsp; Example: &ldquo;&amp;amp;&rdquo; becomes &ldquo;&amp;&rdquo;</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>str</td><td class=CDLDescription>The string to be converted</td></tr></table><h4 class=CHeading>Returns</h4><p>The converted string</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Utils.encode64"></a>Utils.<wbr>encode64</h3><div class=CBody><p>Converts a string to base64</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Utils.decode64"></a>Utils.<wbr>decode64</h3><div class=CBody><p>Converts a string from base64</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Utils.convertToXMLReferences"></a>Utils.<wbr>convertToXMLReferences</h3><div class=CBody><p>Converts a string to use XML references</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.rectsIntersect"></a>rectsIntersect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>&quot;rectsIntersect&quot;: function(</td><td class=PParameter nowrap>r1,</td></tr><tr><td></td><td class=PParameter nowrap>r2</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if two rectangles (BBoxes objects) intersect each other</p><h4 class=CHeading>Paramaters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>r1</td><td class=CDLDescription>The first BBox-like object</td></tr><tr><td class=CDLEntry>r2</td><td class=CDLDescription>The second BBox-like object</td></tr></table><h4 class=CHeading>Returns</h4><p>Boolean that&rsquo;s true if rectangles intersect</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.snapToAngle"></a>snapToAngle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>&quot;snapToAngle&quot;: function(</td><td class=PParameter nowrap>x1,</td></tr><tr><td></td><td class=PParameter nowrap>y1,</td></tr><tr><td></td><td class=PParameter nowrap>x2,</td></tr><tr><td></td><td class=PParameter nowrap>y2</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a 45 degree angle coordinate associated with the two given coordinates</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x1</td><td class=CDLDescription>First coordinate&rsquo;s x value</td></tr><tr><td class=CDLEntry>x2</td><td class=CDLDescription>Second coordinate&rsquo;s x value</td></tr><tr><td class=CDLEntry>y1</td><td class=CDLDescription>First coordinate&rsquo;s y value</td></tr><tr><td class=CDLEntry>y2</td><td class=CDLDescription>Second coordinate&rsquo;s y value</td></tr></table><h4 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.text2xml"></a>text2xml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>&quot;text2xml&quot;: function(</td><td class=PParameter nowrap>sXML</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Cross-browser compatible method of converting a string to an XML tree found this function here: <a href="http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f" class=LURL target=_top>http://groups.google.com<wbr>/group<wbr>/jquery-dev<wbr>/browse_thread<wbr>/thread<wbr>/c6d11387c580a77f</a></p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Unit_conversion_functions"></a>Unit conversion functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.convertToNum"></a>convertToNum</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>convertToNum = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts given values to numbers.&nbsp; Attributes must be supplied in case a percentage is given</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attr</td><td class=CDLDescription>String with the name of the attribute associated with the value</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the attribute value to convert</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.setUnitAttr"></a>setUnitAttr</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setUnitAttr = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets an element&rsquo;s attribute based on the unit in its current value.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element to be changed</td></tr><tr><td class=CDLEntry>attr</td><td class=CDLDescription>String with the name of the attribute associated with the value</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the attribute value to convert</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.isValidUnit"></a>isValidUnit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.isValidUnit = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if an attribute&rsquo;s value is in a valid format</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attr</td><td class=CDLDescription>String with the name of the attribute associated with the value</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the attribute value to check</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.Undo/Redo_history_management"></a>Undo/<wbr>Redo history management</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.ChangeElementCommand"></a>ChangeElementCommand</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var ChangeElementCommand = this.undoCmd.changeElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>attrs,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>History command to make a change to an element.&nbsp; Usually an attribute change, but can also be textcontent.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The DOM element that was changed</td></tr><tr><td class=CDLEntry>attrs</td><td class=CDLDescription>An object with the attributes to be changed and the values they had <b>before</b> the change</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.ChangeElementCommand.apply"></a>ChangeElementCommand.<wbr>apply</h3><div class=CBody><p>Performs the stored change action</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.ChangeElementCommand.unapply"></a>ChangeElementCommand.<wbr>unapply</h3><div class=CBody><p>Reverses the stored change action</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.ChangeElementCommand.elements"></a>ChangeElementCommand.<wbr>elements</h3><div class=CBody><p>Returns array with element associated with this command</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.InsertElementCommand"></a>InsertElementCommand</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var InsertElementCommand = this.undoCmd.insertElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>History command for an element that was added to the DOM</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The newly added DOM element</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.InsertElementCommand.apply"></a>InsertElementCommand.<wbr>apply</h3><div class=CBody><p>Re-Inserts the new element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.InsertElementCommand.unapply"></a>InsertElementCommand.<wbr>unapply</h3><div class=CBody><p>Removes the element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.InsertElementCommand.elements"></a>InsertElementCommand.<wbr>elements</h3><div class=CBody><p>Returns array with element associated with this command</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.RemoveElementCommand"></a>RemoveElementCommand</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var RemoveElementCommand = this.undoCmd.removeElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>History command for an element removed from the DOM</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The removed DOM element</td></tr><tr><td class=CDLEntry>parent</td><td class=CDLDescription>The DOM element&rsquo;s parent</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.RemoveElementCommand.apply"></a>RemoveElementCommand.<wbr>apply</h3><div class=CBody><p>Re-removes the new element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.RemoveElementCommand.unapply"></a>RemoveElementCommand.<wbr>unapply</h3><div class=CBody><p>Re-adds the new element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.RemoveElementCommand.elements"></a>RemoveElementCommand.<wbr>elements</h3><div class=CBody><p>Returns array with element associated with this command</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.MoveElementCommand"></a>MoveElementCommand</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var MoveElementCommand = this.undoCmd.moveElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>oldNextSibling,</td></tr><tr><td></td><td class=PParameter nowrap>oldParent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>History command for an element that had its DOM position changed</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The DOM element that was moved</td></tr><tr><td class=CDLEntry>oldNextSibling</td><td class=CDLDescription>The element&rsquo;s next sibling before it was moved</td></tr><tr><td class=CDLEntry>oldParent</td><td class=CDLDescription>The element&rsquo;s parent before it was moved</td></tr><tr><td class=CDLEntry>text</td><td class=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.MoveElementCommand.unapply"></a>MoveElementCommand.<wbr>unapply</h3><div class=CBody><p>Re-positions the element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.MoveElementCommand.unapply"></a>MoveElementCommand.<wbr>unapply</h3><div class=CBody><p>Positions the element back to its original location</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.MoveElementCommand.elements"></a>MoveElementCommand.<wbr>elements</h3><div class=CBody><p>Returns array with element associated with this command</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.BatchCommand"></a>BatchCommand</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var BatchCommand = this.undoCmd.batch = function(</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>History command that can contain/execute multiple other commands</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>text</td><td class=CDLDescription>An optional string visible to user related to this change</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.BatchCommand.apply"></a>BatchCommand.<wbr>apply</h3><div class=CBody><p>Runs &ldquo;apply&rdquo; on all subcommands</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.BatchCommand.unapply"></a>BatchCommand.<wbr>unapply</h3><div class=CBody><p>Runs &ldquo;unapply&rdquo; on all subcommands</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.BatchCommand.elements"></a>BatchCommand.<wbr>elements</h3><div class=CBody><p>Iterate through all our subcommands and returns all the elements we are changing</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.BatchCommand.addSubCommand"></a>BatchCommand.<wbr>addSubCommand</h3><div class=CBody><p>Adds a given command to the history stack</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>cmd</td><td class=CDLDescription>The undo command object to add</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.BatchCommand.isEmpty"></a>BatchCommand.<wbr>isEmpty</h3><div class=CBody><p>Returns a boolean indicating whether or not the batch command is empty</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.resetUndoStack"></a>resetUndoStack</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>resetUndoStack = function()</td></tr></table></blockquote><p>Resets the undo stack, effectively clearing the undo/redo history</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.undoMgr.getUndoStackSize"></a>undoMgr.<wbr>getUndoStackSize</h3><div class=CBody><h4 class=CHeading>Returns</h4><p>Integer with the current size of the undo history stack</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.undoMgr.getRedoStackSize"></a>undoMgr.<wbr>getRedoStackSize</h3><div class=CBody><h4 class=CHeading>Returns</h4><p>Integer with the current size of the redo history stack</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.undoMgr.getNextUndoCommandText"></a>undoMgr.<wbr>getNextUndoCommandText</h3><div class=CBody><h4 class=CHeading>Returns</h4><p>String associated with the next undo command</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.undoMgr.getNextRedoCommandText"></a>undoMgr.<wbr>getNextRedoCommandText</h3><div class=CBody><h4 class=CHeading>Returns</h4><p>String associated with the next redo command</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.undoMgr.undo"></a>undoMgr.undo</h3><div class=CBody><p>Performs an undo step</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.undoMgr.redo"></a>undoMgr.redo</h3><div class=CBody><p>Performs a redo step</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.addCommandToHistory"></a>addCommandToHistory</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addCommandToHistory = c.undoCmd.add = function(</td><td class=PParameter nowrap>cmd</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a command object to the undo history stack</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>cmd</td><td class=CDLDescription>The command object to add</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.beginUndoableChange"></a>beginUndoableChange</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c.beginUndoableChange = function(</td><td class=PParameter nowrap>attrName,</td></tr><tr><td></td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</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.&nbsp;  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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attrName</td><td class=CDLDescription>The name of the attribute being changed</td></tr><tr><td class=CDLEntry>elems</td><td class=CDLDescription>Array of DOM elements being changed</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SvgCanvas.finishUndoableChange"></a>finishUndoableChange</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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.&nbsp;  The command can then be added to the command history</p><h4 class=CHeading>Returns</h4><p>Batch command object with resulting changes</p></div></div></div>

<div class="CInterface"><div class=CTopic><h2 class=CTitle><a name="Selector"></a>Selector</h2><div class=CBody><p>Private class for DOM element selection boxes</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>integer to internally indentify the selector</td></tr><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element associated with this selector</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Selector.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Selector.Selector.reset" >Selector.<wbr>reset</a></td><td class=SDescription>Used to reset the id and element that the selector is attached to</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Selector.Selector.showGrips" >Selector.<wbr>showGrips</a></td><td class=SDescription>Show the resize grips of this selector</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Selector.Selector.updateGripCursors" >Selector.<wbr>updateGripCursors</a></td><td class=SDescription>Updates cursors for corner grips on rotation so arrows point the right way</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Selector.Selector.resize" >Selector.<wbr>resize</a></td><td class=SDescription>Updates the selector to match the element&rsquo;s size</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Selector.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Selector.Selector.reset"></a>Selector.<wbr>reset</h3><div class=CBody><p>Used to reset the id and element that the selector is attached to</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>DOM element associated with this selector</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Selector.Selector.showGrips"></a>Selector.<wbr>showGrips</h3><div class=CBody><p>Show the resize grips of this selector</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>show</td><td class=CDLDescription>boolean indicating whether grips should be shown or not</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Selector.Selector.updateGripCursors"></a>Selector.<wbr>updateGripCursors</h3><div class=CBody><p>Updates cursors for corner grips on rotation so arrows point the right way</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>angle</td><td class=CDLDescription>Float indicating current rotation angle in degrees</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Selector.Selector.resize"></a>Selector.<wbr>resize</h3><div class=CBody><p>Updates the selector to match the element&rsquo;s size</p></div></div></div>

<div class="CInterface"><div class=CTopic><h2 class=CTitle><a name="SelectorManager"></a>SelectorManager</h2><div class=CBody><p>Public class to manage all selector objects (selection boxes)</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SFunction"><td class=SEntry><a href="#SelectorManager.SelectorManager.initGroup" >SelectorManager.<wbr>initGroup</a></td><td class=SDescription>Resets the parent selector group element</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#SelectorManager.SelectorManager.requestSelector" >SelectorManager.<wbr>requestSelector</a></td><td class=SDescription>Returns the selector based on the given element</td></tr><tr class="SFunction"><td class=SEntry><a href="#SelectorManager.SelectorManager.releaseSelector" >SelectorManager.<wbr>releaseSelector</a></td><td class=SDescription>Removes the selector of the given element (hides selection box)</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#SelectorManager.SelectorManager.getRubberBandBox" >SelectorManager.<wbr>getRubberBandBox</a></td><td class=SDescription>Returns the rubberBandBox DOM element. </td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Helper_functions" >Helper functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.walkTree" id=link141 onMouseOver="ShowTip(event, 'tt16', 'link141')" onMouseOut="HideTip('tt16')">walkTree</a></td><td class=SDescription>Walks the tree and executes the callback on each element in a top-down fashion</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.walkTreePost" id=link142 onMouseOver="ShowTip(event, 'tt17', 'link142')" onMouseOut="HideTip('tt17')">walkTreePost</a></td><td class=SDescription>Walks the tree and executes the callback on each element in a depth-first fashion</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.assignAttributes" id=link143 onMouseOver="ShowTip(event, 'tt18', 'link143')" onMouseOut="HideTip('tt18')">assignAttributes</a></td><td class=SDescription>Assigns multiple attributes to an element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.cleanupElement" id=link144 onMouseOver="ShowTip(event, 'tt19', 'link144')" onMouseOut="HideTip('tt19')">cleanupElement</a></td><td class=SDescription>Remove unneeded (default) attributes, makes resulting SVG smaller</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.addSvgElementFromJson" id=link145 onMouseOver="ShowTip(event, 'tt20', 'link145')" onMouseOut="HideTip('tt20')">addSvgElementFromJson</a></td><td class=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><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.addExtension" id=link146 onMouseOver="ShowTip(event, 'tt21', 'link146')" onMouseOut="HideTip('tt21')">addExtension</a></td><td class=SDescription>Add an extension to the editor</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.shortFloat" id=link147 onMouseOver="ShowTip(event, 'tt22', 'link147')" onMouseOut="HideTip('tt22')">shortFloat</a></td><td class=SDescription>Rounds a given value to a float with number of digits defined in save_options</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getStrokedBBox" id=link148 onMouseOver="ShowTip(event, 'tt23', 'link148')" onMouseOut="HideTip('tt23')">getStrokedBBox</a></td><td class=SDescription>Get the bounding box for one or more stroked and/or transformed elements</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getVisibleElements" id=link149 onMouseOver="ShowTip(event, 'tt24', 'link149')" onMouseOut="HideTip('tt24')">getVisibleElements</a></td><td class=SDescription>Get all elements that have a BBox (excludes &lt;defs&gt;, &lt;title&gt;, etc). </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.copyElem" id=link150 onMouseOver="ShowTip(event, 'tt25', 'link150')" onMouseOut="HideTip('tt25')">copyElem</a></td><td class=SDescription>Create a clone of an element, updating its ID and its children&rsquo;s IDs when needed</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getElem" id=link151 onMouseOver="ShowTip(event, 'tt26', 'link151')" onMouseOut="HideTip('tt26')">getElem</a></td><td class=SDescription>Get a DOM element by ID within the SVG root element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getId" id=link152 onMouseOver="ShowTip(event, 'tt27', 'link152')" onMouseOut="HideTip('tt27')">getId</a></td><td class=SDescription>Returns the last created DOM element ID string</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getNextId" id=link153 onMouseOver="ShowTip(event, 'tt28', 'link153')" onMouseOut="HideTip('tt28')">getNextId</a></td><td class=SDescription>Creates and returns a unique ID string for a DOM element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.bind" id=link154 onMouseOver="ShowTip(event, 'tt29', 'link154')" onMouseOut="HideTip('tt29')">bind</a></td><td class=SDescription>Attaches a callback function to an event</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setIdPrefix" id=link155 onMouseOver="ShowTip(event, 'tt30', 'link155')" onMouseOut="HideTip('tt30')">setIdPrefix</a></td><td class=SDescription>Changes the ID prefix to the given value</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.sanitizeSvg" id=link156 onMouseOver="ShowTip(event, 'tt31', 'link156')" onMouseOut="HideTip('tt31')">sanitizeSvg</a></td><td class=SDescription>Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getUrlFromAttr" id=link157 onMouseOver="ShowTip(event, 'tt32', 'link157')" onMouseOut="HideTip('tt32')">getUrlFromAttr</a></td><td class=SDescription>Extracts the URL from the url(...)</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getBBox" id=link158 onMouseOver="ShowTip(event, 'tt33', 'link158')" onMouseOut="HideTip('tt33')">getBBox</a></td><td class=SDescription>Get the given/selected element&rsquo;s bounding box object, convert it to be more usable when necessary</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.ffClone" id=link159 onMouseOver="ShowTip(event, 'tt34', 'link159')" onMouseOut="HideTip('tt34')">ffClone</a></td><td class=SDescription>Hack for Firefox bugs where text element features aren&rsquo;t updated. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getPathBBox" id=link160 onMouseOver="ShowTip(event, 'tt35', 'link160')" onMouseOut="HideTip('tt35')">getPathBBox</a></td><td class=SDescription>Get correct BBox for a path in Webkit Converted from code found here: <a href="http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html" class=LURL target=_top>http://blog.hackers-cafe.net<wbr>/2009<wbr>/06<wbr>/how-to-calculate-bezier-curves-bounding.html</a></td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Element_Transforms" >Element Transforms</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getRotationAngle" id=link161 onMouseOver="ShowTip(event, 'tt36', 'link161')" onMouseOut="HideTip('tt36')">getRotationAngle</a></td><td class=SDescription>Get the rotation angle of the given/selected DOM element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setRotationAngle" id=link162 onMouseOver="ShowTip(event, 'tt37', 'link162')" onMouseOut="HideTip('tt37')">setRotationAngle</a></td><td class=SDescription>Removes any old rotations if present, prepends a new rotation at the transformed center</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getTransformList" id=link163 onMouseOver="ShowTip(event, 'tt38', 'link163')" onMouseOut="HideTip('tt38')">getTransformList</a></td><td class=SDescription>Returns an object that behaves like a SVGTransformList for the given DOM element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.recalculateAllSelectedDimensions" id=link164 onMouseOver="ShowTip(event, 'tt39', 'link164')" onMouseOut="HideTip('tt39')">recalculateAllSelectedDimensions</a></td><td class=SDescription>Runs recalculateDimensions on the selected elements, adding the changes to a single batch command</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.remapElement" id=link165 onMouseOver="ShowTip(event, 'tt40', 'link165')" onMouseOut="HideTip('tt40')">remapElement</a></td><td class=SDescription>Applies coordinate changes to an element based on the given matrix</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.recalculateDimensions" id=link166 onMouseOver="ShowTip(event, 'tt41', 'link166')" onMouseOut="HideTip('tt41')">recalculateDimensions</a></td><td class=SDescription>Decides the course of action based on the element&rsquo;s transform list</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.transformPoint" id=link167 onMouseOver="ShowTip(event, 'tt42', 'link167')" onMouseOut="HideTip('tt42')">transformPoint</a></td><td class=SDescription>A (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.isIdentity" id=link168 onMouseOver="ShowTip(event, 'tt43', 'link168')" onMouseOut="HideTip('tt43')">isIdentity</a></td><td class=SDescription>Helper function to check if the matrix performs no actual transform (i.e. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.matrixMultiply" id=link169 onMouseOver="ShowTip(event, 'tt44', 'link169')" onMouseOut="HideTip('tt44')">matrixMultiply</a></td><td class=SDescription>This function tries to return a SVGMatrix that is the multiplication m1*m2. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.transformListToTransform" id=link170 onMouseOver="ShowTip(event, 'tt45', 'link170')" onMouseOut="HideTip('tt45')">transformListToTransform</a></td><td class=SDescription>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</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.hasMatrixTransform" id=link171 onMouseOver="ShowTip(event, 'tt46', 'link171')" onMouseOut="HideTip('tt46')">hasMatrixTransform</a></td><td class=SDescription>See if the given transformlist includes a non-indentity matrix transform</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getMatrix" id=link172 onMouseOver="ShowTip(event, 'tt47', 'link172')" onMouseOut="HideTip('tt47')">getMatrix</a></td><td class=SDescription>Get the matrix object for a given element</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.transformBox" id=link173 onMouseOver="ShowTip(event, 'tt48', 'link173')" onMouseOut="HideTip('tt48')">transformBox</a></td><td class=SDescription>Transforms a rectangle based on the given matrix</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Selection" >Selection</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.clearSelection" id=link174 onMouseOver="ShowTip(event, 'tt49', 'link174')" onMouseOut="HideTip('tt49')">clearSelection</a></td><td class=SDescription>Clears the selection. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.addToSelection" id=link175 onMouseOver="ShowTip(event, 'tt50', 'link175')" onMouseOut="HideTip('tt50')">addToSelection</a></td><td class=SDescription>Adds a list of elements to the selection. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.removeFromSelection" id=link176 onMouseOver="ShowTip(event, 'tt51', 'link176')" onMouseOut="HideTip('tt51')">removeFromSelection</a></td><td class=SDescription>Removes elements from the selection.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.selectAllInCurrentLayer" id=link177 onMouseOver="ShowTip(event, 'tt52', 'link177')" onMouseOut="HideTip('tt52')">selectAllInCurrentLayer</a></td><td class=SDescription>Clears the selection, then adds all elements in the current layer to the selection. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.smoothControlPoints" id=link178 onMouseOver="ShowTip(event, 'tt53', 'link178')" onMouseOut="HideTip('tt53')">smoothControlPoints</a></td><td class=SDescription>Takes three points and creates a smoother line based on them</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getMouseTarget" id=link179 onMouseOver="ShowTip(event, 'tt54', 'link179')" onMouseOut="HideTip('tt54')">getMouseTarget</a></td><td class=SDescription>Gets the desired element from a mouse event</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.preventClickDefault" id=link180 onMouseOver="ShowTip(event, 'tt55', 'link180')" onMouseOut="HideTip('tt55')">preventClickDefault</a></td><td class=SDescription>Prevents default browser click behaviour on the given element</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Text_edit_functions" >Text edit functions</a></td><td class=SDescription>Functions relating to editing text elements</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Path_edit_functions" >Path edit functions</a></td><td class=SDescription>Functions relating to editing path elements</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Serialization" >Serialization</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.removeUnusedDefElems" id=link181 onMouseOver="ShowTip(event, 'tt56', 'link181')" onMouseOut="HideTip('tt56')">removeUnusedDefElems</a></td><td class=SDescription>Looks at DOM elements inside the &lt;defs&gt; to see if they are referred to, removes them from the DOM if they are not.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.svgCanvasToString" id=link182 onMouseOver="ShowTip(event, 'tt57', 'link182')" onMouseOut="HideTip('tt57')">svgCanvasToString</a></td><td class=SDescription>Main function to set up the SVG content for output</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.svgToString" id=link183 onMouseOver="ShowTip(event, 'tt58', 'link183')" onMouseOut="HideTip('tt58')">svgToString</a></td><td class=SDescription>Sub function ran on each SVG element to convert it to a string as desired</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.embedImage" id=link184 onMouseOver="ShowTip(event, 'tt59', 'link184')" onMouseOut="HideTip('tt59')">embedImage</a></td><td class=SDescription>Converts a given image file to a data URL when possible, then runs a given callback</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.save" id=link185 onMouseOver="ShowTip(event, 'tt60', 'link185')" onMouseOut="HideTip('tt60')">save</a></td><td class=SDescription>Serializes the current drawing into SVG XML text and returns it to the &lsquo;saved&rsquo; handler. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.rasterExport" id=link186 onMouseOver="ShowTip(event, 'tt61', 'link186')" onMouseOut="HideTip('tt61')">rasterExport</a></td><td class=SDescription>Generates a PNG Data URL based on the current image, then calls &ldquo;exported&rdquo; with an object including the string and any issues found</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getSvgString" id=link187 onMouseOver="ShowTip(event, 'tt62', 'link187')" onMouseOut="HideTip('tt62')">getSvgString</a></td><td class=SDescription>Returns the current drawing as raw SVG XML text.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setSvgString" id=link188 onMouseOver="ShowTip(event, 'tt63', 'link188')" onMouseOut="HideTip('tt63')">setSvgString</a></td><td class=SDescription>This function sets the current drawing as the input SVG XML.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.importSvgString" id=link189 onMouseOver="ShowTip(event, 'tt64', 'link189')" onMouseOut="HideTip('tt64')">importSvgString</a></td><td class=SDescription>This function imports the input SVG XML into the current layer in the drawing</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Layers" >Layers</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.identifyLayers" id=link190 onMouseOver="ShowTip(event, 'tt65', 'link190')" onMouseOut="HideTip('tt65')">identifyLayers</a></td><td class=SDescription>Updates layer system</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.createLayer" id=link191 onMouseOver="ShowTip(event, 'tt66', 'link191')" onMouseOut="HideTip('tt66')">createLayer</a></td><td class=SDescription>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 &lsquo;changed&rsquo; handler. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.deleteCurrentLayer" id=link192 onMouseOver="ShowTip(event, 'tt67', 'link192')" onMouseOut="HideTip('tt67')">deleteCurrentLayer</a></td><td class=SDescription>Deletes the current layer from the drawing and then clears the selection. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getNumLayers" id=link193 onMouseOver="ShowTip(event, 'tt68', 'link193')" onMouseOut="HideTip('tt68')">getNumLayers</a></td><td class=SDescription>Returns the number of layers in the current drawing.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getLayer" id=link194 onMouseOver="ShowTip(event, 'tt69', 'link194')" onMouseOut="HideTip('tt69')">getLayer</a></td><td class=SDescription>Returns the name of the ith layer. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getCurrentLayer" id=link195 onMouseOver="ShowTip(event, 'tt70', 'link195')" onMouseOut="HideTip('tt70')">getCurrentLayer</a></td><td class=SDescription>Returns the name of the currently selected layer. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setCurrentLayer" id=link196 onMouseOver="ShowTip(event, 'tt71', 'link196')" onMouseOut="HideTip('tt71')">setCurrentLayer</a></td><td class=SDescription>Sets the current layer. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.renameCurrentLayer" id=link197 onMouseOver="ShowTip(event, 'tt72', 'link197')" onMouseOut="HideTip('tt72')">renameCurrentLayer</a></td><td class=SDescription>Renames the current layer. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setCurrentLayerPosition" id=link198 onMouseOver="ShowTip(event, 'tt73', 'link198')" onMouseOut="HideTip('tt73')">setCurrentLayerPosition</a></td><td class=SDescription>Changes the position of the current layer to the new value. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getLayerVisibility" id=link199 onMouseOver="ShowTip(event, 'tt74', 'link199')" onMouseOut="HideTip('tt74')">getLayerVisibility</a></td><td class=SDescription>Returns whether the layer is visible. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setLayerVisibility" id=link200 onMouseOver="ShowTip(event, 'tt75', 'link200')" onMouseOut="HideTip('tt75')">setLayerVisibility</a></td><td class=SDescription>Sets the visibility of the layer. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.moveSelectedToLayer" id=link201 onMouseOver="ShowTip(event, 'tt76', 'link201')" onMouseOut="HideTip('tt76')">moveSelectedToLayer</a></td><td class=SDescription>Moves the selected elements to layername. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getLayerOpacity" id=link202 onMouseOver="ShowTip(event, 'tt77', 'link202')" onMouseOut="HideTip('tt77')">getLayerOpacity</a></td><td class=SDescription>Returns the opacity of the given layer. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setLayerOpacity" id=link203 onMouseOver="ShowTip(event, 'tt78', 'link203')" onMouseOut="HideTip('tt78')">setLayerOpacity</a></td><td class=SDescription>Sets the opacity of the given layer. </td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Document_functions" >Document functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.clear" id=link204 onMouseOver="ShowTip(event, 'tt79', 'link204')" onMouseOut="HideTip('tt79')">clear</a></td><td class=SDescription>Clears the current document. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.linkControlPoints" >linkControlPoints</a></td><td class=SDescription>Alias function</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getContentElem" id=link205 onMouseOver="ShowTip(event, 'tt80', 'link205')" onMouseOut="HideTip('tt80')">getContentElem</a></td><td class=SDescription>Returns the content DOM element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getRootElem" id=link206 onMouseOver="ShowTip(event, 'tt81', 'link206')" onMouseOut="HideTip('tt81')">getRootElem</a></td><td class=SDescription>Returns the root DOM element</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getSelectedElems" id=link207 onMouseOver="ShowTip(event, 'tt82', 'link207')" onMouseOut="HideTip('tt82')">getSelectedElems</a></td><td class=SDescription>Returns the array with selected DOM elements</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getResolution" id=link208 onMouseOver="ShowTip(event, 'tt83', 'link208')" onMouseOut="HideTip('tt83')">getResolution</a></td><td class=SDescription>Returns the current dimensions and zoom level in an object</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getZoom" id=link209 onMouseOver="ShowTip(event, 'tt84', 'link209')" onMouseOut="HideTip('tt84')">getZoom</a></td><td class=SDescription>Returns the current zoom level</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getVersion" id=link210 onMouseOver="ShowTip(event, 'tt85', 'link210')" onMouseOut="HideTip('tt85')">getVersion</a></td><td class=SDescription>Returns a string which describes the revision number of SvgCanvas.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setUiStrings" id=link211 onMouseOver="ShowTip(event, 'tt86', 'link211')" onMouseOut="HideTip('tt86')">setUiStrings</a></td><td class=SDescription>Update interface strings with given values</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setConfig" id=link212 onMouseOver="ShowTip(event, 'tt87', 'link212')" onMouseOut="HideTip('tt87')">setConfig</a></td><td class=SDescription>Update configuration options with given values</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getDocumentTitle" id=link213 onMouseOver="ShowTip(event, 'tt88', 'link213')" onMouseOut="HideTip('tt88')">getDocumentTitle</a></td><td class=SDescription>Returns the current document title or an empty string if not found</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setDocumentTitle" id=link214 onMouseOver="ShowTip(event, 'tt89', 'link214')" onMouseOut="HideTip('tt89')">setDocumentTitle</a></td><td class=SDescription>Adds/updates a title element for the document with the given name. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getEditorNS" id=link215 onMouseOver="ShowTip(event, 'tt90', 'link215')" onMouseOut="HideTip('tt90')">getEditorNS</a></td><td class=SDescription>Returns the editor&rsquo;s namespace URL, optionally adds it to root element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setResolution" id=link216 onMouseOver="ShowTip(event, 'tt91', 'link216')" onMouseOut="HideTip('tt91')">setResolution</a></td><td class=SDescription>Changes the document&rsquo;s dimensions to the given size</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getOffset" id=link217 onMouseOver="ShowTip(event, 'tt92', 'link217')" onMouseOut="HideTip('tt92')">getOffset</a></td><td class=SDescription>Returns an object with x, y values indicating the svgcontent element&rsquo;s position in the editor&rsquo;s canvas.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setBBoxZoom" id=link218 onMouseOver="ShowTip(event, 'tt93', 'link218')" onMouseOut="HideTip('tt93')">setBBoxZoom</a></td><td class=SDescription>Sets the zoom level on the canvas-side based on the given value</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setZoom" id=link219 onMouseOver="ShowTip(event, 'tt94', 'link219')" onMouseOut="HideTip('tt94')">setZoom</a></td><td class=SDescription>Sets the zoom to the given level</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getMode" id=link220 onMouseOver="ShowTip(event, 'tt95', 'link220')" onMouseOut="HideTip('tt95')">getMode</a></td><td class=SDescription>Returns the current editor mode string</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setMode" id=link221 onMouseOver="ShowTip(event, 'tt96', 'link221')" onMouseOut="HideTip('tt96')">setMode</a></td><td class=SDescription>Sets the editor&rsquo;s mode to the given string</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Element_Styling" >Element Styling</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getColor" id=link222 onMouseOver="ShowTip(event, 'tt97', 'link222')" onMouseOut="HideTip('tt97')">getColor</a></td><td class=SDescription>Returns the current fill/stroke option</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setColor" id=link223 onMouseOver="ShowTip(event, 'tt98', 'link223')" onMouseOut="HideTip('tt98')">setColor</a></td><td class=SDescription>Change the current stroke/fill color/gradient value</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.findDefs" id=link224 onMouseOver="ShowTip(event, 'tt99', 'link224')" onMouseOut="HideTip('tt99')">findDefs</a></td><td class=SDescription>Return the document&rsquo;s &lt;defs&gt; element, create it first if necessary</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setGradient" id=link225 onMouseOver="ShowTip(event, 'tt100', 'link225')" onMouseOut="HideTip('tt100')">setGradient</a></td><td class=SDescription>Apply the current gradient to selected element&rsquo;s fill or stroke</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.findDuplicateGradient" id=link226 onMouseOver="ShowTip(event, 'tt101', 'link226')" onMouseOut="HideTip('tt101')">findDuplicateGradient</a></td><td class=SDescription>Check if exact gradient already exists</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setPaint" id=link227 onMouseOver="ShowTip(event, 'tt102', 'link227')" onMouseOut="HideTip('tt102')">setPaint</a></td><td class=SDescription>Set a color/gradient to a fill/stroke</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getStrokeWidth" id=link228 onMouseOver="ShowTip(event, 'tt103', 'link228')" onMouseOut="HideTip('tt103')">getStrokeWidth</a></td><td class=SDescription>Returns the current stroke-width value</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setStrokeWidth" id=link229 onMouseOver="ShowTip(event, 'tt104', 'link229')" onMouseOut="HideTip('tt104')">setStrokeWidth</a></td><td class=SDescription>Sets the stroke width for the current selected elements When attempting to set a line&rsquo;s width to 0, this changes it to 1 instead</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setStrokeAttr" id=link230 onMouseOver="ShowTip(event, 'tt105', 'link230')" onMouseOut="HideTip('tt105')">setStrokeAttr</a></td><td class=SDescription>Set the given stroke-related attribute the given value for selected elements</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getOpacity" id=link231 onMouseOver="ShowTip(event, 'tt106', 'link231')" onMouseOut="HideTip('tt106')">getOpacity</a></td><td class=SDescription>Returns the current opacity</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setOpacity" id=link232 onMouseOver="ShowTip(event, 'tt107', 'link232')" onMouseOut="HideTip('tt107')">setOpacity</a></td><td class=SDescription>Sets the given opacity to the current selected elements</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.getOpacity" >getOpacity</a></td><td class=SDescription>Returns the current fill opacity</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getStrokeOpacity" id=link233 onMouseOver="ShowTip(event, 'tt108', 'link233')" onMouseOut="HideTip('tt108')">getStrokeOpacity</a></td><td class=SDescription>Returns the current stroke opacity</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setPaintOpacity" id=link234 onMouseOver="ShowTip(event, 'tt109', 'link234')" onMouseOut="HideTip('tt109')">setPaintOpacity</a></td><td class=SDescription>Sets the current fill/stroke opacity</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getBlur" id=link235 onMouseOver="ShowTip(event, 'tt110', 'link235')" onMouseOut="HideTip('tt110')">getBlur</a></td><td class=SDescription>Gets the stdDeviation blur value of the given element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setBlurNoUndo" id=link236 onMouseOver="ShowTip(event, 'tt111', 'link236')" onMouseOut="HideTip('tt111')">setBlurNoUndo</a></td><td class=SDescription>Sets the stdDeviation blur value on the selected element without being undoable</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setBlurOffsets" id=link237 onMouseOver="ShowTip(event, 'tt112', 'link237')" onMouseOut="HideTip('tt112')">setBlurOffsets</a></td><td class=SDescription>Sets the x, y, with, height values of the filter element in order to make the blur not be clipped. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setBlur" id=link238 onMouseOver="ShowTip(event, 'tt113', 'link238')" onMouseOut="HideTip('tt113')">setBlur</a></td><td class=SDescription>Adds/updates the blur filter to the selected element</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getBold" id=link239 onMouseOver="ShowTip(event, 'tt114', 'link239')" onMouseOut="HideTip('tt114')">getBold</a></td><td class=SDescription>Check whether selected element is bold or not</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setBold" id=link240 onMouseOver="ShowTip(event, 'tt115', 'link240')" onMouseOut="HideTip('tt115')">setBold</a></td><td class=SDescription>Make the selected element bold or normal</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getItalic" id=link241 onMouseOver="ShowTip(event, 'tt116', 'link241')" onMouseOut="HideTip('tt116')">getItalic</a></td><td class=SDescription>Check whether selected element is italic or not</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setItalic" id=link242 onMouseOver="ShowTip(event, 'tt117', 'link242')" onMouseOut="HideTip('tt117')">setItalic</a></td><td class=SDescription>Make the selected element italic or normal</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getFontFamily" id=link243 onMouseOver="ShowTip(event, 'tt118', 'link243')" onMouseOut="HideTip('tt118')">getFontFamily</a></td><td class=SDescription>Returns the current font family</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setFontFamily" id=link244 onMouseOver="ShowTip(event, 'tt119', 'link244')" onMouseOut="HideTip('tt119')">setFontFamily</a></td><td class=SDescription>Set the new font family</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getFontSize" id=link245 onMouseOver="ShowTip(event, 'tt120', 'link245')" onMouseOut="HideTip('tt120')">getFontSize</a></td><td class=SDescription>Returns the current font size</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setFontSize" id=link246 onMouseOver="ShowTip(event, 'tt121', 'link246')" onMouseOut="HideTip('tt121')">setFontSize</a></td><td class=SDescription>Applies the given font size to the selected element</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.getText" id=link247 onMouseOver="ShowTip(event, 'tt122', 'link247')" onMouseOut="HideTip('tt122')">getText</a></td><td class=SDescription>Returns the current text (textContent) of the selected element</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setTextContent" id=link248 onMouseOver="ShowTip(event, 'tt123', 'link248')" onMouseOut="HideTip('tt123')">setTextContent</a></td><td class=SDescription>Updates the text element with the given string</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setImageURL" id=link249 onMouseOver="ShowTip(event, 'tt124', 'link249')" onMouseOut="HideTip('tt124')">setImageURL</a></td><td class=SDescription>Sets the new image URL for the selected image element. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setRectRadius" id=link250 onMouseOver="ShowTip(event, 'tt125', 'link250')" onMouseOut="HideTip('tt125')">setRectRadius</a></td><td class=SDescription>Sets the rx &amp; ry values to the selected rect element to change its corner radius</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Element_manipulation" >Element manipulation</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.setSegType" id=link251 onMouseOver="ShowTip(event, 'tt126', 'link251')" onMouseOut="HideTip('tt126')">setSegType</a></td><td class=SDescription>Sets the new segment type to the selected segment(s).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.convertToPath" id=link252 onMouseOver="ShowTip(event, 'tt127', 'link252')" onMouseOut="HideTip('tt127')">convertToPath</a></td><td class=SDescription>Convert selected element to a path, or get the BBox of an element-as-path</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.changeSelectedAttributeNoUndo" id=link253 onMouseOver="ShowTip(event, 'tt128', 'link253')" onMouseOut="HideTip('tt128')">changeSelectedAttributeNoUndo</a></td><td class=SDescription>This function makes the changes to the elements. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.changeSelectedAttribute" id=link254 onMouseOver="ShowTip(event, 'tt129', 'link254')" onMouseOut="HideTip('tt129')">changeSelectedAttribute</a></td><td class=SDescription>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. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.deleteSelectedElements" id=link255 onMouseOver="ShowTip(event, 'tt130', 'link255')" onMouseOut="HideTip('tt130')">deleteSelectedElements</a></td><td class=SDescription>Removes all selected elements from the DOM and adds the change to the history stack</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.groupSelectedElements" id=link256 onMouseOver="ShowTip(event, 'tt131', 'link256')" onMouseOut="HideTip('tt131')">groupSelectedElements</a></td><td class=SDescription>Wraps all the selected elements in a group (g) element</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.ungroupSelectedElement" id=link257 onMouseOver="ShowTip(event, 'tt132', 'link257')" onMouseOut="HideTip('tt132')">ungroupSelectedElement</a></td><td class=SDescription>Unwraps all the elements in a selected group (g) element. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.moveToTopSelectedElement" id=link258 onMouseOver="ShowTip(event, 'tt133', 'link258')" onMouseOut="HideTip('tt133')">moveToTopSelectedElement</a></td><td class=SDescription>Repositions the selected element to the bottom in the DOM to appear on top of other elements</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.moveToBottomSelectedElement" id=link259 onMouseOver="ShowTip(event, 'tt134', 'link259')" onMouseOut="HideTip('tt134')">moveToBottomSelectedElement</a></td><td class=SDescription>Repositions the selected element to the top in the DOM to appear under other elements</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.moveSelectedElements" id=link260 onMouseOver="ShowTip(event, 'tt135', 'link260')" onMouseOut="HideTip('tt135')">moveSelectedElements</a></td><td class=SDescription>Moves selected elements on the X/Y axis</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.cloneSelectedElements" id=link261 onMouseOver="ShowTip(event, 'tt136', 'link261')" onMouseOut="HideTip('tt136')">cloneSelectedElements</a></td><td class=SDescription>Create deep DOM copies (clones) of all selected elements and move them slightly from their originals</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.alignSelectedElements" id=link262 onMouseOver="ShowTip(event, 'tt137', 'link262')" onMouseOut="HideTip('tt137')">alignSelectedElements</a></td><td class=SDescription>Aligns selected elements</td></tr><tr class="SGroup"><td class=SEntry><a href="#SelectorManager.Additional_editor_tools" >Additional editor tools</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.updateCanvas" id=link263 onMouseOver="ShowTip(event, 'tt138', 'link263')" onMouseOut="HideTip('tt138')">updateCanvas</a></td><td class=SDescription>Updates the editor canvas width/height/position after a zoom has occurred</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SelectorManager.setBackground" id=link264 onMouseOver="ShowTip(event, 'tt139', 'link264')" onMouseOut="HideTip('tt139')">setBackground</a></td><td class=SDescription>Set the background of the editor (NOT the actual document)</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SelectorManager.cycleElement" id=link265 onMouseOver="ShowTip(event, 'tt140', 'link265')" onMouseOut="HideTip('tt140')">cycleElement</a></td><td class=SDescription>Select the next/previous element within the current layer</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.SelectorManager.initGroup"></a>SelectorManager.<wbr>initGroup</h3><div class=CBody><p>Resets the parent selector group element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.SelectorManager.requestSelector"></a>SelectorManager.<wbr>requestSelector</h3><div class=CBody><p>Returns the selector based on the given element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element to get the selector for</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.SelectorManager.releaseSelector"></a>SelectorManager.<wbr>releaseSelector</h3><div class=CBody><p>Removes the selector of the given element (hides selection box)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element to remove the selector for</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.SelectorManager.getRubberBandBox"></a>SelectorManager.<wbr>getRubberBandBox</h3><div class=CBody><p>Returns the rubberBandBox DOM element.&nbsp; This is the rectangle drawn by the user for selecting/zooming</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Helper_functions"></a>Helper functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.walkTree"></a>walkTree</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function walkTree(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>cbFn</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Walks the tree and executes the callback on each element in a top-down fashion</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element to traverse</td></tr><tr><td class=CDLEntry>cbFn</td><td class=CDLDescription>Callback function to run on each element</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.walkTreePost"></a>walkTreePost</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function walkTreePost(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>cbFn</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Walks the tree and executes the callback on each element in a depth-first fashion</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element to traverse</td></tr><tr><td class=CDLEntry>cbFn</td><td class=CDLDescription>Callback function to run on each element</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.assignAttributes"></a>assignAttributes</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var assignAttributes = this.assignAttributes = function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>attrs,</td></tr><tr><td></td><td class=PParameter nowrap>suspendLength,</td></tr><tr><td></td><td class=PParameter nowrap>unitCheck</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Assigns multiple attributes to an element.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>DOM element to apply new attribute values to</td></tr><tr><td class=CDLEntry>attrs</td><td class=CDLDescription>Object with attribute keys/values</td></tr><tr><td class=CDLEntry>suspendLength</td><td class=CDLDescription>Optional integer of milliseconds to suspend redraw</td></tr><tr><td class=CDLEntry>unitCheck</td><td class=CDLDescription>Boolean to indicate the need to use setUnitAttr</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.cleanupElement"></a>cleanupElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var cleanupElement = this.cleanupElement = function(</td><td class=PParameter nowrap>element</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Remove unneeded (default) attributes, makes resulting SVG smaller</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>element</td><td class=CDLDescription>DOM element to clean up</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.addSvgElementFromJson"></a>addSvgElementFromJson</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var addSvgElementFromJson = this.addSvgElementFromJson = function(</td><td class=PParameter nowrap>data</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>data</td><td class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.addExtension"></a>addExtension</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.addExtension = function(</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>ext_func</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add an extension to the editor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>String with the ID of the extension</td></tr><tr><td class=CDLEntry>ext_func</td><td class=CDLDescription>Function supplied by the extension with its data</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.shortFloat"></a>shortFloat</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var shortFloat = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Rounds a given value to a float with number of digits defined in save_options</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>The value as a String, Number or Array of two numbers to be rounded</td></tr></table><h4 class=CHeading>Returns</h4><p>If a string/number was given, returns a Float.&nbsp; If an array, return a string with comma-seperated floats</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getStrokedBBox"></a>getStrokedBBox</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getStrokedBBox = this.getStrokedBBox = function(</td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the bounding box for one or more stroked and/or transformed elements</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elems</td><td class=CDLDescription>Array with DOM elements to check</td></tr></table><h4 class=CHeading>Returns</h4><p>A single bounding box object</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getVisibleElements"></a>getVisibleElements</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getVisibleElements = this.getVisibleElements = function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>includeBBox</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get all elements that have a BBox (excludes &lt;defs&gt;, &lt;title&gt;, etc).&nbsp; Note that 0-opacity, off-screen etc elements are still considered &ldquo;visible&rdquo; for this function</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>parent</td><td class=CDLDescription>The parent DOM element to search within</td></tr><tr><td class=CDLEntry>includeBBox</td><td class=CDLDescription>Boolean to indicate that an object should return with the element and its bbox</td></tr></table><h4 class=CHeading>Returns</h4><p>An array with all &ldquo;visible&rdquo; elements, or if includeBBox is true, an array with objects that include:</p><ul><li>elem - The element</li><li>bbox - The element&rsquo;s BBox as retrieved from getStrokedBBox</li></ul></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.copyElem"></a>copyElem</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var copyElem = function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a clone of an element, updating its ID and its children&rsquo;s IDs when needed</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>el</td><td class=CDLDescription>DOM element to clone</td></tr></table><p>Returns: The cloned element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getElem"></a>getElem</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getElem(</td><td class=PParameter nowrap>id</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get a DOM element by ID within the SVG root element.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>String with the element&rsquo;s new ID</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getId"></a>getId</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getId = c.getId = function()</td></tr></table></blockquote><p>Returns the last created DOM element ID string</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getNextId"></a>getNextId</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.bind"></a>bind</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c.bind = function(</td><td class=PParameter nowrap>event,</td></tr><tr><td></td><td class=PParameter nowrap>f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Attaches a callback function to an event</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>event</td><td class=CDLDescription>String indicating the name of the event</td></tr><tr><td class=CDLEntry>f</td><td class=CDLDescription>The callback function to bind to the event</td></tr></table><h4 class=CHeading>Return</h4><p>The previous event</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setIdPrefix"></a>setIdPrefix</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c.setIdPrefix = function(</td><td class=PParameter nowrap>p</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Changes the ID prefix to the given value</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p</td><td class=CDLDescription>String with the new prefix</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.sanitizeSvg"></a>sanitizeSvg</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var sanitizeSvg = this.sanitizeSvg = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>node</td><td class=CDLDescription>The DOM element to be checked, will also check its children</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getUrlFromAttr"></a>getUrlFromAttr</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getUrlFromAttr = this.getUrlFromAttr = function(</td><td class=PParameter nowrap>attrVal</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Extracts the URL from the url(...) syntax of some attributes.&nbsp; Three variants:</p><ul><li>&lt;circle fill=&rdquo;url(someFile.svg#foo)&rdquo; /&gt;</li><li>&lt;circle fill=&rdquo;url(&lsquo;someFile.svg#foo&rsquo;)&rdquo; /&gt;</li><li>&lt;circle fill=&rsquo;url(&ldquo;someFile.svg#foo&rdquo;)&rsquo; /&gt;</li></ul><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attrVal</td><td class=CDLDescription>The attribute value as a string</td></tr></table><h4 class=CHeading>Returns</h4><p>String with just the URL, like someFile.svg#foo</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getBBox"></a>getBBox</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getBBox = this.getBBox = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the given/selected element&rsquo;s bounding box object, convert it to be more usable when necessary</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>Optional DOM element to get the BBox for</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.ffClone"></a>ffClone</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var ffClone = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hack for Firefox bugs where text element features aren&rsquo;t updated.&nbsp; This function clones the element and re-selects it TODO: Test for this bug on load and add it to &ldquo;support&rdquo; object instead of browser sniffing</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The (text) DOM element to clone</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getPathBBox"></a>getPathBBox</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getPathBBox = function(</td><td class=PParameter nowrap>path</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get correct BBox for a path in Webkit Converted from code found here: <a href="http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html" class=LURL target=_top>http://blog.hackers-cafe.net<wbr>/2009<wbr>/06<wbr>/how-to-calculate-bezier-curves-bounding.html</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>path</td><td class=CDLDescription>The path DOM element to get the BBox for</td></tr></table><h4 class=CHeading>Returns</h4><p>A BBox-like object</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Element_Transforms"></a>Element Transforms</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getRotationAngle"></a>getRotationAngle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getRotationAngle = this.getRotationAngle = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>to_rad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the rotation angle of the given/selected DOM element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>Optional DOM element to get the angle for</td></tr><tr><td class=CDLEntry>to_rad</td><td class=CDLDescription>Boolean that when true returns the value in radians rather than degrees</td></tr></table><h4 class=CHeading>Returns</h4><p>Float with the angle in degrees or radians</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setRotationAngle"></a>setRotationAngle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setRotationAngle = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>preventUndo</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes any old rotations if present, prepends a new rotation at the transformed center</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>The new rotation angle in degrees</td></tr><tr><td class=CDLEntry>preventUndo</td><td class=CDLDescription>Boolean indicating whether the action should be undoable or not</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getTransformList"></a>getTransformList</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getTransformList = this.getTransformList = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns an object that behaves like a SVGTransformList for the given DOM element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>DOM element to get a transformlist from</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.recalculateAllSelectedDimensions"></a>recalculateAllSelectedDimensions</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.remapElement"></a>remapElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var remapElement = this.remapElement = function(</td><td class=PParameter nowrap>selected,</td></tr><tr><td></td><td class=PParameter nowrap>changes,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Applies coordinate changes to an element based on the given matrix</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>selected</td><td class=CDLDescription>DOM element to be changed</td></tr><tr><td class=CDLEntry>changes</td><td class=CDLDescription>Object with changes to be remapped</td></tr><tr><td class=CDLEntry>m</td><td class=CDLDescription>Matrix object to use for remapping coordinates</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.recalculateDimensions"></a>recalculateDimensions</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var recalculateDimensions = this.recalculateDimensions = function(</td><td class=PParameter nowrap>selected</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decides the course of action based on the element&rsquo;s transform list</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>selected</td><td class=CDLDescription>The DOM element to recalculate</td></tr></table><h4 class=CHeading>Returns</h4><p>Undo command object with the resulting change</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.transformPoint"></a>transformPoint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var transformPoint = function(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x</td><td class=CDLDescription>Float representing the x coordinate</td></tr><tr><td class=CDLEntry>y</td><td class=CDLDescription>Float representing the y coordinate</td></tr><tr><td class=CDLEntry>m</td><td class=CDLDescription>Matrix object to transform the point with Returns a x,y object representing the transformed point</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.isIdentity"></a>isIdentity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var isIdentity = function(</td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>m</td><td class=CDLDescription>The matrix object to check</td></tr></table><h4 class=CHeading>Returns</h4><p>Boolean indicating whether or not the matrix is 1,0,0,1,0,0</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.matrixMultiply"></a>matrixMultiply</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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.&nbsp; We also round to zero when it&rsquo;s near zero</p><h4 class=CHeading>Parameters</h4><blockquote><pre>= 2 Matrix objects to multiply</pre></blockquote><h4 class=CHeading>Returns</h4><p>The matrix object resulting from the calculation</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.transformListToTransform"></a>transformListToTransform</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var transformListToTransform = this.transformListToTransform = function(</td><td class=PParameter nowrap>tlist,</td></tr><tr><td></td><td class=PParameter nowrap>min,</td></tr><tr><td></td><td class=PParameter nowrap>max</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>tlist</td><td class=CDLDescription>The transformlist object</td></tr><tr><td class=CDLEntry>min</td><td class=CDLDescription>Optional integer indicating start transform position</td></tr><tr><td class=CDLEntry>max</td><td class=CDLDescription>Optional integer indicating end transform position</td></tr></table><h4 class=CHeading>Returns</h4><p>A single matrix transform object</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.hasMatrixTransform"></a>hasMatrixTransform</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var hasMatrixTransform = this.hasMatrixTransform = function(</td><td class=PParameter nowrap>tlist</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>See if the given transformlist includes a non-indentity matrix transform</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>tlist</td><td class=CDLDescription>The transformlist to check</td></tr></table><h4 class=CHeading>Returns</h4><p>Boolean on whether or not a matrix transform was found</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getMatrix"></a>getMatrix</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getMatrix = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the matrix object for a given element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The DOM element to check</td></tr></table><h4 class=CHeading>Returns</h4><p>The matrix object associated with the element&rsquo;s transformlist</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.transformBox"></a>transformBox</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var transformBox = this.transformBox = function(</td><td class=PParameter nowrap>l,</td></tr><tr><td></td><td class=PParameter nowrap>t,</td></tr><tr><td></td><td class=PParameter nowrap>w,</td></tr><tr><td></td><td class=PParameter nowrap>h,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Transforms a rectangle based on the given matrix</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>l</td><td class=CDLDescription>Float with the box&rsquo;s left coordinate</td></tr><tr><td class=CDLEntry>t</td><td class=CDLDescription>Float with the box&rsquo;s top coordinate</td></tr><tr><td class=CDLEntry>w</td><td class=CDLDescription>Float with the box width</td></tr><tr><td class=CDLEntry>h</td><td class=CDLDescription>Float with the box height</td></tr><tr><td class=CDLEntry>m</td><td class=CDLDescription>Matrix object to transform the box by</td></tr></table><h4 class=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>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Selection"></a>Selection</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.clearSelection"></a>clearSelection</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var clearSelection = this.clearSelection = function(</td><td class=PParameter nowrap>noCall</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Clears the selection.&nbsp;  The &lsquo;selected&rsquo; handler is then called.&nbsp; Parameters: noCall - Optional boolean that when true does not call the &ldquo;selected&rdquo; handler</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.addToSelection"></a>addToSelection</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var addToSelection = this.addToSelection = function(</td><td class=PParameter nowrap>elemsToAdd,</td></tr><tr><td></td><td class=PParameter nowrap>showGrips</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a list of elements to the selection.&nbsp;  The &lsquo;selected&rsquo; handler is then called.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elemsToAdd</td><td class=CDLDescription>an array of DOM elements to add to the selection</td></tr><tr><td class=CDLEntry>showGrips</td><td class=CDLDescription>a boolean flag indicating whether the resize grips should be shown</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.removeFromSelection"></a>removeFromSelection</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var removeFromSelection = this.removeFromSelection = function(</td><td class=PParameter nowrap>elemsToRemove</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes elements from the selection.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elemsToRemove</td><td class=CDLDescription>an array of elements to remove from selection</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.selectAllInCurrentLayer"></a>selectAllInCurrentLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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.&nbsp; This function then fires the selected event.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.smoothControlPoints"></a>smoothControlPoints</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var smoothControlPoints = this.smoothControlPoints = function(</td><td class=PParameter nowrap>ct1,</td></tr><tr><td></td><td class=PParameter nowrap>ct2,</td></tr><tr><td></td><td class=PParameter nowrap>pt</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Takes three points and creates a smoother line based on them</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ct1</td><td class=CDLDescription>Object with x and y values (first control point)</td></tr><tr><td class=CDLEntry>ct2</td><td class=CDLDescription>Object with x and y values (second control point)</td></tr><tr><td class=CDLEntry>pt</td><td class=CDLDescription>Object with x and y values (third point)</td></tr></table><h4 class=CHeading>Returns</h4><p>Array of two &ldquo;smoothed&rdquo; point objects</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getMouseTarget"></a>getMouseTarget</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getMouseTarget = this.getMouseTarget = function(</td><td class=PParameter nowrap>evt</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Gets the desired element from a mouse event</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>evt</td><td class=CDLDescription>Event object from the mouse event</td></tr></table><h4 class=CHeading>Returns</h4><p>DOM element we want</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.preventClickDefault"></a>preventClickDefault</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var preventClickDefault = function(</td><td class=PParameter nowrap>img</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Prevents default browser click behaviour on the given element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>img</td><td class=CDLDescription>The DOM element to prevent the cilck on</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Text_edit_functions"></a>Text edit functions</h3><div class=CBody><p>Functions relating to editing text elements</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Path_edit_functions"></a>Path edit functions</h3><div class=CBody><p>Functions relating to editing path elements</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Serialization"></a>Serialization</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.removeUnusedDefElems"></a>removeUnusedDefElems</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var removeUnusedDefElems = this.removeUnusedDefElems = function()</td></tr></table></blockquote><p>Looks at DOM elements inside the &lt;defs&gt; to see if they are referred to, removes them from the DOM if they are not.</p><h4 class=CHeading>Returns</h4><p>The amount of elements that were removed</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.svgCanvasToString"></a>svgCanvasToString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var svgCanvasToString = this.svgCanvasToString = function()</td></tr></table></blockquote><p>Main function to set up the SVG content for output</p><h4 class=CHeading>Returns</h4><p>String containing the SVG image for output</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.svgToString"></a>svgToString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var svgToString = this.svgToString = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>indent</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sub function ran on each SVG element to convert it to a string as desired</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The SVG element to convert</td></tr><tr><td class=CDLEntry>indent</td><td class=CDLDescription>Integer with the amount of spaces to indent this tag</td></tr></table><h4 class=CHeading>Returns</h4><p>String with the given element as an SVG tag</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.embedImage"></a>embedImage</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.embedImage = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>callback</td><td class=PAfterParameters nowrap>)</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><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the path/URL of the image</td></tr><tr><td class=CDLEntry>callback</td><td class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.save"></a>save</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.save = function(</td><td class=PParameter nowrap>opts</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Serializes the current drawing into SVG XML text and returns it to the &lsquo;saved&rsquo; handler.&nbsp; This function also includes the XML prolog.&nbsp;  Clients of the SvgCanvas bind their save function to the &lsquo;saved&rsquo; event.</p><h4 class=CHeading>Returns</h4><p>Nothing</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.rasterExport"></a>rasterExport</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.rasterExport = function()</td></tr></table></blockquote><p>Generates a PNG Data URL based on the current image, then calls &ldquo;exported&rdquo; with an object including the string and any issues found</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getSvgString"></a>getSvgString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getSvgString = function()</td></tr></table></blockquote><p>Returns the current drawing as raw SVG XML text.</p><h4 class=CHeading>Returns</h4><p>The current drawing as raw SVG XML text.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setSvgString"></a>setSvgString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setSvgString = function(</td><td class=PParameter nowrap>xmlString</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>This function sets the current drawing as the input SVG XML.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>xmlString</td><td class=CDLDescription>The SVG as XML text.</td></tr></table><h4 class=CHeading>Returns</h4><p>This function returns false if the set was unsuccessful, true otherwise.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.importSvgString"></a>importSvgString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.importSvgString = function(</td><td class=PParameter nowrap>xmlString</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>This function imports the input SVG XML into the current layer in the drawing</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>xmlString</td><td class=CDLDescription>The SVG as XML text.</td></tr></table><h4 class=CHeading>Returns</h4><p>This function returns false if the import was unsuccessful, true otherwise.&nbsp; 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&rsquo;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>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Layers"></a>Layers</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.identifyLayers"></a>identifyLayers</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var identifyLayers = function()</td></tr></table></blockquote><p>Updates layer system</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.createLayer"></a>createLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.createLayer = function(</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</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 &lsquo;changed&rsquo; handler.&nbsp; This is an undoable action.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>The given name</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.deleteCurrentLayer"></a>deleteCurrentLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.deleteCurrentLayer = function()</td></tr></table></blockquote><p>Deletes the current layer from the drawing and then clears the selection.&nbsp; This function then calls the &lsquo;changed&rsquo; handler.&nbsp;  This is an undoable action.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getNumLayers"></a>getNumLayers</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getNumLayers = function()</td></tr></table></blockquote><p>Returns the number of layers in the current drawing.</p><h4 class=CHeading>Returns</h4><p>The number of layers in the current drawing.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getLayer"></a>getLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getLayer = function(</td><td class=PParameter nowrap>i</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the name of the ith layer.&nbsp; If the index is out of range, an empty string is returned.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>i</td><td class=CDLDescription>the zero-based index of the layer you are querying.</td></tr></table><h4 class=CHeading>Returns</h4><p>The name of the ith layer</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getCurrentLayer"></a>getCurrentLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getCurrentLayer = function()</td></tr></table></blockquote><p>Returns the name of the currently selected layer.&nbsp; If an error occurs, an empty string is returned.</p><h4 class=CHeading>Returns</h4><p>The name of the currently active layer.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setCurrentLayer"></a>setCurrentLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setCurrentLayer = function(</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the current layer.&nbsp; If the name is not a valid layer name, then this function returns false.&nbsp; Otherwise it returns true.&nbsp; This is not an undo-able action.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>the name of the layer you want to switch to.</td></tr></table><h4 class=CHeading>Returns</h4><p>true if the current layer was switched, otherwise false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.renameCurrentLayer"></a>renameCurrentLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.renameCurrentLayer = function(</td><td class=PParameter nowrap>newname</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Renames the current layer.&nbsp; If the layer name is not valid (i.e. unique), then this function does nothing and returns false, otherwise it returns true.&nbsp; This is an undo-able action.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>newname</td><td class=CDLDescription>the new name you want to give the current layer.&nbsp;  This name must be unique among all layer names.</td></tr></table><h4 class=CHeading>Returns</h4><p>true if the rename succeeded, false otherwise.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setCurrentLayerPosition"></a>setCurrentLayerPosition</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setCurrentLayerPosition = function(</td><td class=PParameter nowrap>newpos</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Changes the position of the current layer to the new value.&nbsp; If the new index is not valid, this function does nothing and returns false, otherwise it returns true.&nbsp; This is an undo-able action.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>newpos</td><td class=CDLDescription>The zero-based index of the new position of the layer.&nbsp;  This should be between</td></tr><tr><td class=CDLEntry>0 and (number of layers</td><td class=CDLDescription>1)</td></tr></table><h4 class=CHeading>Returns</h4><p>true if the current layer position was changed, false otherwise.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getLayerVisibility"></a>getLayerVisibility</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getLayerVisibility = function(</td><td class=PParameter nowrap>layername</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns whether the layer is visible.&nbsp;  If the layer name is not valid, then this function returns false.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>layername</td><td class=CDLDescription>the name of the layer which you want to query.</td></tr></table><h4 class=CHeading>Returns</h4><p>The visibility state of the layer, or false if the layer name was invalid.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setLayerVisibility"></a>setLayerVisibility</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setLayerVisibility = function(</td><td class=PParameter nowrap>layername,</td></tr><tr><td></td><td class=PParameter nowrap>bVisible</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the visibility of the layer.&nbsp; If the layer name is not valid, this function return false, otherwise it returns true.&nbsp; This is an undo-able action.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>layername</td><td class=CDLDescription>the name of the layer to change the visibility</td></tr><tr><td class=CDLEntry>bVisible</td><td class=CDLDescription>true/false, whether the layer should be visible</td></tr></table><h4 class=CHeading>Returns</h4><p>true if the layer&rsquo;s visibility was set, false otherwise</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.moveSelectedToLayer"></a>moveSelectedToLayer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.moveSelectedToLayer = function(</td><td class=PParameter nowrap>layername</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Moves the selected elements to layername.&nbsp; If the name is not a valid layer name, then false is returned.&nbsp;  Otherwise it returns true.&nbsp; This is an undo-able action.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>layername</td><td class=CDLDescription>the name of the layer you want to which you want to move the selected elements</td></tr></table><h4 class=CHeading>Returns</h4><p>true if the selected elements were moved to the layer, false otherwise.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getLayerOpacity"></a>getLayerOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getLayerOpacity = function(</td><td class=PParameter nowrap>layername</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the opacity of the given layer.&nbsp;  If the input name is not a layer, null is returned.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>layername</td><td class=CDLDescription>name of the layer on which to get the opacity</td></tr></table><h4 class=CHeading>Returns</h4><p>The opacity value of the given layer.&nbsp;  This will be a value between 0.0 and 1.0, or null if layername is not a valid layer</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setLayerOpacity"></a>setLayerOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setLayerOpacity = function(</td><td class=PParameter nowrap>layername,</td></tr><tr><td></td><td class=PParameter nowrap>opacity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the opacity of the given layer.&nbsp;  If the input name is not a layer, nothing happens.&nbsp; This is not an undo-able action.&nbsp;  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.&nbsp; If opacity is not a value between 0.0 and 1.0, then nothing happens.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>layername</td><td class=CDLDescription>name of the layer on which to set the opacity</td></tr><tr><td class=CDLEntry>opacity</td><td class=CDLDescription>a float value in the range 0.0-1.0</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Document_functions"></a>Document functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.clear"></a>clear</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.clear = function()</td></tr></table></blockquote><p>Clears the current document.&nbsp;  This is not an undoable action.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.linkControlPoints"></a>linkControlPoints</h3><div class=CBody><p>Alias function</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getContentElem"></a>getContentElem</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getContentElem = function()</td></tr></table></blockquote><p>Returns the content DOM element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getRootElem"></a>getRootElem</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getRootElem = function()</td></tr></table></blockquote><p>Returns the root DOM element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getSelectedElems"></a>getSelectedElems</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getSelectedElems = function()</td></tr></table></blockquote><p>Returns the array with selected DOM elements</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getResolution"></a>getResolution</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getZoom"></a>getZoom</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getZoom = function()</td></tr></table></blockquote><p>Returns the current zoom level</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getVersion"></a>getVersion</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setUiStrings"></a>setUiStrings</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setUiStrings = function(</td><td class=PParameter nowrap>strs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Update interface strings with given values</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>strs</td><td class=CDLDescription>Object with strings (see uiStrings for examples)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setConfig"></a>setConfig</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setConfig = function(</td><td class=PParameter nowrap>opts</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Update configuration options with given values</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>opts</td><td class=CDLDescription>Object with options (see curConfig for examples)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getDocumentTitle"></a>getDocumentTitle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setDocumentTitle"></a>setDocumentTitle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setDocumentTitle = function(</td><td class=PParameter nowrap>newtitle</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds/updates a title element for the document with the given name.&nbsp; This is an undoable action</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>newtitle</td><td class=CDLDescription>String with the new title</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getEditorNS"></a>getEditorNS</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getEditorNS = function(</td><td class=PParameter nowrap>add</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the editor&rsquo;s namespace URL, optionally adds it to root element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>add</td><td class=CDLDescription>Boolean to indicate whether or not to add the namespace value</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setResolution"></a>setResolution</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setResolution = function(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Changes the document&rsquo;s dimensions to the given size</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x</td><td class=CDLDescription>Number with the width of the new dimensions in user units.&nbsp; Can also be the string &ldquo;fit&rdquo; to indicate &ldquo;fit to content&rdquo;</td></tr><tr><td class=CDLEntry>y</td><td class=CDLDescription>Number with the height of the new dimensions in user units.</td></tr></table><h4 class=CHeading>Returns</h4><p>Boolean to indicate if resolution change was succesful.&nbsp; It will fail on &ldquo;fit to content&rdquo; option with no content to fit to.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getOffset"></a>getOffset</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getOffset = function()</td></tr></table></blockquote><p>Returns an object with x, y values indicating the svgcontent element&rsquo;s position in the editor&rsquo;s canvas.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setBBoxZoom"></a>setBBoxZoom</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setBBoxZoom = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>editor_w,</td></tr><tr><td></td><td class=PParameter nowrap>editor_h</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the zoom level on the canvas-side based on the given value</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>Bounding box object to zoom to or string indicating zoom option</td></tr><tr><td class=CDLEntry>editor_w</td><td class=CDLDescription>Integer with the editor&rsquo;s workarea box&rsquo;s width</td></tr><tr><td class=CDLEntry>editor_h</td><td class=CDLDescription>Integer with the editor&rsquo;s workarea box&rsquo;s height</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setZoom"></a>setZoom</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setZoom = function(</td><td class=PParameter nowrap>zoomlevel</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the zoom to the given level</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>zoomlevel</td><td class=CDLDescription>Float indicating the zoom level to change to</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getMode"></a>getMode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getMode = function()</td></tr></table></blockquote><p>Returns the current editor mode string</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setMode"></a>setMode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setMode = function(</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the editor&rsquo;s mode to the given string</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>String with the new mode to change to</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Element_Styling"></a>Element Styling</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getColor"></a>getColor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getColor = function(</td><td class=PParameter nowrap>type</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the current fill/stroke option</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setColor"></a>setColor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setColor = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>preventUndo</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Change the current stroke/fill color/gradient value</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>type</td><td class=CDLDescription>String indicating fill or stroke</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>The value to set the stroke attribute to</td></tr><tr><td class=CDLEntry>preventUndo</td><td class=CDLDescription>Boolean indicating whether or not this should be and undoable option</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.findDefs"></a>findDefs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var findDefs = function()</td></tr></table></blockquote><p>Return the document&rsquo;s &lt;defs&gt; element, create it first if necessary</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setGradient"></a>setGradient</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var setGradient = this.setGradient = function(</td><td class=PParameter nowrap>type</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Apply the current gradient to selected element&rsquo;s fill or stroke</p><p>Parameters type - String indicating &ldquo;fill&rdquo; or &ldquo;stroke&rdquo; to apply to an element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.findDuplicateGradient"></a>findDuplicateGradient</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var findDuplicateGradient = function(</td><td class=PParameter nowrap>grad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Check if exact gradient already exists</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>grad</td><td class=CDLDescription>The gradient DOM element to compare to others</td></tr></table><h4 class=CHeading>Returns</h4><p>The existing gradient if found, null if not</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setPaint"></a>setPaint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setPaint = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>paint</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Set a color/gradient to a fill/stroke</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>type</td><td class=CDLDescription>String with &ldquo;fill&rdquo; or &ldquo;stroke&rdquo;</td></tr><tr><td class=CDLEntry>paint</td><td class=CDLDescription>The jGraduate paint object to apply</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getStrokeWidth"></a>getStrokeWidth</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getStrokeWidth = function()</td></tr></table></blockquote><p>Returns the current stroke-width value</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setStrokeWidth"></a>setStrokeWidth</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setStrokeWidth = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the stroke width for the current selected elements When attempting to set a line&rsquo;s width to 0, this changes it to 1 instead</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>A Float indicating the new stroke width value</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setStrokeAttr"></a>setStrokeAttr</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setStrokeAttr = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Set the given stroke-related attribute the given value for selected elements</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attr</td><td class=CDLDescription>String with the attribute name</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>String or number with the attribute value</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getOpacity"></a>getOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getOpacity = function()</td></tr></table></blockquote><p>Returns the current opacity</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setOpacity"></a>setOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setOpacity = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the given opacity to the current selected elements</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getOpacity"></a>getOpacity</h3><div class=CBody><p>Returns the current fill opacity</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getStrokeOpacity"></a>getStrokeOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getStrokeOpacity = function()</td></tr></table></blockquote><p>Returns the current stroke opacity</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setPaintOpacity"></a>setPaintOpacity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setPaintOpacity = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>preventUndo</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the current fill/stroke opacity</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>type</td><td class=CDLDescription>String with &ldquo;fill&rdquo; or &ldquo;stroke&rdquo;</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>Float with the new opacity value</td></tr><tr><td class=CDLEntry>preventUndo</td><td class=CDLDescription>Boolean indicating whether or not this should be an undoable action</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getBlur"></a>getBlur</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getBlur = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Gets the stdDeviation blur value of the given element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The element to check the blur value for</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setBlurNoUndo"></a>setBlurNoUndo</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.setBlurNoUndo = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the stdDeviation blur value on the selected element without being undoable</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>The new stdDeviation value</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setBlurOffsets"></a>setBlurOffsets</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.setBlurOffsets = function(</td><td class=PParameter nowrap>filter,</td></tr><tr><td></td><td class=PParameter nowrap>stdDev</td><td class=PAfterParameters nowrap>)</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.&nbsp; Removes them if not neeeded</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>filter</td><td class=CDLDescription>The filter DOM element to update</td></tr><tr><td class=CDLEntry>stdDev</td><td class=CDLDescription>The standard deviation value on which to base the offset size</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setBlur"></a>setBlur</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.setBlur = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>complete</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds/updates the blur filter to the selected element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>Float with the new stdDeviation blur value</td></tr><tr><td class=CDLEntry>complete</td><td class=CDLDescription>Boolean indicating whether or not the action should be completed (to add to the undo manager)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getBold"></a>getBold</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getBold = function()</td></tr></table></blockquote><p>Check whether selected element is bold or not</p><h4 class=CHeading>Returns</h4><p>Boolean indicating whether or not element is bold</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setBold"></a>setBold</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setBold = function(</td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Make the selected element bold or normal</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>Boolean indicating bold (true) or normal (false)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getItalic"></a>getItalic</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getItalic = function()</td></tr></table></blockquote><p>Check whether selected element is italic or not</p><h4 class=CHeading>Returns</h4><p>Boolean indicating whether or not element is italic</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setItalic"></a>setItalic</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setItalic = function(</td><td class=PParameter nowrap>i</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Make the selected element italic or normal</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>Boolean indicating italic (true) or normal (false)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getFontFamily"></a>getFontFamily</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getFontFamily = function()</td></tr></table></blockquote><p>Returns the current font family</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setFontFamily"></a>setFontFamily</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setFontFamily = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Set the new font family</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the new font family</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getFontSize"></a>getFontSize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getFontSize = function()</td></tr></table></blockquote><p>Returns the current font size</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setFontSize"></a>setFontSize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setFontSize = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Applies the given font size to the selected element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>Float with the new font size</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.getText"></a>getText</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getText = function()</td></tr></table></blockquote><p>Returns the current text (textContent) of the selected element</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setTextContent"></a>setTextContent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setTextContent = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Updates the text element with the given string</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the new text</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setImageURL"></a>setImageURL</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setImageURL = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the new image URL for the selected image element.&nbsp; Updates its size if a new URL is given</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>String with the image URL/path</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setRectRadius"></a>setRectRadius</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setRectRadius = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the rx &amp; ry values to the selected rect element to change its corner radius</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>val</td><td class=CDLDescription>The new radius</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Element_manipulation"></a>Element manipulation</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setSegType"></a>setSegType</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setSegType = function(</td><td class=PParameter nowrap>new_type</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the new segment type to the selected segment(s).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>new_type</td><td class=CDLDescription>Integer with the new segment type See <a href="http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg" class=LURL target=_top>http://www.w3.org<wbr>/TR<wbr>/SVG<wbr>/paths.html#InterfaceSVGPathSeg</a> for list</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.convertToPath"></a>convertToPath</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.convertToPath = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>getBBox</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Convert selected element to a path, or get the BBox of an element-as-path</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>The DOM element to be converted</td></tr><tr><td class=CDLEntry>getBBox</td><td class=CDLDescription>Boolean on whether or not to only return the path&rsquo;s BBox</td></tr></table><h4 class=CHeading>Returns</h4><p>If the getBBox flag is true, the resulting path&rsquo;s bounding box object.&nbsp; Otherwise the resulting path element is returned.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.changeSelectedAttributeNoUndo"></a>changeSelectedAttributeNoUndo</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var changeSelectedAttributeNoUndo = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>newValue,</td></tr><tr><td></td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>This function makes the changes to the elements.&nbsp; It does not add the change to the history stack.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attr</td><td class=CDLDescription>String with the attribute name</td></tr><tr><td class=CDLEntry>newValue</td><td class=CDLDescription>String or number with the new attribute value</td></tr><tr><td class=CDLEntry>elems</td><td class=CDLDescription>The DOM elements to apply the change to</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.changeSelectedAttribute"></a>changeSelectedAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var changeSelectedAttribute = this.changeSelectedAttribute = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</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.&nbsp; If you want to change only a subset of selectedElements, then send the subset to this function in the elems argument.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attr</td><td class=CDLDescription>String with the attribute name</td></tr><tr><td class=CDLEntry>newValue</td><td class=CDLDescription>String or number with the new attribute value</td></tr><tr><td class=CDLEntry>elems</td><td class=CDLDescription>The DOM elements to apply the change to</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.deleteSelectedElements"></a>deleteSelectedElements</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.groupSelectedElements"></a>groupSelectedElements</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.ungroupSelectedElement"></a>ungroupSelectedElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.ungroupSelectedElement = function()</td></tr></table></blockquote><p>Unwraps all the elements in a selected group (g) element.&nbsp; This requires significant recalculations to apply group&rsquo;s transforms, etc to its children</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.moveToTopSelectedElement"></a>moveToTopSelectedElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.moveToBottomSelectedElement"></a>moveToBottomSelectedElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.moveSelectedElements"></a>moveSelectedElements</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.moveSelectedElements = function(</td><td class=PParameter nowrap>dx,</td></tr><tr><td></td><td class=PParameter nowrap>dy,</td></tr><tr><td></td><td class=PParameter nowrap>undoable</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Moves selected elements on the X/Y axis</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dx</td><td class=CDLDescription>Float with the distance to move on the x-axis</td></tr><tr><td class=CDLEntry>dy</td><td class=CDLDescription>Float with the distance to move on the y-axis</td></tr><tr><td class=CDLEntry>undoable</td><td class=CDLDescription>Boolean indicating whether or not the action should be undoable</td></tr></table><h4 class=CHeading>Returns</h4><p>Batch command for the move</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.cloneSelectedElements"></a>cloneSelectedElements</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.alignSelectedElements"></a>alignSelectedElements</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.alignSelectedElements = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>relative_to</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Aligns selected elements</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>type</td><td class=CDLDescription>String with single character indicating the alignment type</td></tr><tr><td class=CDLEntry>relative_to</td><td class=CDLDescription>String that must be one of the following: &ldquo;selected&rdquo;, &ldquo;largest&rdquo;, &ldquo;smallest&rdquo;, &ldquo;page&rdquo;</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.Additional_editor_tools"></a>Additional editor tools</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.updateCanvas"></a>updateCanvas</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.updateCanvas = function(</td><td class=PParameter nowrap>w,</td></tr><tr><td></td><td class=PParameter nowrap>h</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Updates the editor canvas width/height/position after a zoom has occurred</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>w</td><td class=CDLDescription>Float with the new width</td></tr><tr><td class=CDLEntry>h</td><td class=CDLDescription>Float with the new height</td></tr></table><h4 class=CHeading>Returns</h4><p>Object with the following values:</p><ul><li>x - The canvas&rsquo; new x coordinate</li><li>y - The canvas&rsquo; new y coordinate</li><li>old_x - The canvas&rsquo; old x coordinate</li><li>old_y - The canvas&rsquo; old y coordinate</li><li>d_x - The x position difference</li><li>d_y - The y position difference</li></ul></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.setBackground"></a>setBackground</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setBackground = function(</td><td class=PParameter nowrap>color,</td></tr><tr><td></td><td class=PParameter nowrap>url</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Set the background of the editor (NOT the actual document)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>color</td><td class=CDLDescription>String with fill color to apply</td></tr><tr><td class=CDLEntry>url</td><td class=CDLDescription>URL or path to image to use</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SelectorManager.cycleElement"></a>cycleElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.cycleElement = function(</td><td class=PParameter nowrap>next</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Select the next/previous element within the current layer</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>next</td><td class=CDLDescription>Boolean where true = next and false = previous element</td></tr></table></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="extensions/ext-foreignobject-js.html">setForeignString(xmlString, elt)</a></div></div><div class=MEntry><div class=MFile id=MSelected>SvgCanvas</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Interfaces.html">Interfaces</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Functions">Functions</option><option value="Interfaces">Interfaces</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>&quot;rectsIntersect&quot;: function(</td><td class=PParameter nowrap>r1,</td></tr><tr><td></td><td class=PParameter nowrap>r2</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if two rectangles (BBoxes objects) intersect each other</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>&quot;snapToAngle&quot;: function(</td><td class=PParameter nowrap>x1,</td></tr><tr><td></td><td class=PParameter nowrap>y1,</td></tr><tr><td></td><td class=PParameter nowrap>x2,</td></tr><tr><td></td><td class=PParameter nowrap>y2</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns a 45 degree angle coordinate associated with the two given coordinates</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>&quot;text2xml&quot;: function(</td><td class=PParameter nowrap>sXML</td><td class=PAfterParameters nowrap>)</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><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>convertToNum = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts given values to numbers. </div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setUnitAttr = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets an element&rsquo;s attribute based on the unit in its current value.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.isValidUnit = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if an attribute&rsquo;s value is in a valid format</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var ChangeElementCommand = this.undoCmd.changeElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>attrs,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>History command to make a change to an element. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var InsertElementCommand = this.undoCmd.insertElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>History command for an element that was added to the DOM</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var RemoveElementCommand = this.undoCmd.removeElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>History command for an element removed from the DOM</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var MoveElementCommand = this.undoCmd.moveElement = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>oldNextSibling,</td></tr><tr><td></td><td class=PParameter nowrap>oldParent,</td></tr><tr><td></td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>History command for an element that had its DOM position changed</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var BatchCommand = this.undoCmd.batch = function(</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>History command that can contain/execute multiple other commands</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>resetUndoStack = function()</td></tr></table></blockquote>Resets the undo stack, effectively clearing the undo/redo history</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addCommandToHistory = c.undoCmd.add = function(</td><td class=PParameter nowrap>cmd</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a command object to the undo history stack</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c.beginUndoableChange = function(</td><td class=PParameter nowrap>attrName,</td></tr><tr><td></td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This function tells the canvas to remember the old values of the attrName attribute for each element sent in. </div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>c.finishUndoableChange = function()</td></tr></table></blockquote>This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called. </div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function walkTree(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>cbFn</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Walks the tree and executes the callback on each element in a top-down fashion</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function walkTreePost(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>cbFn</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Walks the tree and executes the callback on each element in a depth-first fashion</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var assignAttributes = this.assignAttributes = function(</td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>attrs,</td></tr><tr><td></td><td class=PParameter nowrap>suspendLength,</td></tr><tr><td></td><td class=PParameter nowrap>unitCheck</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Assigns multiple attributes to an element.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var cleanupElement = this.cleanupElement = function(</td><td class=PParameter nowrap>element</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Remove unneeded (default) attributes, makes resulting SVG smaller</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var addSvgElementFromJson = this.addSvgElementFromJson = function(</td><td class=PParameter nowrap>data</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>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</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.addExtension = function(</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>ext_func</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add an extension to the editor</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var shortFloat = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Rounds a given value to a float with number of digits defined in save_options</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getStrokedBBox = this.getStrokedBBox = function(</td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the bounding box for one or more stroked and/or transformed elements</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getVisibleElements = this.getVisibleElements = function(</td><td class=PParameter nowrap>parent,</td></tr><tr><td></td><td class=PParameter nowrap>includeBBox</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get all elements that have a BBox (excludes defs, title, etc). </div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var copyElem = function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create a clone of an element, updating its ID and its children&rsquo;s IDs when needed</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getElem(</td><td class=PParameter nowrap>id</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get a DOM element by ID within the SVG root element.</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getId = c.getId = function()</td></tr></table></blockquote>Returns the last created DOM element ID string</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getNextId = c.getNextId = function()</td></tr></table></blockquote>Creates and returns a unique ID string for a DOM element</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c.bind = function(</td><td class=PParameter nowrap>event,</td></tr><tr><td></td><td class=PParameter nowrap>f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Attaches a callback function to an event</div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c.setIdPrefix = function(</td><td class=PParameter nowrap>p</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Changes the ID prefix to the given value</div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var sanitizeSvg = this.sanitizeSvg = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getUrlFromAttr = this.getUrlFromAttr = function(</td><td class=PParameter nowrap>attrVal</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Extracts the URL from the url(...)</div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getBBox = this.getBBox = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the given/selected element&rsquo;s bounding box object, convert it to be more usable when necessary</div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var ffClone = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hack for Firefox bugs where text element features aren&rsquo;t updated. </div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getPathBBox = function(</td><td class=PParameter nowrap>path</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get correct BBox for a path in Webkit Converted from code found here: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html</div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getRotationAngle = this.getRotationAngle = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>to_rad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the rotation angle of the given/selected DOM element</div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setRotationAngle = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>preventUndo</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Removes any old rotations if present, prepends a new rotation at the transformed center</div></div><div class=CToolTip id="tt38"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getTransformList = this.getTransformList = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns an object that behaves like a SVGTransformList for the given DOM element</div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var recalculateAllSelectedDimensions = this.recalculateAllSelectedDimensions = function()</td></tr></table></blockquote>Runs recalculateDimensions on the selected elements, adding the changes to a single batch command</div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var remapElement = this.remapElement = function(</td><td class=PParameter nowrap>selected,</td></tr><tr><td></td><td class=PParameter nowrap>changes,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Applies coordinate changes to an element based on the given matrix</div></div><div class=CToolTip id="tt41"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var recalculateDimensions = this.recalculateDimensions = function(</td><td class=PParameter nowrap>selected</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Decides the course of action based on the element&rsquo;s transform list</div></div><div class=CToolTip id="tt42"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var transformPoint = function(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)</div></div><div class=CToolTip id="tt43"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var isIdentity = function(</td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Helper function to check if the matrix performs no actual transform (i.e. </div></div><div class=CToolTip id="tt44"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var matrixMultiply = this.matrixMultiply = function()</td></tr></table></blockquote>This function tries to return a SVGMatrix that is the multiplication m1*m2. </div></div><div class=CToolTip id="tt45"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var transformListToTransform = this.transformListToTransform = function(</td><td class=PParameter nowrap>tlist,</td></tr><tr><td></td><td class=PParameter nowrap>min,</td></tr><tr><td></td><td class=PParameter nowrap>max</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>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</div></div><div class=CToolTip id="tt46"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var hasMatrixTransform = this.hasMatrixTransform = function(</td><td class=PParameter nowrap>tlist</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>See if the given transformlist includes a non-indentity matrix transform</div></div><div class=CToolTip id="tt47"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getMatrix = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the matrix object for a given element</div></div><div class=CToolTip id="tt48"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var transformBox = this.transformBox = function(</td><td class=PParameter nowrap>l,</td></tr><tr><td></td><td class=PParameter nowrap>t,</td></tr><tr><td></td><td class=PParameter nowrap>w,</td></tr><tr><td></td><td class=PParameter nowrap>h,</td></tr><tr><td></td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Transforms a rectangle based on the given matrix</div></div><div class=CToolTip id="tt49"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var clearSelection = this.clearSelection = function(</td><td class=PParameter nowrap>noCall</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Clears the selection. </div></div><div class=CToolTip id="tt50"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var addToSelection = this.addToSelection = function(</td><td class=PParameter nowrap>elemsToAdd,</td></tr><tr><td></td><td class=PParameter nowrap>showGrips</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a list of elements to the selection. </div></div><div class=CToolTip id="tt51"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var removeFromSelection = this.removeFromSelection = function(</td><td class=PParameter nowrap>elemsToRemove</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Removes elements from the selection.</div></div><div class=CToolTip id="tt52"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.selectAllInCurrentLayer = function()</td></tr></table></blockquote>Clears the selection, then adds all elements in the current layer to the selection. </div></div><div class=CToolTip id="tt53"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var smoothControlPoints = this.smoothControlPoints = function(</td><td class=PParameter nowrap>ct1,</td></tr><tr><td></td><td class=PParameter nowrap>ct2,</td></tr><tr><td></td><td class=PParameter nowrap>pt</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Takes three points and creates a smoother line based on them</div></div><div class=CToolTip id="tt54"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var getMouseTarget = this.getMouseTarget = function(</td><td class=PParameter nowrap>evt</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Gets the desired element from a mouse event</div></div><div class=CToolTip id="tt55"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var preventClickDefault = function(</td><td class=PParameter nowrap>img</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Prevents default browser click behaviour on the given element</div></div><div class=CToolTip id="tt56"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var removeUnusedDefElems = this.removeUnusedDefElems = function()</td></tr></table></blockquote>Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.</div></div><div class=CToolTip id="tt57"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var svgCanvasToString = this.svgCanvasToString = function()</td></tr></table></blockquote>Main function to set up the SVG content for output</div></div><div class=CToolTip id="tt58"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var svgToString = this.svgToString = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>indent</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sub function ran on each SVG element to convert it to a string as desired</div></div><div class=CToolTip id="tt59"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.embedImage = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>callback</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts a given image file to a data URL when possible, then runs a given callback</div></div><div class=CToolTip id="tt60"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.save = function(</td><td class=PParameter nowrap>opts</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Serializes the current drawing into SVG XML text and returns it to the &lsquo;saved&rsquo; handler. </div></div><div class=CToolTip id="tt61"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.rasterExport = function()</td></tr></table></blockquote>Generates a PNG Data URL based on the current image, then calls &ldquo;exported&rdquo; with an object including the string and any issues found</div></div><div class=CToolTip id="tt62"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getSvgString = function()</td></tr></table></blockquote>Returns the current drawing as raw SVG XML text.</div></div><div class=CToolTip id="tt63"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setSvgString = function(</td><td class=PParameter nowrap>xmlString</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This function sets the current drawing as the input SVG XML.</div></div><div class=CToolTip id="tt64"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.importSvgString = function(</td><td class=PParameter nowrap>xmlString</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This function imports the input SVG XML into the current layer in the drawing</div></div><div class=CToolTip id="tt65"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var identifyLayers = function()</td></tr></table></blockquote>Updates layer system</div></div><div class=CToolTip id="tt66"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.createLayer = function(</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>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 &lsquo;changed&rsquo; handler. </div></div><div class=CToolTip id="tt67"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.deleteCurrentLayer = function()</td></tr></table></blockquote>Deletes the current layer from the drawing and then clears the selection. </div></div><div class=CToolTip id="tt68"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getNumLayers = function()</td></tr></table></blockquote>Returns the number of layers in the current drawing.</div></div><div class=CToolTip id="tt69"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getLayer = function(</td><td class=PParameter nowrap>i</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the name of the ith layer. </div></div><div class=CToolTip id="tt70"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getCurrentLayer = function()</td></tr></table></blockquote>Returns the name of the currently selected layer. </div></div><div class=CToolTip id="tt71"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setCurrentLayer = function(</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the current layer. </div></div><div class=CToolTip id="tt72"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.renameCurrentLayer = function(</td><td class=PParameter nowrap>newname</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Renames the current layer. </div></div><div class=CToolTip id="tt73"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setCurrentLayerPosition = function(</td><td class=PParameter nowrap>newpos</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Changes the position of the current layer to the new value. </div></div><div class=CToolTip id="tt74"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getLayerVisibility = function(</td><td class=PParameter nowrap>layername</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns whether the layer is visible. </div></div><div class=CToolTip id="tt75"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setLayerVisibility = function(</td><td class=PParameter nowrap>layername,</td></tr><tr><td></td><td class=PParameter nowrap>bVisible</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the visibility of the layer. </div></div><div class=CToolTip id="tt76"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.moveSelectedToLayer = function(</td><td class=PParameter nowrap>layername</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Moves the selected elements to layername. </div></div><div class=CToolTip id="tt77"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getLayerOpacity = function(</td><td class=PParameter nowrap>layername</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the opacity of the given layer. </div></div><div class=CToolTip id="tt78"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setLayerOpacity = function(</td><td class=PParameter nowrap>layername,</td></tr><tr><td></td><td class=PParameter nowrap>opacity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the opacity of the given layer. </div></div><div class=CToolTip id="tt79"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.clear = function()</td></tr></table></blockquote>Clears the current document. </div></div><div class=CToolTip id="tt80"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getContentElem = function()</td></tr></table></blockquote>Returns the content DOM element</div></div><div class=CToolTip id="tt81"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getRootElem = function()</td></tr></table></blockquote>Returns the root DOM element</div></div><div class=CToolTip id="tt82"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getSelectedElems = function()</td></tr></table></blockquote>Returns the array with selected DOM elements</div></div><div class=CToolTip id="tt83"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var getResolution = this.getResolution = function()</td></tr></table></blockquote>Returns the current dimensions and zoom level in an object</div></div><div class=CToolTip id="tt84"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getZoom = function()</td></tr></table></blockquote>Returns the current zoom level</div></div><div class=CToolTip id="tt85"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getVersion = function()</td></tr></table></blockquote>Returns a string which describes the revision number of SvgCanvas.</div></div><div class=CToolTip id="tt86"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setUiStrings = function(</td><td class=PParameter nowrap>strs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Update interface strings with given values</div></div><div class=CToolTip id="tt87"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setConfig = function(</td><td class=PParameter nowrap>opts</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Update configuration options with given values</div></div><div class=CToolTip id="tt88"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getDocumentTitle = function()</td></tr></table></blockquote>Returns the current document title or an empty string if not found</div></div><div class=CToolTip id="tt89"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setDocumentTitle = function(</td><td class=PParameter nowrap>newtitle</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds/updates a title element for the document with the given name. </div></div><div class=CToolTip id="tt90"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getEditorNS = function(</td><td class=PParameter nowrap>add</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the editor&rsquo;s namespace URL, optionally adds it to root element</div></div><div class=CToolTip id="tt91"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setResolution = function(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Changes the document&rsquo;s dimensions to the given size</div></div><div class=CToolTip id="tt92"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getOffset = function()</td></tr></table></blockquote>Returns an object with x, y values indicating the svgcontent element&rsquo;s position in the editor&rsquo;s canvas.</div></div><div class=CToolTip id="tt93"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setBBoxZoom = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>editor_w,</td></tr><tr><td></td><td class=PParameter nowrap>editor_h</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the zoom level on the canvas-side based on the given value</div></div><div class=CToolTip id="tt94"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setZoom = function(</td><td class=PParameter nowrap>zoomlevel</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the zoom to the given level</div></div><div class=CToolTip id="tt95"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getMode = function()</td></tr></table></blockquote>Returns the current editor mode string</div></div><div class=CToolTip id="tt96"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setMode = function(</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the editor&rsquo;s mode to the given string</div></div><div class=CToolTip id="tt97"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getColor = function(</td><td class=PParameter nowrap>type</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the current fill/stroke option</div></div><div class=CToolTip id="tt98"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setColor = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>preventUndo</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Change the current stroke/fill color/gradient value</div></div><div class=CToolTip id="tt99"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>var findDefs = function()</td></tr></table></blockquote>Return the document&rsquo;s defs element, create it first if necessary</div></div><div class=CToolTip id="tt100"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var setGradient = this.setGradient = function(</td><td class=PParameter nowrap>type</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Apply the current gradient to selected element&rsquo;s fill or stroke</div></div><div class=CToolTip id="tt101"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var findDuplicateGradient = function(</td><td class=PParameter nowrap>grad</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Check if exact gradient already exists</div></div><div class=CToolTip id="tt102"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setPaint = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>paint</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Set a color/gradient to a fill/stroke</div></div><div class=CToolTip id="tt103"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getStrokeWidth = function()</td></tr></table></blockquote>Returns the current stroke-width value</div></div><div class=CToolTip id="tt104"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setStrokeWidth = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the stroke width for the current selected elements When attempting to set a line&rsquo;s width to 0, this changes it to 1 instead</div></div><div class=CToolTip id="tt105"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setStrokeAttr = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Set the given stroke-related attribute the given value for selected elements</div></div><div class=CToolTip id="tt106"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getOpacity = function()</td></tr></table></blockquote>Returns the current opacity</div></div><div class=CToolTip id="tt107"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setOpacity = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the given opacity to the current selected elements</div></div><div class=CToolTip id="tt108"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getStrokeOpacity = function()</td></tr></table></blockquote>Returns the current stroke opacity</div></div><div class=CToolTip id="tt109"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setPaintOpacity = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>preventUndo</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the current fill/stroke opacity</div></div><div class=CToolTip id="tt110"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.getBlur = function(</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Gets the stdDeviation blur value of the given element</div></div><div class=CToolTip id="tt111"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.setBlurNoUndo = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the stdDeviation blur value on the selected element without being undoable</div></div><div class=CToolTip id="tt112"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.setBlurOffsets = function(</td><td class=PParameter nowrap>filter,</td></tr><tr><td></td><td class=PParameter nowrap>stdDev</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the x, y, with, height values of the filter element in order to make the blur not be clipped. </div></div><div class=CToolTip id="tt113"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>canvas.setBlur = function(</td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>complete</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds/updates the blur filter to the selected element</div></div><div class=CToolTip id="tt114"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getBold = function()</td></tr></table></blockquote>Check whether selected element is bold or not</div></div><div class=CToolTip id="tt115"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setBold = function(</td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Make the selected element bold or normal</div></div><div class=CToolTip id="tt116"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getItalic = function()</td></tr></table></blockquote>Check whether selected element is italic or not</div></div><div class=CToolTip id="tt117"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setItalic = function(</td><td class=PParameter nowrap>i</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Make the selected element italic or normal</div></div><div class=CToolTip id="tt118"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getFontFamily = function()</td></tr></table></blockquote>Returns the current font family</div></div><div class=CToolTip id="tt119"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setFontFamily = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Set the new font family</div></div><div class=CToolTip id="tt120"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getFontSize = function()</td></tr></table></blockquote>Returns the current font size</div></div><div class=CToolTip id="tt121"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setFontSize = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Applies the given font size to the selected element</div></div><div class=CToolTip id="tt122"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.getText = function()</td></tr></table></blockquote>Returns the current text (textContent) of the selected element</div></div><div class=CToolTip id="tt123"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setTextContent = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Updates the text element with the given string</div></div><div class=CToolTip id="tt124"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setImageURL = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the new image URL for the selected image element. </div></div><div class=CToolTip id="tt125"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setRectRadius = function(</td><td class=PParameter nowrap>val</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the rx &amp; ry values to the selected rect element to change its corner radius</div></div><div class=CToolTip id="tt126"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setSegType = function(</td><td class=PParameter nowrap>new_type</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the new segment type to the selected segment(s).</div></div><div class=CToolTip id="tt127"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.convertToPath = function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>getBBox</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Convert selected element to a path, or get the BBox of an element-as-path</div></div><div class=CToolTip id="tt128"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var changeSelectedAttributeNoUndo = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>newValue,</td></tr><tr><td></td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This function makes the changes to the elements. </div></div><div class=CToolTip id="tt129"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>var changeSelectedAttribute = this.changeSelectedAttribute = function(</td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>val,</td></tr><tr><td></td><td class=PParameter nowrap>elems</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>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. </div></div><div class=CToolTip id="tt130"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.deleteSelectedElements = function()</td></tr></table></blockquote>Removes all selected elements from the DOM and adds the change to the history stack</div></div><div class=CToolTip id="tt131"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.groupSelectedElements = function()</td></tr></table></blockquote>Wraps all the selected elements in a group (g) element</div></div><div class=CToolTip id="tt132"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.ungroupSelectedElement = function()</td></tr></table></blockquote>Unwraps all the elements in a selected group (g) element. </div></div><div class=CToolTip id="tt133"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.moveToTopSelectedElement = function()</td></tr></table></blockquote>Repositions the selected element to the bottom in the DOM to appear on top of other elements</div></div><div class=CToolTip id="tt134"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.moveToBottomSelectedElement = function()</td></tr></table></blockquote>Repositions the selected element to the top in the DOM to appear under other elements</div></div><div class=CToolTip id="tt135"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.moveSelectedElements = function(</td><td class=PParameter nowrap>dx,</td></tr><tr><td></td><td class=PParameter nowrap>dy,</td></tr><tr><td></td><td class=PParameter nowrap>undoable</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Moves selected elements on the X/Y axis</div></div><div class=CToolTip id="tt136"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.cloneSelectedElements = function()</td></tr></table></blockquote>Create deep DOM copies (clones) of all selected elements and move them slightly from their originals</div></div><div class=CToolTip id="tt137"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.alignSelectedElements = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>relative_to</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Aligns selected elements</div></div><div class=CToolTip id="tt138"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.updateCanvas = function(</td><td class=PParameter nowrap>w,</td></tr><tr><td></td><td class=PParameter nowrap>h</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Updates the editor canvas width/height/position after a zoom has occurred</div></div><div class=CToolTip id="tt139"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.setBackground = function(</td><td class=PParameter nowrap>color,</td></tr><tr><td></td><td class=PParameter nowrap>url</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Set the background of the editor (NOT the actual document)</div></div><div class=CToolTip id="tt140"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>this.cycleElement = function(</td><td class=PParameter nowrap>next</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Select the next/previous element within the current layer</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>