Does mouseDragEnter fire on Diagram itself?

It only works on individual object (like go.Node instances) within the Diagram itself, but it doesn’t seem to fire when I “drag-enter” some copied items from my Palette diagram into the main Diagram.

How do I detect drag transitions from one Diagram into the another Diagram? Ie. How do you guys detect drag changes when transfering (entering/exiting) from one diagram to the next and vice versa? I noticed that the appearance of the DraggableTool’s copied-items changes when dragging over different diagrams when the Diagrams use different node appearance templates. How do you detect the transitionatory changes when the drag-copied items changes it’s node template appearance when moving into another new Diagram with a new node template? Is there anyway I can hook into this event to modify the appearance of the drag-copied items accordingly?

NOTE: I can’t depend on mouseDragEnter, because there’s no guarantee that I’d drag into any existing object within the Diagram. (ie. the Diagram might be empty/sparse), so will drag intno empty space…When I drag a new instance of something into the empty space of a Diagram, mouseDragEnter fails to fire for the Diagram.

Mainly, I need event for:

  • Drag-copied items created from a given diagram.
  • Drag copied items transition to a new diagram…
    But i can’t seem to find this anywhere on DraggableTool or something…

There isn’t any Diagram.mouseDragEnter event, but you could implement a Diagram.mouseDragOver event handler, which will handle all of the cases where the user drags something over the background of the diagram, not over any Part.

Alternatively, maybe you could customize the appearance of the temporary dragged parts by using bindings or different node templates.

Remember also that you can customize what was copied and dropped in an “ExternalObjectsDropped” DiagramEvent listener, which happens upon a drop (not during the drag).

For now, I’m using a mouseDrop listener only and checking that the DraggingTool has any copiedItems in the collection list, which will denote any new instances to be dropped. It’s good enough for now at the cost of aesthetics not being too good since the visual update only occurs upon dropping the item and not when the drag-copied item “enters” the diagram.

Using mouseDrag listener may be a bit too heavy-handed though, even if I run through state enter/exit flags to prevent processing it the 2nd time, a clean instance “entered diagram” in/out event would had been nice.

Would hypothetical Diagram.mouseDragEnter and mouseDragLeave events fire when there are HTML elements in front of the Diagram’s DIV element? What about when the user is dragging an HTML element?