Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » problem with displaying inheritance node in a Compartment
problem with displaying inheritance node in a Compartment [message #143228] Wed, 18 July 2007 11:04 Go to next message
Tex Twil is currently offline Tex TwilFriend
Messages: 179
Registered: July 2009
Senior Member
Hello,
I have a problem with displaying a "inherited" class in a compartment. I
place it properly but it just won't display.

Let's say I have those classes in my model :

Nature:
- trees: Tree (container reference)

Tree:
-name
-apples: Apple (container reference)
-specialApples: SplecialApple (container reference)

Apple:
-color

SpecialApple
-specialAttribute

The class SpecialApple "extends" the class Apple.

In my gmfmap I have a TopNodeReference to with a NodeMapping to a Tree.
This NodeMapping has ChildReferences to "Apple" and "SpecialApple" . It also
has a Compartment Mapping with Children set to Apple and SpecialApple.

So my problem is when I run the diagram, I can place and Apple to the
Compartment. I can also place the SpecialApple but when I release the mouse
button, it just doesn't show in the diagram. If I open the xmi file of the
model instance, I can see the SpecialApple.

When I remove the inheritance between the Apple and SpecialApple, it works
ok !!

Any ideas ?

Thanks a lot,
Tex;
Re: problem with displaying inheritance node in a Compartment [message #143281 is a reply to message #143228] Wed, 18 July 2007 14:57 Go to previous messageGo to next message
Tex Twil is currently offline Tex TwilFriend
Messages: 179
Registered: July 2009
Senior Member
Hi again,
I've also noticed that if I put two Compartments - one for Apples, one for
SpecialApple - it works also fine.
Any ideas how to solve this problem ?

Thanks.

"Tex Twil" <chaljan@hotmail.com> a écrit dans le message de
news:f7ks4k$pk2$1@build.eclipse.org...
> Hello,
> I have a problem with displaying a "inherited" class in a compartment. I
> place it properly but it just won't display.
>
> Let's say I have those classes in my model :
>
> Nature:
> - trees: Tree (container reference)
>
> Tree:
> -name
> -apples: Apple (container reference)
> -specialApples: SplecialApple (container reference)
>
> Apple:
> -color
>
> SpecialApple
> -specialAttribute
>
> The class SpecialApple "extends" the class Apple.
>
> In my gmfmap I have a TopNodeReference to with a NodeMapping to a Tree.
> This NodeMapping has ChildReferences to "Apple" and "SpecialApple" . It
> also has a Compartment Mapping with Children set to Apple and
> SpecialApple.
>
> So my problem is when I run the diagram, I can place and Apple to the
> Compartment. I can also place the SpecialApple but when I release the
> mouse button, it just doesn't show in the diagram. If I open the xmi file
> of the model instance, I can see the SpecialApple.
>
> When I remove the inheritance between the Apple and SpecialApple, it works
> ok !!
>
> Any ideas ?
>
> Thanks a lot,
> Tex;
>
>
Re: problem with displaying inheritance node in a Compartment [message #143301 is a reply to message #143281] Wed, 18 July 2007 15:17 Go to previous messageGo to next message
Andreas Schuster is currently offline Andreas SchusterFriend
Messages: 27
Registered: July 2009
Junior Member
hi Tex,

its a bug in the ???VisualIDRegistry within the method getNodeVisualID().
the problem is that types are listed from general to specialized.
so the first matching (super)type in the hierarchy is returned instead
of the most specialized type.
if allready commited a bug report
https://bugs.eclipse.org/bugs/show_bug.cgi?id=195272
a simple workaround is just to change the order of 'if' operations with
the types ordered from specialized to general.

andreas

Tex Twil schrieb:
> Hi again,
> I've also noticed that if I put two Compartments - one for Apples, one
> for SpecialApple - it works also fine.
> Any ideas how to solve this problem ?
>
> Thanks.
>
> "Tex Twil" <chaljan@hotmail.com> a écrit dans le message de
> news:f7ks4k$pk2$1@build.eclipse.org...
>> Hello,
>> I have a problem with displaying a "inherited" class in a compartment.
>> I place it properly but it just won't display.
>>
>> Let's say I have those classes in my model :
>>
>> Nature:
>> - trees: Tree (container reference)
>>
>> Tree:
>> -name
>> -apples: Apple (container reference)
>> -specialApples: SplecialApple (container reference)
>>
>> Apple:
>> -color
>>
>> SpecialApple
>> -specialAttribute
>>
>> The class SpecialApple "extends" the class Apple.
>>
>> In my gmfmap I have a TopNodeReference to with a NodeMapping to a
>> Tree. This NodeMapping has ChildReferences to "Apple" and
>> "SpecialApple" . It also has a Compartment Mapping with Children set
>> to Apple and SpecialApple.
>>
>> So my problem is when I run the diagram, I can place and Apple to the
>> Compartment. I can also place the SpecialApple but when I release the
>> mouse button, it just doesn't show in the diagram. If I open the xmi
>> file of the model instance, I can see the SpecialApple.
>>
>> When I remove the inheritance between the Apple and SpecialApple, it
>> works ok !!
>>
>> Any ideas ?
>>
>> Thanks a lot,
>> Tex;
>>
>>
>
Re: problem with displaying inheritance node in a Compartment [message #143410 is a reply to message #143301] Thu, 19 July 2007 09:05 Go to previous messageGo to next message
Tex Twil is currently offline Tex TwilFriend
Messages: 179
Registered: July 2009
Senior Member
Hi Andreas,
Thank you for your hint, it helped.

Tex

"A.Schuster" <a.schuster@exxcellent.de> a écrit dans le message de
news:f7lavi$ve3$1@build.eclipse.org...
> hi Tex,
>
> its a bug in the ???VisualIDRegistry within the method getNodeVisualID().
> the problem is that types are listed from general to specialized.
> so the first matching (super)type in the hierarchy is returned instead of
> the most specialized type.
> if allready commited a bug report
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195272
> a simple workaround is just to change the order of 'if' operations with
> the types ordered from specialized to general.
>
> andreas
>
> Tex Twil schrieb:
>> Hi again,
>> I've also noticed that if I put two Compartments - one for Apples, one
>> for SpecialApple - it works also fine.
>> Any ideas how to solve this problem ?
>>
>> Thanks.
>>
>> "Tex Twil" <chaljan@hotmail.com> a écrit dans le message de
>> news:f7ks4k$pk2$1@build.eclipse.org...
>>> Hello,
>>> I have a problem with displaying a "inherited" class in a compartment. I
>>> place it properly but it just won't display.
>>>
>>> Let's say I have those classes in my model :
>>>
>>> Nature:
>>> - trees: Tree (container reference)
>>>
>>> Tree:
>>> -name
>>> -apples: Apple (container reference)
>>> -specialApples: SplecialApple (container reference)
>>>
>>> Apple:
>>> -color
>>>
>>> SpecialApple
>>> -specialAttribute
>>>
>>> The class SpecialApple "extends" the class Apple.
>>>
>>> In my gmfmap I have a TopNodeReference to with a NodeMapping to a Tree.
>>> This NodeMapping has ChildReferences to "Apple" and "SpecialApple" . It
>>> also has a Compartment Mapping with Children set to Apple and
>>> SpecialApple.
>>>
>>> So my problem is when I run the diagram, I can place and Apple to the
>>> Compartment. I can also place the SpecialApple but when I release the
>>> mouse button, it just doesn't show in the diagram. If I open the xmi
>>> file of the model instance, I can see the SpecialApple.
>>>
>>> When I remove the inheritance between the Apple and SpecialApple, it
>>> works ok !!
>>>
>>> Any ideas ?
>>>
>>> Thanks a lot,
>>> Tex;
>>>
>>>
>>
Re: problem with displaying inheritance node in a Compartment [message #144004 is a reply to message #143301] Wed, 25 July 2007 11:14 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello A.Schuster,

The problem is not in the generated code, but in the mapping model itself.
I've attached detailed description to your request so you should be able
to correct an error.

-----------------
Alex Shatalin
Re: problem with displaying inheritance node in a Compartment [message #144013 is a reply to message #143410] Wed, 25 July 2007 11:14 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Tex,

Try following suggestions from: https://bugs.eclipse.org/bugs/show_bug.cgi?id=195272#c6

-----------------
Alex Shatalin
Previous Topic:How to get the instance of XXXDiagramEditor at runtime?
Next Topic:Re: EMF/GMF visual editor generation - Changing the containment of elements
Goto Forum:
  


Current Time: Sun Jul 21 13:31:58 GMT 2024

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

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

Back to the top