I need to get a location of each single or multiple Nodes while dragging for real-time updates to other clients.
I tried to listen to diagram model changes (diagram.addModelChangedListener), but the ChangedEvent does not contain Set of changes to iterate through like SelectionMoved event do, so I can get the location for only last selected node by this way.
How can I properly get current location for each of dragging node?
Normally if you want to change or add behavior during a tool’s operation, you would override some methods of that tool. In this case you might want to override DraggingTool.moveParts to call the super method and then do your updates to your other clients. (Note that this is different for only doing something after the drag has finished – typically one implements the “SelectionMoved” DiagramEvent for that.)
If there is a TwoWay Binding on the Node’s location or position, then what you have tried should work as well. But each ChangedEvent corresponding to a node’s movement will describe it as a Property change of the node data property value. There is no ChangedEvent holding a collection of all property value changes.