How to know if a external node dragging has entered diagram?

Hi, We have a system where palette is not directly accessible from main diagram events or initializations, When a pallete node is dragged we can use doActivate event to know there is a dragging event started but this is only for the palette and not the main diagram, When it enters the main diagram, is there a way to find that there is a dragging event started or in progress from the palette?

Something similar to ExternalObjectsDropped which fires when there is a object is dropped from the palette, is there something like ExternalObjectsBeingDragged kind of event to know that an external object that has entered the diagram while being dragged?

You might want to read the recent related discussion at Dragging between two Diagrams with a Custom Dragging Tool - #10 by walter

In your case you could override the target diagram’s DraggingTool.doDragOver to see if this.diagram.currentTool !== this – if true, it’s an external drag.

Ok @walter , But this event gets triggered as long as the drag is happening through the target diagram, Is there a way to only execute some code only once when the object entered the first time?

That depends on what you mean by “first time”.

Can’t you keep track of whether the override has been called before?

Hi @walter , I will not be able to access palette from the doDragOver of the main diagram. If i try this.draggedParts or this.copiedParts, I assume its the main diagrams tool which is not giving me the parts being dragged. How to get the dragged parts here? any suggestion?

I just tried referring to this.copiedPartsin an override of DraggingTool.doDragOver in the target Diagram, and it seems to correctly be a Map of the (temporary) Nodes being dragged and their corresponding DraggingInfos.

So I do believe that in the doDragOver override you get access to the Nodes being dragged in the target Diagram. Did you look at the Node.data to get information about what is being dragged? Remember that each Diagram can have its own Node templates, so the visual structure of a dragged Node might be completely different from the visual structure of the selected Node in the source Diagram. It’s really just the data that is being copied and dragged over.