I need to get a collection of nodes to be dragged at the beginning of the process (if someone curious why - on a large diagram with many links, in order to improve performance, I am finding all links related to the move and hide them for the time of dragging).
If user makes a selection and starts dragging a fraction of a second later, it works. In case of “button down and immediate move” at the time of doStart() method is called diagram.selection is still empty. As I understand, initial button down event is not processed yet. Is there a way to set some kind of a delay before doStart() is called?
DraggingTool is a mouse-move tool – it is in the ToolManager.mouseMoveTools list. That means the mouse down definitely happens before the DraggingTool is started, because the mouse down happens before any mouse move event.
It is actually DraggingTool.doActivate, which is called after doStart, that is responsible for selecting Parts. However, I believe that is not the right time to make the kind of behavior change that you want.
I’m wondering if you really want some sort of non-real-time dragging capability. That’s what you get when you do a control-drag, since what is being dragged then is just a temporary set of copied Parts. But maybe you want something even simpler, such as dragging around a single Part whose appearance is just a partly-translucent image of the DraggingTool.draggedParts collection.
Thank you Walter,
for now I extended doActivate and it works great, but will consider replacement of real dragging parts for a single visual object
Try this: [EDIT: now an extension] Non-Realtime Dragging
That depends on a new tool: [EDIT: now an extension] http://gojs.net/latest/extensions/NonRealtimeDraggingTool.js
Maybe an extension some day? No promises…