Oops, sorry, accidentally sent too early, please ignore the previous email. Here is corrected version:
Hello,
Concerning
the links, don’t forget than the position of anchors is in percentage
of the size of the attached node and this percentage is defined
by the user click during the link creation. So the saved anchor
location is always somewhere inside the node and never on a border.
I would like to add a few other notes for consideration:
-
In the diagram runtime draw2d layout is called asynchronously so it is
not trivial to get the computed implicit bounds of nodes in any batch operation.
-
the visible position of the bendpoint may have almost nothing common
with the actual model constraints (e.g, consider "avoid obstructions"
mode).
- As far as I understand the routing algorithms in GMF runtime are tightly coupled with GEF notions (EditPart's, Anchor's etc -- those things that don't exists without the DiagramEditor), so direct "reuse" of this code in the batch export is next to impossible
- even when the routing logic is less complicated, the routing
happens again asynchronously after the first (already async) step of
computing the actual bounds for nodes is done.
I obviously don't want to say that it is impossible to compute all of this in the separate export code.
But I do think that specifically for links it would be simpler to collect and store the information at the time when it is updated, and accept pollution of the diagram persistence with this additional data.