Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Duplicate connections problem
Duplicate connections problem [message #230861] Wed, 20 May 2009 12:23 Go to next message
Juan is currently offline JuanFriend
Messages: 29
Registered: July 2009
Junior Member
Hi everybody,

I wanna make generalization relationships between elements of type
MyClassType. In the mapping I only have defined the target of the link
mapping to be MyClassType and the rest of attributes are as default. The
problem is that I can draw relationships between classes, but when i
created a new class, then the relationships are duplicated!!!. The
medthod createConnectionFigure() of my relation edit part is called
whenever i create a new class.

I don't know why, but i suspect that the key is the mapping i have done.

All help will be welcome. Thanks in advance!
Re: Duplicate connections problem [message #230868 is a reply to message #230861] Wed, 20 May 2009 12:40 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Juan Miguel Ávila Nieto,

Check Ecore GMF example - AFAIU EClassESuperTypes link is similar to the
one you are going to create, so you can use it as example.

-----------------
Alex Shatalin
Re: Duplicate connections problem [message #231038 is a reply to message #230868] Fri, 22 May 2009 06:54 Go to previous message
Juan is currently offline JuanFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Alex Shatalin,

Thanks for your help. I am doing the way that Ecore GMF Example does the
generalization connections and the problem wasn't in mapping, but it
was in PDomainPCanonicalEditPolicy. PDomain is the root element. To
solve it I had to change the method refreshConnections() in the policy.

Firstly I was changed the check "if (diagramLinkVisualID == -1)" because
this is a "bug" that makes connections not loading correctly after
saving if you don't add the IDs of connections that you wanna reload
after saving. 3001 is the ID of association relations & 3002 of
generalization connections. So I rewrote:

if (diagramLinkVisualID == -1 || diagramLinkVisualID == 3001 ||
diagramLinkVisualID == 3002)


But I was in a mistake when I added ID 3002 in the test since it has not
semantic element related to. In this way, when I saved the connection
then was cloned !!. However, association relatios has a semantic and
adding its ID in this test is correct. So the final code is:

if (diagramLinkVisualID == -1 || diagramLinkVisualID == 3001)

In this way I can create associatons, save it, and the most important
reload it. Generalizations works too.


Best regards










lex Shatalin escribió:
> Hello Juan Miguel Ávila Nieto,
>
> Check Ecore GMF example - AFAIU EClassESuperTypes link is similar to the
> one you are going to create, so you can use it as example.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:2 palette questions
Next Topic:Multiple labels/Parser
Goto Forum:
  


Current Time: Fri Sep 20 07:40:50 GMT 2024

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

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

Back to the top