DraggingTool$Typings extension

on

Properties

copiedParts Map<Part, DraggingInfo>?
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
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
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?
Gets the Part found at the mouse point. This is normally set by a call to #standardMouseSelect.
getter/setter pair
delay num
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>?
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>
(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
Gets or sets the DraggingTool's DraggingOptions instance, which controls several dragging properties.
getter/setter pair
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
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
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
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
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
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
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
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
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
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
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
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
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>
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
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
Start the dragging operation. This calls #computeEffectiveCollection and saves the result as #draggedParts.
doCancel() → void
Abort any dragging operation.
doDeactivate() → void
Stop the dragging operation by stopping the transaction and cleaning up any temporary state.
doDragOver(Point pt, [GraphObject? obj]) → void
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
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
Handle switching between copying and moving modes as the Control/Option key is pressed or released.
doKeyUp() → void
Handle switching between copying and moving modes as the Control/Option key is pressed or released.
doMouseMove() → void
Move the #draggedParts (or if copying, the #copiedParts) to follow the current mouse point.
doMouseUp() → void
On a mouse-up finish moving or copying the effective selection.
findDraggablePart() Part?
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?
(undocumented)
mayCopy() bool
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
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
Move a collection Map of Parts by a given offset.
simulatedMouseMove(dynamic e, Point modelpt, [Diagram? overdiag]) bool
(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
(undocumented) @expose @param {Event} e @param {Point} modelpt @param {Diagram} curdiag @return {boolean}
standardMouseSelect() → void
This override prevents the Control modifier unselecting an already selected part. This also remembers the selectable #currentPart at the current mouse point.
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.