Problem with additional adjustment of bendpoints as part of user interaction [message #1820901] |
Fri, 31 January 2020 10:04 |
|
This might be a general EMF/GEF question but my problem arises in a Papyrus context so I try this forum.
I have registered a ResourceSetListener which implements the transactionAboutToCommit() method to act upon movement of a shape in a Papyrus diagram. When a shape is moved, I would like to adjust the bendpoints on any connection (edge) that is connected to the shape.
I have succeeded with the implementation of a GEF-command that adjust bendpoints in another context. So I know that it works.
But when returning the same command interior from the transactionAboutToCommit()-method there is no effect, even thus I can track that the code in the command for adjusting the bendpoints is executed.
I have tried to provide the command as a GEF command, wrapped in an EMF-command using the org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper class but it still has now effect.
What am I doing wrong? How can I provide additional bendpoints adjustment at the end of a user initiated diagram adjustment?
/Thomas
|
|
|
Re: Problem with additional adjustment of bendpoints as part of user interaction [message #1820906 is a reply to message #1820901] |
Fri, 31 January 2020 10:37 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Thomas,
Resource-set listeners aren't really the best way to hook into diagram manipulation. We don't usually use this, so I'm not sure what's wrong exactly.
In general, I would recommend following the GEF Request/EditPolicy approach, which happens much earlier, and allows you to inject custom commands to the commands chain.
Regarding your question, if the command is properly executed and the GMF Notation model is properly updated, then it could be a refresh issue on the Edit Part side. I would check the following:
- After executing your command, save the model and see if the *.notation is correct
- After executing your command, force a refresh of the Diagram (F5/Refresh icon in the toolbar)
- After executing your command, save the model, close it and reopen it
If none of these show the expected results, then your command may have been overridden by the actual command (Maybe because your command happened too early, rather than too late?). If these workaround get you the correct results, then it's more likely a refresh issue, that can be investigated separately.
HTH,
Camille
Camille Letavernier
|
|
|
|
Powered by
FUDForum. Page generated in 0.02883 seconds