Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Removing Duplicate connection/Link
Removing Duplicate connection/Link [message #93533] Wed, 17 January 2007 04:31 Go to next message
Eclipse UserFriend
Originally posted by: biju_gopinathan.rediffmail.com

Hi friends,

While we try to draw a connection between two nodes , two
lines are drawn by default.How can we avoid this(duplicate line)?.


Thanks for any help, in advance regards biju.
Re: Removing Duplicate connection/Link [message #93599 is a reply to message #93533] Wed, 17 January 2007 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi biju;
When you create a canonical view using a tool, the tool will force a
creation of a view, but if canonical edit policy kicked in before the
command finish creating the view you will get 2 views created instead of
one.
That is why the canonical edit policy should be disabled during this
workflow. Check the code in GraphicalEditPart#getCommand this is the
place where canonical edit policies are disabled.
To confirm that this is the case you can add break points to the
EdgeImpl Constructor, and to the
CanonicalConnectionEditPolicy#refreshSemantic in your case you should
hit the EdgeImpl constructor twice, if you hit the refreshSemantic
break point before you hit the EdgeImpl constructor, this means the
canonical edit policy was not disabled. We need to know if this is the
case or not before going further. Other wise you will need to check who
is triggering the 2 calls to the EdgeImpl constructor then we will be
able to understand what is going on.






biju wrote:
> Hi friends,
>
> While we try to draw a connection between two nodes , two
> lines are drawn by default.How can we avoid this(duplicate line)?.
>
>
> Thanks for any help, in advance regards biju.
Re: Removing Duplicate connection/Link [message #93970 is a reply to message #93599] Thu, 18 January 2007 06:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: biju_gopinathan.rediffmail.com

Hi Mohammed Mostafa,

Thanks for your response.

What you said is right, our EdgeImpl constructor is called twice, from
EditPartProvider .

Can you please explain in steps ,how to solve this problem.
I have generated the diagram code from the model. So can i avoid it from
the model level, or should i modify the generated classes.If yes , which
classes and methods.

I am using the GMF 1.0.1 , so is that a bug in it?

Thanks again regards biju

Mohammed Mostafa wrote:
> Hi biju;
> When you create a canonical view using a tool, the tool will force a
> creation of a view, but if canonical edit policy kicked in before the
> command finish creating the view you will get 2 views created instead of
> one.
> That is why the canonical edit policy should be disabled during this
> workflow. Check the code in GraphicalEditPart#getCommand this is the
> place where canonical edit policies are disabled.
> To confirm that this is the case you can add break points to the
> EdgeImpl Constructor, and to the
> CanonicalConnectionEditPolicy#refreshSemantic in your case you should
> hit the EdgeImpl constructor twice, if you hit the refreshSemantic break
> point before you hit the EdgeImpl constructor, this means the canonical
> edit policy was not disabled. We need to know if this is the case or not
> before going further. Other wise you will need to check who is
> triggering the 2 calls to the EdgeImpl constructor then we will be able
> to understand what is going on.
>
>
>
>
>
>
> biju wrote:
>> Hi friends,
>>
>> While we try to draw a connection between two nodes , two
>> lines are drawn by default.How can we avoid this(duplicate line)?.
>>
>>
>> Thanks for any help, in advance regards biju.
Re: Removing Duplicate connection/Link [message #93999 is a reply to message #93533] Thu, 18 January 2007 06:36 Go to previous messageGo to next message
Eclipse UserFriend
Hello biju,

Are you facing the problem described in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=148021?

-----------------
Alex Shatalin
Re: Removing Duplicate connection/Link [message #94057 is a reply to message #93999] Thu, 18 January 2007 06:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: biju_gopinathan.rediffmail.com

Hi Alex Shatalin,

Thanks for your reply,

We are not using any compartments, so the above bug is not related to
our problem, as far as we understood.

We are trying to connect two child nodes.

Please help us to solve this problem

Thanks again regards biju


Alex Shatalin wrote:
> Hello biju,
>
> Are you facing the problem described in:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=148021?
>
> -----------------
> Alex Shatalin
>
>
Re: Removing Duplicate connection/Link [message #94086 is a reply to message #94057] Thu, 18 January 2007 07:06 Go to previous messageGo to next message
Eclipse UserFriend
Hello biju,

> We are trying to connect two child nodes.
I think you are facing the same problem. Try the workaround described in
the request.

-----------------
Alex Shatalin
Re: Removing Duplicate connection/Link [message #94194 is a reply to message #94086] Thu, 18 January 2007 10:29 Go to previous message
Eclipse UserFriend
Hi ;
I Agree with Alex, the defect he mentioned is describing exactly the
problem i was talking about. The Edge will be created twice, one time
because of the canonical edit policy, another time because of the
createViewAndElement command.

I have seen the problem multiple times, with different users in most
cases we found that the main reason was that the canonical edit policy
was installed on the wrong edit part (I'm not sure if this is your case
or not). We have many use cases for canonical connection edit policies
that work fine by just making sure that the canonical edit policy is
installed on the correct (I'm not sure if using the word "correct" here
is accurate, may be i should say the expected edit part :) )edit part.

In general i think GraphicalEditPart#disableCanonicalFor should be
protected to allow users to work around these kind of issues without
changing the owner of the canonical edit policy

Another work around is to make sure that no events are fired till the
whole composite command that creates the view and the element is done.
This might be a more generic solution since it will relax the
assumptions around the container of the canonical edit policy. I'm
considering prototyping it in the GMF Runtime in the next few weeks

I think you should try the workaround suggested by Alex, since you are
using the code generation.








Alex Shatalin wrote:
> Hello biju,
>
>> We are trying to connect two child nodes.
> I think you are facing the same problem. Try the workaround described in
> the request.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Connection created twice
Next Topic:Access the GMF Node corresponding to its element
Goto Forum:
  


Current Time: Mon Jul 14 01:05:37 EDT 2025

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

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

Back to the top