Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Domain model and figure hierarchy out of sync
Domain model and figure hierarchy out of sync [message #204405] Thu, 04 September 2008 16:16 Go to next message
Zsolt Török is currently offline Zsolt TörökFriend
Messages: 22
Registered: July 2009
Junior Member
Hi All,

We're developing a GMF-based diagram editor, and we're in the lucky
position of being able to slightly influence the underlying domain model
structure. However, the rules for visual representation are clearly
defined. We have created our domain model earlier in the development
process, and now we're having difficulties mapping the domain model to the
visualization. Since we have model transformations and lots of code
relying on the current structure, I'm quite hesitant to change the domain
model just to make visualization easier.Sso we've been trying to customize
some of our diagram code, but it quickly got very complex...

Let me give you a simplified example and ask for your advice:
* We have three classes: Model, Element, and Choice.
* Model contains Elements and Choices, so this is the equivalent of the
diagram canvas. Elements and Choices are displayed as nodes on the canvas.
* Choices are _referencing_ Elements, but do not _contain_ them. However
on the diagram the Elements referenced by a Choice must be represented as
child nodes inside a compartment of the Choice node.

In the GMF Mapping model I can't set up the compartment to allow this,
since I can only select from the containment features of Choice when
configuring a child reference, and not the containment feature of Model.

After generating some code ignoring Mapping model validation error, we
tried to modify some methods to implement the above functionality:
* XXXVisualIDRegistry.canCreateNode() and .getNodeVisualID()
* ChoiceItemSemanticEditPióolicy.addDestroyChildNodeCommand() (to delete
children when deleting Choice from diagram)
* ChoiceCompartmentItemSemanticEditPolicy.getCreateCommand() (to enable
creating Elements inside the comparment)
* XXXDiagramUpdater.getChoiceCompartmentSemanticChildren()

After days of work we got a bit closer, but we're still having problems
and can't quite get it right. I tried searching the web for people with
similar problems (different visualization and domain model structure), but
found nothing. Is there a preferred way of implementing this, or do I
really have to modify my domain model so that Choice _contains_ its child
Elements?

Thanks in advance,

Zsolt
Re: Domain model and figure hierarchy out of sync [message #204430 is a reply to message #204405] Thu, 04 September 2008 22:14 Go to previous messageGo to next message
Zsolt Török is currently offline Zsolt TörökFriend
Messages: 22
Registered: July 2009
Junior Member
Did some more googling and found this related thread, unfortunately the
suggested solution doesn't work:
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg14812.html

Cheers,
Zsolt
Re: Domain model and figure hierarchy out of sync [message #205005 is a reply to message #204430] Wed, 10 September 2008 11:16 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Zsolt,

The problem is: corresponding changes were added into the GMF just after
the last release. So .. can you try one of the nightly builds made from GMF
"HEAD" branch while following the solution suggested in http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg14815.html?

-----------------
Alex Shatalin
Previous Topic:Additional diagram initialization code
Next Topic:Manipulating Multiple Nodes in GMF Editor
Goto Forum:
  


Current Time: Wed Apr 24 13:55:22 GMT 2024

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

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

Back to the top