|Moving a Node with connected source/target Edge doesn't update the bendpoint [message #731359]
||Fri, 30 September 2011 17:15
| Esteban Dugueperoux
Registered: July 2009
Hi GMF community,|
I have a use case with GMF, where I have implemented a
ResourceSetListener to layout some specific View (displaying a clock
figure) according to location of other Views, I use GMF notation model
to calculate the locations of these other Views.
Consider an illustrative example :
At the beginning I have the following diagram named "firstState.png"
with a InitialNode (at the right), a State (at the left) and a
Transition linking these two Nodes. The clock figure in the middle is
layout by my ResourceSetListener according to these related Views (the
State of the left and the Transition).
Now the issue is when I move the Initial Node (at the right) on top of
the State, in the GMF notation model only Bounds of this InitialNode are
changed and not bendpoints of the Transition, then I can't get a correct
location to layout my clock figure (which should be above the State at
the left of the Transition as shown in the diagram named
"thirdState.png" but I get a diagram as shown in "secondState.png".
If I move a little the Transition (as shown in "secondState.png"), the
bendpoints are updated and now from the GMF notation model I can
calculate a correct location to layout my clock figure.
I understand that EditPolicy from a ChangeBoundsRequest manage only
Bounds of the concerned View, but the GMF notation model is not keep
consistent according to pointList of draw2d connection. I'm looking for
a workaround for this issue. I have tried to execute a
SetConnectionBendpointsCommand in post-commit to update the bendpoints
after execution of DiagramEventBroker to have EditPart refreshed but it
doesn't works. Any clue will be welcome.
|Re: Moving a Node with connected source/target Edge doesn't update the bendpoint [message #733486 is a reply to message #731359]
||Tue, 04 October 2011 21:24
| Michael Golubev
Registered: July 2009
I am not sure what is an expected/correct behavior here. The link from your example has no intermediate bendpoints except the 2 linked to source and end anchors, so there are no actual changes of bendpoints here. Nevertheless, would you added the bendpoint into the middle of the link, it's position most probably was preserved after the mve of the state, which does not look right. Overall it looks like a bug for me, please submit bugzilla or test case for it.
Despite the above, you probably may solve your practical problem by implementing the clock decoration as a link label with an icon and fixed empty text.
Link labels are definitely being relocated on the relocating of the link' ends. And if you need the more intelligent positioning of the label/icon, you may use custom locator registered via the @generated NOT code.
Michael "Borlander" Golubev
Eclipse Committer (GMF, UML2Tools)
at Montages Think Tank, Prague, Czech Republic
Montages AG, Zürich, Switzerland
Powered by FUDForum
. Page generated in 0.04978 seconds