RotatingTool$Typings extension

on

Properties

adornedObject GraphObject?
Gets the GraphObject that is being rotated. This may be the same object as the selected Part or it may be contained within that Part.
getter/setter pair
handle GraphObject?
This read-only property returns the GraphObject that is the tool handle being dragged by the user. This will be contained by an Adornment whose category is "RotatingTool". Its Adornment#adornedObject is the same as the #adornedObject.
getter/setter pair
handleAngle num
Gets or sets the spot to locate the Adornment for the rotation handle when it does not have a Placeholder. This assumes the Adornment's location will be at the center of the rotation handle.
getter/setter pair
handleArchetype GraphObject?
Gets or sets a small GraphObject that is copied as a rotation handle for the selected part. By default this is a Shape that is a small yellow circle. Setting this property does not raise any events.
getter/setter pair
handleDistance num
Gets or sets the spot to locate the Adornment at a particular distance from the #adornedObject. This assumes the Adornment's location will be at the center of the rotation handle.
getter/setter pair
originalAngle num
This read-only property returns the angle that was the original value of the GraphObject#angle of the GraphObject that is being rotated. The value is invalid when this tool is not active.
getter/setter pair
rotationPoint Point
Gets or sets the Point at which the axis of the rotation should be. #doActivate saves here the value returned by the call to #computeRotationPoint. The value is invalid when this tool is not active.
getter/setter pair
snapAngleEpsilon num
Gets or sets the the closeness to a desired angle at which the angle is "snapped to".
getter/setter pair
snapAngleMultiple num
Gets or sets the preferred angles for the selected object.
getter/setter pair

Methods

canStart() bool
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.
computeRotate(Point newPoint) num
Compute the new angle given a point. If the Shift key is pressed, this method ignores the #snapAngleMultiple and #snapAngleEpsilon.
computeRotationPoint(GraphObject obj) Point
Compute the Point about which things should rotate. This is called when this tool is activated and sometimes when updating the Adornment. The value of the call is remembered as #rotationPoint. @expose @param {GraphObject} obj the Part#rotateObject @return {Point}
doActivate() → void
Capture the mouse, remember the original GraphObject#angle, and start a transaction.
doCancel() → void
Restore the original GraphObject#angle of the adorned object.
doDeactivate() → void
Stop the current transaction, forget the #handle and #adornedObject, and release the mouse.
doMouseMove() → void
Call #rotate with a new angle determined by the current mouse point. This determines the new angle by calling #computeRotate.
doMouseUp() → void
Call #rotate with an angle based on the most recent mouse point, commit the transaction, and raise the "PartRotated" DiagramEvent.
makeAdornment(GraphObject rotateObj) Adornment?
(undocumented) Create and return an Adornment that lets the user grab a handle to rotate an object in the selected part. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {GraphObject} rotateObj the GraphObject being rotated. @return {Adornment}
rotate(num newangle) → void
Change the angle of the selected part's Part#rotateObject. This modifies its GraphObject#angle.
stopTransaction() bool
This calls the super Tool#stopTransaction method, and if the result is true, attempts to optimize the transaction by removing all changes except the first and last by calling Transaction#optimize.
updateAdornments(Part part) → void
Show an Adornment with a rotate handle at a point to the side of the adorned object if the part is selected and visible and if Part#canRotate() is true.