Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Multiple Diagrams based on one model-file for the DomainModel
Multiple Diagrams based on one model-file for the DomainModel [message #895536] Fri, 13 July 2012 13:00 Go to next message
Daniel P is currently offline Daniel PFriend
Messages: 1
Registered: July 2012
Junior Member
Hello Graphiti-Community,

which way do you suggest to create multiple diagrams which are based on one model-file?

I have a Domain-Model with one root-element which holds a containment list with an arbitary number of child-elements and each child element has some attributes. Based on this Domain-Model I want to make each child element editable through a graphiti editor.

If I'm right this should work with one file for the domain-model and seperate files for each diagram representing one child of the root-element. I implemented this through overwirting FileService.createEmfFileForDiagram(URI diagramResourceUri, final Diagram diagram)" so that I provide one overall ResourceSet the created diagrams are placed in. Additionally, the ResourceSet contains the domain-model Resource. When a new diagram is created, I link the diagram to the chil-element of the domain-model.

This works fine as I can edit each child-element of the domain-root element through seperate graphiti editors. However, the problem is, when I create a new Diagram, the domain-model file is kind of "resettet". This means all content which has been added through editors gets removed from the domain-model file. When I start adding components again, all works perfect... unti I create a new Diagram.

Do you have any suggestions what I'm doing wrong?
Re: Multiple Diagrams based on one model-file for the DomainModel [message #895818 is a reply to message #895536] Mon, 16 July 2012 07:53 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1640
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Daniel,

this appears to me as a good appoach although I would discourage to override
FileService as this is no API. You may try to put your coding into the
editor behavior classes (DefaultUpdateBehavior holds the editing domain and
controls its creation, DefaultPersistencyBehavior controls loading and
saving).

Regarding the reset of the domain model resource. Could you post the coding
you use for the creation of the resources?

Michael
Previous Topic:Error : Unable to find feature.xml
Next Topic:TransactionalEditingDomain and Resource
Goto Forum:
  


Current Time: Thu Dec 18 08:44:51 GMT 2014

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

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