Home » Modeling » GMF (Graphical Modeling Framework) » Bug: object doesn't appear in GMF diagram editor, but is created in Ecore model
Bug: object doesn't appear in GMF diagram editor, but is created in Ecore model [message #835231] |
Tue, 03 April 2012 00:21 |
Elvis Dowson Messages: 65 Registered: December 2011 |
Member |
|
|
Hi,
I have a weird situation happening, where an object doesn't appear in the GMF diagram editor, but I can see that it gets created in the Ecore file, when I save the project.
Why does this happen? e.g. In the following diagram,
ProjectRepository contains DesignRepository and KnowledgeRepository.
However, in the tooling, if I create a Project, and then drag and drop the ProjectDesignRepositories link creation tool, it allows me to select the Project node, and drop to an empty area on the canvas, but then, when I release the mouse, it disappears. When I click on the Save icon, I can see it in the Ecore file. so the operation worked correctly, but it doesn't get displayed on the canvas.
Elvis Dowson
|
|
| | |
Re: Bug: object doesn't appear in GMF diagram editor, but is created in Ecore model [message #837865 is a reply to message #835860] |
Fri, 06 April 2012 07:43 |
Elvis Dowson Messages: 65 Registered: December 2011 |
Member |
|
|
Thanks to Guillaume Hillairet for pointing out why this was happening:
Quote:Your problem is related to the containment relationship. In your gmfmap model,
you defined 3 TopNodeReference (Project, Design, Knowledge). These TopNode
correspond to nodes that will be contained by your diagram root object (in your
case Workspace) via the containment relationship objects.
Now you define a link ProjectKnowledgeRepositories corresponding to your
model's relation Project.knowledgeRepositories. The thing is that this latter
is also a containment relationship, that's what break your diagram.
Because when you create your diagram, you create a Project node P, a Knowledge
node K, then they are first both contained by the relation Worksapce.objects.
Then when you try to link the P to K by link knowledgeRepositories, K becomes
contained by P, thus K could not be display as a TopNode, that's why it
disappears.
A solution would be to set the relation knowledgeRepositories to non
containment, or modify the gmfmap model to set KnowledgeRepository not as a
TopNodeReference but as a ChildReference to Project.
I partly solved this by
a. creating a project compartment that can hold a design repository and a knowledge repository. This way, when I model it in the workspace diagram, I can see it contained inside the project node.
b. create a GMF diagram partition, and create a sub-diagram for the project, so that when I double click it, it opens up a new project diagram, with the design repository and knowledge repository contained inside it.
The material on how to do GMF diagram partitioning is very tricky, and I had to refer the following resources to get it to work:
http://www.jevon.org/wiki/GMF_Diagram_Partitioning
http://wiki.eclipse.org/Diagram_Partitioning
http://www.eclipse.org/forums/index.php/mv/msg/168243/#msg_533736
http://www.jevon.org/wiki/GMF_Troubleshooting_3
Now only two problems persist:
1. Double clicking on a project node to open up the diagram editor is very tricky, and it doesn't happen correctly every time. It looks like I have to only double click on the outline edge of the project node. Is there a way to fix this?
2. When I create a relationship between a design repository and a knowledge repository, in the sub-diagram, it correctly appears in the super-diagram. However, when I save and close it, and open it again, the relationship appears in the super diagram, but is gone from the sub-diagram.
Elvis Dowson
[Updated on: Fri, 06 April 2012 07:44] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Apr 25 05:33:22 GMT 2024
Powered by FUDForum. Page generated in 0.02975 seconds
|