DraggingTool$Typings extension

on

Properties

copiedParts Map<Part, DraggingInfo>?

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets the collection of Parts that this tool has copied. The value is a Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part. The value is null when moving instead of copying.
getter/setter pair
copiesEffectiveCollection bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether for a copying operation the extended selection is copied or only the selected parts. The default value is true. Setting this property does not raise any events.
getter/setter pair
copyCursor String

Available on DraggingTool, provided by the DraggingTool$Typings extension

The cursor to show when a drop is allowed and will result in a copy. This defaults to 'copy'. Read more about cursors at Diagram#currentCursor
getter/setter pair
currentPart Part?

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets the Part found at the mouse point. This is normally set by a call to #standardMouseSelect.
getter/setter pair
delay num

Available on DraggingTool, provided by the DraggingTool$Typings extension

On touch gestures only, this property gets or sets the time in milliseconds for which the mouse must be stationary before this tool can be started. The default value is 100 milliseconds. Setting this property does not raise any events.
getter/setter pair
draggedParts Map<Part, DraggingInfo>?

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets the collection of Parts being moved. The value is a Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part.
getter/setter pair
draggingParts Set<Part>

Available on DraggingTool, provided by the DraggingTool$Typings extension

(undocumented) This read-only property returns a Set that holds all of the Parts that are currently being dragged for either copying or moving.
getter/setter pair
dragOptions DraggingOptions

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets the DraggingTool's DraggingOptions instance, which controls several dragging properties.
getter/setter pair

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether the user can drag a single Link, disconnecting it from its connected nodes and possibly connecting it to valid ports when the link is dropped. The default value is false. Setting this property does not raise any events.
getter/setter pair
dragsTree bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether moving or copying a node also includes all of the node's tree children and their descendants, along with the links to those additional nodes. The default value is false. Setting this property does not raise any events.
getter/setter pair
gridSnapCellSize Size

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets the size of the grid cell used when snapping during a drag if the value of #isGridSnapEnabled is true. By default this property is the Size(NaN, NaN), which causes this tool to use the Panel#gridCellSize value of the Diagram#grid. Setting this property does not raise any events.
getter/setter pair
gridSnapCellSpot Spot

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets the Spot that specifies what point in the grid cell dragged parts snap to, if the value of #isGridSnapEnabled is true. By default this property is Spot.TopLeft: node locations will snap exactly to the grid point. Setting this property does not raise any events.
getter/setter pair
gridSnapOrigin Point

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets the snapping grid's origin point, in document coordinates, if the value of #isGridSnapEnabled is true. By default this property is the Point(NaN, NaN), which causes this tool to use the Panel#gridOrigin value from the Diagram#grid. Setting this property does not raise any events.
getter/setter pair
isComplexRoutingRealtime bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether link routing takes some short-cuts during dragging. When false Links whose routing is AvoidsNodes are not routed to avoid Nodes, in order to improve dragging performance. The default value is true.
getter/setter pair
isCopyEnabled bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether for any internal copying operation is permitted by control-drag-and-drop. This property affects the behavior of #mayCopy, but does not affect whether copied objects may be dropped into this diagram from a different diagram.
getter/setter pair
isGridSnapEnabled bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether the DraggingTool snaps objects to grid points. Whether the snapping movement of the dragged parts occurs during the drag or only upon a drop is determined by the value of #isGridSnapRealtime.
getter/setter pair
isGridSnapRealtime bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets whether the DraggingTool snaps objects to grid points during the drag. This property is ignored unless #isGridSnapEnabled is true. By default this property is true; when false parts are only snapped to grid locations upon the drop (i.e. mouse-up). Setting this property does not raise any events.
getter/setter pair
moveCursor String

Available on DraggingTool, provided by the DraggingTool$Typings extension

The cursor to show when a drop is allowed and will result in a move. This defaults to the empty string, which refers to the Diagram#defaultCursor. Read more about cursors at Diagram#currentCursor
getter/setter pair
nodropCursor String

