Multiple Diagrams based on one model-file for the DomainModel [message #895536] |
Fri, 13 July 2012 09:00  |
Eclipse User |
|
|
|
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 03:53  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.09204 seconds