Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Figures for subclasses in GMF editor(Cannot implement an editor with subclasses within it)
Figures for subclasses in GMF editor [message #809030] Tue, 28 February 2012 07:12 Go to next message
Javier de la Dehesa is currently offline Javier de la Dehesa
Messages: 4
Registered: February 2012
Junior Member
Hello, I've been having this problem for some time and I haven't been able to find any similar question within the forums so I hope this is not duplicate.

I have a rather complex Ecore model for which I'd like to design a GMF editor, and I've started with a small partition of it. My problem comes with a concrete class A that inherits from an abstract class X and a class B that inherits from A. I wanted both of these classes to appear on my diagram, so I created graphical definitions, tooling and mapping, just like in every other class. But when I run the editor I found that, while class A figures worked fine, class B figures didn't show up when I tried to create them; moreover, when I created some figure of another independent class a figure of type A appeared for the B element, like if the editor wanted to use some class graphical definition for every subclass of it - which may make sense in some cases, but not here. Anyway, the XML model was correct.

I've reviewed the .gmfgraph, .gmftool and .gmfmap files a million times, deleted the .gmfgen file and the .diagram project to generate it from the scratch, but anything worked. In fact, when I've been trying to add figures for other classes with similar structure (a class that inherits from an abstract and a subclass of it) with almost the same output - the superclass is ok and the subclass doesn't show anything, until it spontaneously (when another model element is created) generates both superclass and subclass figures for each subclass element.

I thought it may be a bug but I couldn't find anything similar in Bugzilla, and I prefer to be sure before reporting a new bug.

Thanks in advance for your help.
Re: Figures for subclasses in GMF editor [message #809111 is a reply to message #809030] Tue, 28 February 2012 08:47 Go to previous messageGo to next message
Svyatoslav Kovalsky is currently offline Svyatoslav Kovalsky
Messages: 12
Registered: October 2011
Junior Member
Hello!

Taipan contains similar sample. There are Ship and WarShip extends Ship, but nodes look differently.
To make diagram updater work correctly, map model contains costraint that Ship-node is not for WarShip's - see screenshot.

index.php/fa/7344/0/

Probably, GMF-tooling could find the problem at validation time and display a warning.
If it has sense, please open a bugzilla with the request to implement.

Regards,
Svyatoslav Kovalsky
at Montages Think Tank, Prague, Czech Republic
Montages AG, Zürich, Switzerland

[Updated on: Tue, 28 February 2012 08:50]

Report message to a moderator

icon7.gif  Re: Figures for subclasses in GMF editor [message #809719 is a reply to message #809111] Wed, 29 February 2012 02:08 Go to previous message
Javier de la Dehesa is currently offline Javier de la Dehesa
Messages: 4
Registered: February 2012
Junior Member
Awesome!! You nailed it! How can I've been so clumsy. You wouldn't believe how long I've been stuck with this. I'll pay more attention to OCL possibilities from now on.

Thanks a lot.
Previous Topic:Unhandled event loop exception - NullPointerException
Next Topic:can't find IDgroup.new
Goto Forum:
  


Current Time: Sun May 19 21:04:57 EDT 2013

Powered by FUDForum. Page generated in 0.01639 seconds