Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Problem with additional adjustment of bendpoints as part of user interaction
Problem with additional adjustment of bendpoints as part of user interaction [message #1820901] Fri, 31 January 2020 10:04 Go to next message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 83
Registered: June 2012
Location: Stockholm , Sweden
Member

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 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
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
Re: Problem with additional adjustment of bendpoints as part of user interaction [message #1820907 is a reply to message #1820906] Fri, 31 January 2020 10:55 Go to previous message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 83
Registered: June 2012
Location: Stockholm , Sweden
Member

Thanks Camille,

I have tried refresh, save/reopen and studied the notation file.
But it seems that it is not a refresh isssue.

I will take your advice and dig into the GEF Request/EditPolicy approach instead. But that technology is new for me. Do you have a useful entry point to documentation I can study?

/Thomas
Previous Topic:How to access instances of classifiers in Activity Diagram
Next Topic:I can't add a new class diagram
Goto Forum:
  


Current Time: Fri Apr 19 15:46:46 GMT 2024

Powered by FUDForum. Page generated in 0.02623 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top