UNPKG

markgojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

1,629 lines (573 loc) 53.6 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>GoJS&reg; RotatingTool Class</title> <script src="../../assets/js/jquery.min.js"></script> <script src="../../assets/js/bootstrap.min.js"></script> <script src="../../assets/js/highlight.js"></script> <script src="../../assets/js/api.js"></script> <script src="../../assets/js/fuse.min.js"></script> <link href="../../assets/css/bootstrap.min.css" rel="stylesheet" > <!-- custom CSS after bootstrap --> <link href="../../assets/css/main.css" rel="stylesheet" type="text/css"/> <link href="../../assets/css/api.css" rel="stylesheet" type="text/css"/> <!--<link rel="stylesheet" href="../../assets/css/api.css" type="text/css" media="all" />--> <link rel="stylesheet" href="../../assets/css/highlight.css" type="text/css" media="all" /> </head> <body> <!-- non-fixed navbar --> <nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top"> <div class="container-fluid"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#navbar"> <a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="../../index.html">Home</a></li> <li><a href="../../learn/index.html">Learn</a></li> <li><a href="../../samples/index.html">Samples</a></li> <li><a href="../../intro/index.html">Intro</a></li> <li><a href="../../api/index.html">API</a></li> <li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li> <li><a href="../../download.html">Download</a></li> <li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li> <li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li> <li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li> <li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container-fluid"> <!-- ============================== classes index ============================ --> <div id="navindex" class="col-md-2"> <!-- begin publish.classesIndex --> <!-- <div><a href="../index.html">GoJS Class Index</a></div> --> <div class="sidebar-nav"> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#DiagramNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#DiagramNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Diagram Classes</span> </div> </div> <div id="DiagramNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a></li> <li><a href="../symbols/AnimationManager.html" class="linkConstructor">AnimationManager</a></li> <li><a href="../symbols/CommandHandler.html" class="linkConstructor">CommandHandler</a></li> <li><a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a></li> <li><a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a></li> <li><a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a></li> <li><a href="../symbols/Group.html" class="linkConstructor">Group</a></li> <li><a href="../symbols/InputEvent.html" class="linkConstructor">InputEvent</a></li> <li><a href="../symbols/Layer.html" class="linkConstructor">Layer</a></li> <li><a href="../symbols/Link.html" class="linkConstructor">Link</a></li> <li><a href="../symbols/Node.html" class="linkConstructor">Node</a></li> <li><a href="../symbols/Overview.html" class="linkConstructor">Overview</a></li> <li><a href="../symbols/Palette.html" class="linkConstructor">Palette</a></li> <li><a href="../symbols/Panel.html" class="linkConstructor">Panel</a></li> <li><a href="../symbols/Part.html" class="linkConstructor">Part</a></li> <li><a href="../symbols/Picture.html" class="linkConstructor">Picture</a></li> <li><a href="../symbols/Placeholder.html" class="linkConstructor">Placeholder</a></li> <li><a href="../symbols/RowColumnDefinition.html" class="linkConstructor">RowColumnDefinition</a></li> <li><a href="../symbols/Shape.html" class="linkConstructor">Shape</a></li> <li><a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#GeometryNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#GeometryNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Geometry Classes</span> </div> </div> <div id="GeometryNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Brush.html" class="linkConstructor">Brush</a></li> <li><a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a></li> <li><a href="../symbols/Margin.html" class="linkConstructor">Margin</a></li> <li><a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a></li> <li><a href="../symbols/PathSegment.html" class="linkConstructor">PathSegment</a></li> <li><a href="../symbols/Point.html" class="linkConstructor">Point</a></li> <li><a href="../symbols/Rect.html" class="linkConstructor">Rect</a></li> <li><a href="../symbols/Size.html" class="linkConstructor">Size</a></li> <li><a href="../symbols/Spot.html" class="linkConstructor">Spot</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#ModelNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ModelNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Model Classes</span> </div> </div> <div id="ModelNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Binding.html" class="linkConstructor">Binding</a></li> <li><a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a></li> <li><a href="../symbols/GraphLinksModel.html" class="linkConstructor">GraphLinksModel</a></li> <li><a href="../symbols/Model.html" class="linkConstructor">Model</a></li> <li><a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a></li> <li><a href="../symbols/TreeModel.html" class="linkConstructor">TreeModel</a></li> <li><a href="../symbols/UndoManager.html" class="linkConstructor">UndoManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#LayoutNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#LayoutNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Layout Classes</span> </div> </div> <div id="LayoutNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/CircularLayout.html" class="linkConstructor">CircularLayout</a></li> <li><a href="../symbols/ForceDirectedLayout.html" class="linkConstructor">ForceDirectedLayout</a></li> <li><a href="../symbols/GridLayout.html" class="linkConstructor">GridLayout</a></li> <li><a href="../symbols/LayeredDigraphLayout.html" class="linkConstructor">LayeredDigraphLayout</a></li> <li><a href="../symbols/Layout.html" class="linkConstructor">Layout</a></li> <li><a href="../symbols/LayoutNetwork.html" class="linkConstructor">LayoutNetwork</a></li> <li><a href="../symbols/TreeLayout.html" class="linkConstructor">TreeLayout</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#ToolNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ToolNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Tool Classes</span> </div> </div> <div id="ToolNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/ActionTool.html" class="linkConstructor">ActionTool</a></li> <li><a href="../symbols/ClickCreatingTool.html" class="linkConstructor">ClickCreatingTool</a></li> <li><a href="../symbols/ClickSelectingTool.html" class="linkConstructor">ClickSelectingTool</a></li> <li><a href="../symbols/ContextMenuTool.html" class="linkConstructor">ContextMenuTool</a></li> <li><a href="../symbols/DraggingTool.html" class="linkConstructor">DraggingTool</a></li> <li><a href="../symbols/DragSelectingTool.html" class="linkConstructor">DragSelectingTool</a></li> <li><a href="../symbols/HTMLInfo.html" class="linkConstructor">HTMLInfo</a></li> <li><a href="../symbols/LinkingBaseTool.html" class="linkConstructor">LinkingBaseTool</a></li> <li><a href="../symbols/LinkingTool.html" class="linkConstructor">LinkingTool</a></li> <li><a href="../symbols/LinkReshapingTool.html" class="linkConstructor">LinkReshapingTool</a></li> <li><a href="../symbols/PanningTool.html" class="linkConstructor">PanningTool</a></li> <li><a href="../symbols/RelinkingTool.html" class="linkConstructor">RelinkingTool</a></li> <li><a href="../symbols/ResizingTool.html" class="linkConstructor">ResizingTool</a></li> <li><a href="../symbols/RotatingTool.html" class="linkConstructor">RotatingTool</a></li> <li><a href="../symbols/TextEditingTool.html" class="linkConstructor">TextEditingTool</a></li> <li><a href="../symbols/Tool.html" class="linkConstructor">Tool</a></li> <li><a href="../symbols/ToolManager.html" class="linkConstructor">ToolManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#CollectionNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#CollectionNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Collection Classes</span> </div> </div> <div id="CollectionNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Iterable.html" class="linkConstructor">Iterable</a></li> <li><a href="../symbols/Iterator.html" class="linkConstructor">Iterator</a></li> <li><a href="../symbols/List.html" class="linkConstructor">List</a></li> <li><a href="../symbols/Map.html" class="linkConstructor">Map</a></li> <li><a href="../symbols/Set.html" class="linkConstructor">Set</a></li> </ul> </div> </div> </div> <!-- /class="sidebar-nav --> <!-- end publish.classesIndex --> </div> <div id="contentBody" class="col-md-10"> <div class="searchsumm"> <div class="table-wrap"> <div class="table-cell" id="apisearch" data-base="../"> <div class="title">Search API</div> <div class="field"> <label for="search-field" class="search-icon"></label> <input id="search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> </div> <div class="table-cell" id="apisumm"> <input type="checkbox" id="showsumms" /> <label class="apisumms" for="showsumms">Show Summaries</label> </div> </div> </div> <!-- ============================== header ================================= --> <div id="header" class="fineprint"> <b>GoJS</b>&reg; Diagramming Components<br/>version 1.8.36 for JavaScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software&reg;</a> </div> <!-- ============================== class title ============================ --> <h2 class="classTitle"> Class RotatingTool </h2> <!-- ============================== class summary ========================== --> <p class="classsummary"> <span class="extends"> Extends <a href="../symbols/Tool.html" class="linkConstructor">Tool</a>.</span> The RotatingTool is used to interactively change the <a href="../symbols/GraphObject.html#angle" class="linkProperty">GraphObject.angle</a> of a <a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a> by setting its <a href="../symbols/GraphObject.html#angle" class="linkProperty">GraphObject.angle</a> property. You may want to save the angle to the model by using a TwoWay <a href="../symbols/Binding.html" class="linkConstructor">Binding</a> on the "angle" property of the GraphObject that is named by <a href="../symbols/Part.html#rotateObjectName" class="linkProperty">Part.rotateObjectName</a>. <p> This tool allows the user to rotate the <a href="../symbols/Part.html#rotateObject" class="linkProperty">Part.rotateObject</a> of the selected <a href="../symbols/Part.html" class="linkConstructor">Part</a>. The <a href="../symbols/Part.html" class="linkConstructor">Part</a> must be <a href="../symbols/Part.html#rotatable" class="linkProperty">Part.rotatable</a>, which is false by default. Normally this works with <a href="../symbols/Part.html" class="linkConstructor">Part</a>s or <a href="../symbols/Node.html" class="linkConstructor">Node</a>s; it does not make sense for whole <a href="../symbols/Link.html" class="linkConstructor">Link</a>s or <a href="../symbols/Link.html#path" class="linkProperty">Link.path</a>s, so if you want to rotate a label on a Link, make sure to name that label and refer to it as the <a href="../symbols/Part.html#rotateObjectName" class="linkProperty">Part.rotateObjectName</a>. <p> You can limit the permitted angles by setting <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> and <a href="../symbols/RotatingTool.html#snapAngleEpsilon" class="linkProperty">snapAngleEpsilon</a>. For example, if you want to permit only angles that are multiples of 90 degrees, set <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> to 90 and <a href="../symbols/RotatingTool.html#snapAngleEpsilon" class="linkProperty">snapAngleEpsilon</a> to 45. Pressing the Shift key ignores these properties. <p> This tool makes use of an <a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a> that includes a rotation handle. It is shown when the selected <a href="../symbols/Part.html" class="linkConstructor">Part</a> is <a href="../symbols/Part.html#rotatable" class="linkProperty">Part.rotatable</a>. The rotate handle is normally a copy of <a href="../symbols/RotatingTool.html#handleArchetype" class="linkProperty">RotatingTool.handleArchetype</a>. unless you specify a custom rotate Adornment by setting <a href="../symbols/Part.html#rotateAdornmentTemplate" class="linkProperty">Part.rotateAdornmentTemplate</a>. <p> This tool conducts a transaction while the tool is active. A successful rotation will result in a "PartRotated" <a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a> and a "Rotating" transaction. <p class="boxread"> For customizing the RotatingTool, see <a href="../../intro/tools.html#RotatingTool">Introduction to the RotatingTool</a>. </p> <!-- ============================== constructor summary ==================== --> <h2 id="constructor" class="summaryCaption"> Constructor <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the constructor documented in the class RotatingTool."> <thead> <tr> <th scope="col" class="name">Name</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr> <td class="name" > <div class="name"> RotatingTool() </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>You do not normally need to create an instance of this tool because one already exists as the <a href="../symbols/ToolManager.html#rotatingTool" class="linkProperty">ToolManager.rotatingTool</a>, which you can modify.<span class="nodetails" id="xconRotatingTool"><a class="morelink" onclick="hst('conRotatingTool')">More...</a></span> <span class="details" id="conRotatingTool"> </span><div class="details" id="dconRotatingTool"><p> The <a href="../symbols/Tool.html#name" class="linkProperty">Tool.name</a> of this tool is "Rotating".</div> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <!-- ============================== properties summary ===================== --> <h2 class="summaryCaption">Properties<span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the properties documented in the class RotatingTool."> <thead> <tr> <th scope="col" class="name">Name, Value Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="adornedObject" > <td class="name"> <div class="name"> adornedObject </div> <div class="attributes"> <span class="light">{<a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets the <a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a> that is being rotated.<span class="nodetails" id="xpropadornedObject"><a class="morelink" onclick="hst('propadornedObject')">More...</a></span> <span class="details" id="propadornedObject"> This may be the same object as the selected <a href="../symbols/Part.html" class="linkConstructor">Part</a> or it may be contained within that Part. </span><div class="details" id="dpropadornedObject"><p> This property is also settable, but should only be set when overriding functions in RotatingTool, and not during normal operation.</div> </div> </td> </tr> <tr id="handle" > <td class="name"> <div class="name"> handle </div> <div class="attributes"> <span class="light">{<a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>This read-only property returns the <a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a> that is the tool handle being dragged by the user.<span class="nodetails" id="xprophandle"><a class="morelink" onclick="hst('prophandle')">More...</a></span> <span class="details" id="prophandle"> This will be contained by an <a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a> whose category is "RotatingTool". Its <a href="../symbols/Adornment.html#adornedObject" class="linkProperty">Adornment.adornedObject</a> is the same as the <a href="../symbols/RotatingTool.html#adornedObject" class="linkProperty">adornedObject</a>.</span> </div> </td> </tr> <tr id="handleArchetype" > <td class="name"> <div class="name"> handleArchetype </div> <div class="attributes"> <span class="light">{<a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets a small GraphObject that is copied as a rotation handle for the selected part.<span class="nodetails" id="xprophandleArchetype"><a class="morelink" onclick="hst('prophandleArchetype')">More...</a></span> <span class="details" id="prophandleArchetype"> By default this is a <a href="../symbols/Shape.html" class="linkConstructor">Shape</a> that is a small yellow circle. Setting this property does not raise any events. </span><div class="details" id="dprophandleArchetype"><p> Here is an example of changing the default handle to be green "X": <pre class="javascript"> myDiagram.toolManager.rotatingTool.handleArchetype = $(go.Shape, "XLine", { width: 8, height: 8, stroke: "green", fill: "transparent" }); </pre> <p> This property is ignored when a custom rotating Adornment is specified as the <a href="../symbols/Part.html#rotateAdornmentTemplate" class="linkProperty">Part.rotateAdornmentTemplate</a>.</div> </div> </td> </tr> <tr id="originalAngle" > <td class="name"> <div class="name"> originalAngle </div> <div class="attributes"> <span class="light">{number}</span> <span class="since" title="since">1.1</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>This read-only property returns the angle that was the original value of the <a href="../symbols/GraphObject.html#angle" class="linkProperty">GraphObject.angle</a> of the GraphObject that is being rotated. </div> </td> </tr> <tr id="snapAngleEpsilon" > <td class="name"> <div class="name"> snapAngleEpsilon </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the the closeness to a desired angle at which the angle is "snapped to".<span class="nodetails" id="xpropsnapAngleEpsilon"><a class="morelink" onclick="hst('propsnapAngleEpsilon')">More...</a></span> <span class="details" id="propsnapAngleEpsilon"> </span><div class="details" id="dpropsnapAngleEpsilon"><p> The default value is 2 degrees, meaning that any angle within 2 degrees of a multiple of the <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> automatically snaps to that multiple. Values are limited to half of the <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a>; such values restrict user selected angles only to exact multiples of <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> -- no other angles between them. Setting this property does not raise any events.</div> </div> </td> </tr> <tr id="snapAngleMultiple" > <td class="name"> <div class="name"> snapAngleMultiple </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the preferred angles for the selected object.<span class="nodetails" id="xpropsnapAngleMultiple"><a class="morelink" onclick="hst('propsnapAngleMultiple')">More...</a></span> <span class="details" id="propsnapAngleMultiple"> </span><div class="details" id="dpropsnapAngleMultiple"><p> The default value is 45 degrees, meaning that angles that are multiples of 45 degrees are automatically preferred, if the actual angle is close to that multiple. The closeness is determined by the <a href="../symbols/RotatingTool.html#snapAngleEpsilon" class="linkProperty">snapAngleEpsilon</a> property. A value of zero for <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> results in no snapping at all. Setting this property does not raise any events.</div> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <dl class="inheritsList"> <dt>Properties borrowed from class <a href="../symbols/Tool.html" class="linkConstructor">Tool</a>: </dt><dd><a href="../symbols/Tool.html#diagram" class="linkProperty">diagram</a>, <a href="../symbols/Tool.html#isActive" class="linkProperty">isActive</a>, <a href="../symbols/Tool.html#isEnabled" class="linkProperty">isEnabled</a>, <a href="../symbols/Tool.html#name" class="linkProperty">name</a>, <a href="../symbols/Tool.html#transactionResult" class="linkProperty">transactionResult</a></dd> </dl> <!-- ============================== methods summary ======================== --> <h2 class="summaryCaption">Method <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the methods documented in the class RotatingTool."> <thead> <tr> <th scope="col" class="name">Name, Return Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="canStart"> <td class="name"> <div class="name"> canStart() </div> <div class="attributes"> <span class="light">{boolean}</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>This tool may run when there is a mouse-down event on a rotate handle, the diagram is not read-only and it allows rotation, the left mouse button is being used, and this tool's adornment's rotate handle is at the current mouse point.<span class="nodetails" id="xmethcanStart"><a class="morelink" onclick="hst('methcanStart')">More...</a></span> <span class="details" id="methcanStart"> </span><div class="details" id="dmethcanStart"><p> This method may be overridden.</div> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{boolean}</span> </dt> </dl> </div> </td> </tr> <tr id="computeRotate"> <td class="name"> <div class="name"> computeRotate(newPoint) </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Compute the new angle given a point.<span class="nodetails" id="xmethcomputeRotate"><a class="morelink" onclick="hst('methcomputeRotate')">More...</a></span> <span class="details" id="methcomputeRotate"> If the Shift key is pressed, this method ignores the <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> and <a href="../symbols/RotatingTool.html#snapAngleEpsilon" class="linkProperty">snapAngleEpsilon</a>. </span><div class="details" id="dmethcomputeRotate"><p> If the angle is close (by <a href="../symbols/RotatingTool.html#snapAngleEpsilon" class="linkProperty">snapAngleEpsilon</a> degrees) to a multiple of <a href="../symbols/RotatingTool.html#snapAngleMultiple" class="linkProperty">snapAngleMultiple</a> degrees, make it exactly that multiple. <p> This method may be overridden. Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{<a href="../symbols/Point.html" class="linkConstructor">Point</a>}</span> <b>newPoint</b> </dt> <dd>in document coordinates.</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{number}</span> the new angle, in degrees.</dt> </dl> </div> </td> </tr> <tr id="doActivate"> <td class="name"> <div class="name"> doActivate() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Capture the mouse, remember the original <a href="../symbols/GraphObject.html#angle" class="linkProperty">GraphObject.angle</a>, and start a transaction. </div> </td> </tr> <tr id="doCancel"> <td class="name"> <div class="name"> doCancel() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Restore the original <a href="../symbols/GraphObject.html#angle" class="linkProperty">GraphObject.angle</a> of the adorned object. </div> </td> </tr> <tr id="doDeactivate"> <td class="name"> <div class="name"> doDeactivate() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Stop the current transaction and release the mouse. </div> </td> </tr> <tr id="doMouseMove"> <td class="name"> <div class="name"> doMouseMove() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Call <a href="../symbols/RotatingTool.html#rotate" class="linkMethod">rotate</a> with a new angle determined by the current mouse point.<span class="nodetails" id="xmethdoMouseMove"><a class="morelink" onclick="hst('methdoMouseMove')">More...</a></span> <span class="details" id="methdoMouseMove"> This determines the new angle by calling <a href="../symbols/RotatingTool.html#computeRotate" class="linkMethod">computeRotate</a>.</span> </div> </td> </tr> <tr id="doMouseUp"> <td class="name"> <div class="name"> doMouseUp() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Call <a href="../symbols/RotatingTool.html#rotate" class="linkMethod">rotate</a> with an angle based on the most recent mouse point, commit the transaction, and raise the "PartRotated" <a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a>. </div> </td> </tr> <tr id="rotate"> <td class="name"> <div class="name"> rotate(newangle) </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Change the angle of the selected part's <a href="../symbols/Part.html#rotateObject" class="linkProperty">Part.rotateObject</a>.<span class="nodetails" id="xmethrotate"><a class="morelink" onclick="hst('methrotate')">More...</a></span> <span class="details" id="methrotate"> This modifies its <a href="../symbols/GraphObject.html#angle" class="linkProperty">GraphObject.angle</a>. </span><div class="details" id="dmethrotate"><p> This method may be overridden. Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{number}</span> <b>newangle</b> </dt> <dd>in degrees.</dd> </dl> </div> </td> </tr> <tr id="updateAdornments"> <td class="name"> <div class="name"> updateAdornments(part) </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Show an <a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a> with a rotate handle at a point to the side of the adorned object if the part is selected and visible and if <a href="../symbols/Part.html#canRotate" class="linkMethod">Part.canRotate</a>() is true.<span class="nodetails" id="xmethupdateAdornments"><a class="morelink" onclick="hst('methupdateAdornments')">More...</a></span> <span class="details" id="methupdateAdornments"> </span><div class="details" id="dmethupdateAdornments"><p> This method may be overridden. Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</div> <dl class="deta