LinkReshapingTool$Typings extension

on

Properties

This read-only property returns the Link that is being routed manually.
getter/setter pair
handle GraphObject?
Returns the GraphObject that is the tool handle being dragged by the user. This will be contained by an Adornment whose category is "LinkReshaping". Its Adornment#adornedPart is the same as the #adornedLink. This is normally set by #doActivate, remembering the result of the call to Tool#findToolHandleAt.
getter/setter pair
handleArchetype GraphObject?
Gets or sets a small GraphObject that is copied as a reshape handle at each movable point in the selected link's route. By default this is a Shape that is a small blue rectangle. Setting this property does not raise any events.
getter/setter pair
midHandleArchetype GraphObject?
Gets or sets a small GraphObject that is copied as a resegment handle at each mid-point in the selected Link's route. By default this is a Shape that is a small blue diamond. Setting this property does not raise any events.
getter/setter pair
originalPoint Point
This read-only property returns the Point that was the original location of the handle that is being dragged to reshape the Link.
getter/setter pair
originalPoints List<Point>
This read-only property returns the List of Points that was the original route of the Link that is being reshaped. This List should not be modified; its value is indeterminate until a reshaping has been activated.
getter/setter pair

Methods

canStart() bool
This tool may run when there is a mouse-down event on a reshape handle.
computeReshape(Point p) Point
This is called by #doMouseMove and #doMouseUp to limit the input point before calling #reshape.
doActivate() → void
Start reshaping, if #findToolHandleAt finds a reshape handle at the mouse down point.
doCancel() → void
Restore the link route to be the original points and stop this tool.
doDeactivate() → void
This stops the current reshaping operation with the link route shaped the way it is.
doMouseMove() → void
Call #reshape with a new point determined by the mouse to change the route of the #adornedLink.
doMouseUp() → void
Reshape the route with a point based on the most recent mouse point by calling #reshape, and then raise a "LinkReshaped" DiagramEvent before stopping this tool.
getResegmentingPoint() Point
(undocumented) If the handle clicked during activation was a resegment handle, return the point at which to start a new segment. By default this returns the center of the handle that was clicked. Please read the Introduction page on Extensions for how to override methods and how to call this base method.
getReshapingBehavior(GraphObject obj) EnumValue
Get the permitted reshaping behavior for a particular reshape handle.
makeAdornment(GraphObject pathshape) Adornment?
(undocumented) @expose @param {GraphObject} pathshape @return {Adornment}
makeHandle(GraphObject pathshape, num idx) GraphObject?
(undocumented) Create and return a GraphObject that the user can "grab" to relink the selected Link. By default this returns a copy of #handleArchetype, a Shape that is a small blue rectangle. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {GraphObject} pathshape the GraphObject path of the link being reshaped. @param {number} idx the index of the route point to be moved. @return {GraphObject}
makeResegmentHandle(GraphObject pathshape, num idx) GraphObject?
(undocumented) Create and return a GraphObject that the user can "grab" to add a segment to the selected Link. By default this returns a copy of #midHandleArchetype, a Shape that is a small blue diamond. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {GraphObject} pathshape the GraphObject path of the link being reshaped. @param {number} idx the index of the route point to be moved. @return {GraphObject}
reshape(Point newPoint) → void
Change the route of the #adornedLink by moving the point corresponding to the current #handle to be at the given Point. This is called by #doMouseMove and #doMouseUp with the result of calling #computeReshape to constrain the input point.
setReshapingBehavior(GraphObject obj, EnumValue behavior) → void
Set the permitted reshaping behavior for a particular reshape handle.
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 reshape handles at each of the interesting points of the link's route, if the link is selected and visible and if Part#canReshape is true.