Available on DraggingTool, provided by the DraggingTool$Typings extension

The cursor to show when a drop is not allowed. This defaults to 'no-drop'. Read more about cursors at Diagram#currentCursor
getter/setter pair
startPoint Point

Available on DraggingTool, provided by the DraggingTool$Typings extension

Gets or sets the mouse point from which parts start to move. The value is a Point in document coordinates. This property is normally set to the diagram's mouse-down point in #doActivate, but may be set to a different point if parts are being copied from a different control. Setting this property does not raise any events.
getter/setter pair

Methods

canStart() bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

This tool can run if the diagram allows selection and moves/copies/dragging-out, if the mouse has moved far enough away to be a drag and not a click, and if #findDraggablePart has found a selectable part at the mouse-down point.
computeEffectiveCollection(Iterable<Part> parts, DraggingOptions options) Map<Part, DraggingInfo>

Available on DraggingTool, provided by the DraggingTool$Typings extension

This just calls CommandHandler#computeEffectiveCollection. The implementation of this method was moved to CommandHandler for 2.0.
computeMove(Part n, Point newloc, [Map<Part, DraggingInfo>? draggedparts, Point? result]) Point

Available on DraggingTool, provided by the DraggingTool$Typings extension

This method computes the new location for a Node or simple Part, given a new desired location and an optional Map of dragged parts, taking any grid-snapping into consideration, any Part#dragComputation function, and any Part#minLocation and Part#maxLocation.
doActivate() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Start the dragging operation. This calls #computeEffectiveCollection and saves the result as #draggedParts.
doCancel() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Abort any dragging operation.
doDeactivate() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Stop the dragging operation by stopping the transaction and cleaning up any temporary state.
doDragOver(Point pt, [GraphObject? obj]) → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Perform any additional side-effects during a drag, whether an internal move or copy or an external drag, that may affect the existing non-moved object(s).
doDropOnto(Point pt, [GraphObject? obj]) → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Perform any additional side-effects after a drop, whether an internal move or copy or an external drop, that may affect the existing non-moved object(s).
doKeyDown() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Handle switching between copying and moving modes as the Control/Option key is pressed or released.
doKeyUp() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Handle switching between copying and moving modes as the Control/Option key is pressed or released.
doMouseMove() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Move the #draggedParts (or if copying, the #copiedParts) to follow the current mouse point.
doMouseUp() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

On a mouse-up finish moving or copying the effective selection.
findDraggablePart() Part?

Available on DraggingTool, provided by the DraggingTool$Typings extension

Return the selectable and movable/copyable Part at the mouse-down point. This is called by #canStart to decide if this tool is ready to run.
findDragOverObject(Point pt) GraphObject?

Available on DraggingTool, provided by the DraggingTool$Typings extension

(undocumented)
mayCopy() bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

This predicate is true when the diagram allows objects to be copied and inserted, and some object in the selection is copyable, and the user is holding down the Control key (Option key on Mac).
mayMove() bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

This predicate is true when the diagram allows objects to be moved, and some object in the selection is movable.
moveParts(Map<Part, DraggingInfo> parts, Point offset, [bool? check]) → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

Move a collection Map of Parts by a given offset.
simulatedMouseMove(dynamic e, Point modelpt, [Diagram? overdiag]) bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

(undocumented) @expose @param {Event} e @param {Point} modelpt @param {Diagram} overdiag the diagram attached to the target of the mouse move event, if any. @return {boolean}
simulatedMouseUp(dynamic e, Point modelpt, [Diagram? curdiag]) bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

(undocumented) @expose @param {Event} e @param {Point} modelpt @param {Diagram} curdiag @return {boolean}
standardMouseSelect() → void

Available on DraggingTool, provided by the DraggingTool$Typings extension

This override prevents the Control modifier unselecting an already selected part. This also remembers the selectable #currentPart at the current mouse point.
stopTransaction() bool

Available on DraggingTool, provided by the DraggingTool$Typings extension

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.