Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create Diagram with initial Content
Create Diagram with initial Content [message #664663] Mon, 11 April 2011 14:40 Go to next message
Thorsten Koch is currently offline Thorsten KochFriend
Messages: 5
Registered: January 2011
Junior Member
I want to create an editor, which contains a couple of elements after startup. So i modified the method xxxDiagramEditorUtil.createInitialModel(), but my problem is that the elements are only stored in the domain model but not in the notational model. If i add another element to the diagram, everything works fine.

So i think that i have to create nodes for each element i add in the createInitialModel by using the ViewService.createNode(...) - method. But i am not able to managed this correctly. Can someone plz help me ??

Another point i do not really understand is that if i add a getCreateCommand() - method in a generated EditPolicy which extends the normal BaseItemSemanticPolicy nothing happens. The method is not called. Is there another point where i have to define that it should be possible to add an element ??

I hope my points are understandable, because englisch is not my foreign language.
Thanks for help
Re: Create Diagram with initial Content [message #664683 is a reply to message #664663] Mon, 11 April 2011 15:14 Go to previous messageGo to next message
Elle  is currently offline Elle Friend
Messages: 6
Registered: April 2011
Location: Cairo, Egypt
Junior Member

Check out this tutorial: http://gmfsamples.tuxfamily.org/wiki/doku.php?id=gmf_tutoria l7#diagram_initialization

I think this is what you are looking for.
Re: Create Diagram with initial Content [message #664685 is a reply to message #664663] Mon, 11 April 2011 15:22 Go to previous message
Thorsten Koch is currently offline Thorsten KochFriend
Messages: 5
Registered: January 2011
Junior Member
Thanks for answering, but this is not what i am looking for.
I used the ideas of this tutorial, but if you open the diagram and close the whole eclipse runtime instance without changing anything in the diagram, then after opening the diagram once again all elements are gone and this is the problem i want to solve now
Previous Topic:Connections and Expression Labels
Next Topic:Shortcuts are gone after reopening the diagram file
Goto Forum:
  


Current Time: Mon Nov 04 19:54:14 GMT 2024

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

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

Back to the top