Removing Duplicate connection/Link [message #93533] |
Wed, 17 January 2007 04:31  |
Eclipse User |
|
|
|
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 #93970 is a reply to message #93599] |
Thu, 18 January 2007 06:31   |
Eclipse User |
|
|
|
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 #94194 is a reply to message #94086] |
Thu, 18 January 2007 10:29  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05995 seconds