|[Teneo + GMF] Diagram and model element handling [message #619260]
||Thu, 19 June 2008 09:20
| Matthias Treitler
Registered: July 2009
Hello Martin and Teneo users!|
For my application I want to give the user the possibilty to create and
also undo/redo/copy/paste (summed up mostly all capabilities which
emf.edit provides out of the box) diagram instances.
My current solution works but I am not really satisfied (and you probably
too when you read this post :) ).
Every Diagram "container" model instance (in your tutorial the "Map")
relates to the GMF "Diagram" model instance. With this rule in mind I do
I tell you which step I perform when creating my "Map" + "Diagram"
I create and initialize the "Map" on the command stack. Then I save the
resource so that the ID attribute gets filled and has an unique value.
Then I create the "Diagram" instance on the command stack and set the name
to the id of the "Map". So now I have a very simple reference between the
"Map" and the "Diagram" that I need when opening the diagram editor. Then
I save the resource again.
When opening the diagram I use the following query: "query1=from
Map&query2=from Diagram where name='[Map Id that should be opened]'".
As you can see undo and redo is not really possible, also the same for
deleting, copy and paste, because the Map is not really referenced to the
The rest of my code is nearly exactly the same as used in the Tutorial.
So how would you do it when you want to open serveral different diagram
Thank you for your answers!
Powered by FUDForum
. Page generated in 0.01751 seconds