Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Elvis Dowson is currently offline Elvis DowsonFriend
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,

index.php/fa/7739/0/

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.

index.php/fa/7741/0/

Elvis Dowson
Re: Bug: object doesn't appear in GMF diagram editor, but is created in Ecore model [message #835777 is a reply to message #835231] Tue, 03 April 2012 16:58 Go to previous messageGo to next message
Elvis Dowson is currently offline Elvis DowsonFriend
Messages: 65
Registered: December 2011
Member
I've filed this as a bug report on the Eclipe Bugzilla website bugs.eclipse.org. The bug id is 375977.

Sorry I can't post a direct link, since I haven't reached the required number of posts to be allowed to do so.
Re: Bug: object doesn't appear in GMF diagram editor, but is created in Ecore model [message #835860 is a reply to message #835777] Tue, 03 April 2012 19:21 Go to previous messageGo to next message
Elvis Dowson is currently offline Elvis DowsonFriend
Messages: 65
Registered: December 2011
Member
I've attached a full Eclipse-3.7.2 GMF project. You can generate the application from the workspace.genmodel and the workspace.gmfgen files.

In in you can clearly see that if you drag and drop from a Project node, using the ProjectDesignRepositories link creation tool, the DesignRepository doesn't get displayed on the canvas, but it gets persisted to the ecore model file.

Could someone please tell me why this is happening, and if it is an error on my part, incorrectly specifying something, or in modeling the project?

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 Go to previous message
Elvis Dowson is currently offline Elvis DowsonFriend
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

Previous Topic:Create GMF tooling to instantiate an object via a non-containment relationship
Next Topic:Navigate through diagrams of different types
Goto Forum:
  


Current Time: Thu Apr 25 16:14:03 GMT 2024

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

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

Back to the top