Duplicate connections problem [message #230861] |
Wed, 20 May 2009 08:23  |
Eclipse User |
|
|
|
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 #231038 is a reply to message #230868] |
Fri, 22 May 2009 02:54  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07216 seconds