Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem with connection and anchor
Problem with connection and anchor [message #224070] Wed, 11 October 2006 12:27 Go to next message
Eclipse UserFriend
Originally posted by: beconico.gmail.com

This is a multi-part message in MIME format.
--------------010906040404060907060605
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi!

I have implemented my own anchor to handle connections to the
diamond-like figure that appears in the attached picture. The anchor
class should return one of the diamond's vertices. When I debug my
editor, the anchor class does really behave as expected. However, the
connection is not finally anchored on the right point, but in one of the
bounds' points (see attached figure). I think this behaviour is caused
by the router.

Can someone tell me how I can force the connection to use the point
returned by the anchor class?

Thanks a lot in advance!

Nicol
Re: Problem with connection and anchor [message #224088 is a reply to message #224070] Wed, 11 October 2006 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Take a look at the logic example where circuits have fixed anchor points.

"Nicolas" <beconico@gmail.com> wrote in message
news:eginvc$7bd$1@utils.eclipse.org...
> Hi!
>
> I have implemented my own anchor to handle connections to the
> diamond-like figure that appears in the attached picture. The anchor
> class should return one of the diamond's vertices. When I debug my
> editor, the anchor class does really behave as expected. However, the
> connection is not finally anchored on the right point, but in one of the
> bounds' points (see attached figure). I think this behaviour is caused
> by the router.
>
> Can someone tell me how I can force the connection to use the point
> returned by the anchor class?
>
> Thanks a lot in advance!
>
> Nicol
Re: Problem with connection and anchor [message #224196 is a reply to message #224088] Thu, 12 October 2006 08:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: beconico.gmail.com

Thanks Patrik. I have been looking at the logic example, but I could not
find the solution to my problem. Maybe it is because I did not
understand completely well how the code in the logic example works. For
example, in the example the getXConnectionAnchor methods are implemented
in the Figure class, and not in the EditPart class as I do (this
disturbs me). I have seen they also make use of a provider class, but
don't know exactly how it works. Anyhow, apart from those differences, I
think in the logic example they use the point returned by the
FixedConnectionAnchor class. And this class behaves similarly to my
DiamondAnchor class.
My problem is still the same. The anchor point is correctly calculated,
but at the end it is not used. Indeed, when creating an arc and after
selecting the source node, if I place the mouse pointer over the target
node, a temporary arc anchored at one of the vertices is correctly
drawn. However, when I press the mouse button to definitely create the
connection, a different line is drawn, as in the previous mail's
picture. Also, when I move a little the created connection, it is then
anchored at the vertex.

Hope you can help me. Thanks.

Nicolás


Pratik Shah wrote:
> Take a look at the logic example where circuits have fixed anchor points.
>
> "Nicolas" <beconico@gmail.com> wrote in message
> news:eginvc$7bd$1@utils.eclipse.org...
>> Hi!
>>
>> I have implemented my own anchor to handle connections to the
>> diamond-like figure that appears in the attached picture. The anchor
>> class should return one of the diamond's vertices. When I debug my
>> editor, the anchor class does really behave as expected. However, the
>> connection is not finally anchored on the right point, but in one of the
>> bounds' points (see attached figure). I think this behaviour is caused
>> by the router.
>>
>> Can someone tell me how I can force the connection to use the point
>> returned by the anchor class?
>>
>> Thanks a lot in advance!
>>
>> Nicolás
>>
>
>
Re: Problem with connection and anchor [message #224419 is a reply to message #224196] Mon, 16 October 2006 09:38 Go to previous message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
Hi, maybe you can reference org.eclipse.draw2d.EllipseAnchor and check
out diff.

Regards,

QinXian.
在 2006-10-12四的 10:50 +0200,Nicolas写道:
> Thanks Patrik. I have been looking at the logic example, but I could not
> find the solution to my problem. Maybe it is because I did not
> understand completely well how the code in the logic example works. For
> example, in the example the getXConnectionAnchor methods are implemented
> in the Figure class, and not in the EditPart class as I do (this
> disturbs me). I have seen they also make use of a provider class, but
> don't know exactly how it works. Anyhow, apart from those differences, I
> think in the logic example they use the point returned by the
> FixedConnectionAnchor class. And this class behaves similarly to my
> DiamondAnchor class.
> My problem is still the same. The anchor point is correctly calculated,
> but at the end it is not used. Indeed, when creating an arc and after
> selecting the source node, if I place the mouse pointer over the target
> node, a temporary arc anchored at one of the vertices is correctly
> drawn. However, when I press the mouse button to definitely create the
> connection, a different line is drawn, as in the previous mail's
> picture. Also, when I move a little the created connection, it is then
> anchored at the vertex.
>
> Hope you can help me. Thanks.
>
> Nicolás
>
>
> Pratik Shah wrote:
> > Take a look at the logic example where circuits have fixed anchor points.
> >
> > "Nicolas" <beconico@gmail.com> wrote in message
> > news:eginvc$7bd$1@utils.eclipse.org...
> >> Hi!
> >>
> >> I have implemented my own anchor to handle connections to the
> >> diamond-like figure that appears in the attached picture. The anchor
> >> class should return one of the diamond's vertices. When I debug my
> >> editor, the anchor class does really behave as expected. However, the
> >> connection is not finally anchored on the right point, but in one of the
> >> bounds' points (see attached figure). I think this behaviour is caused
> >> by the router.
> >>
> >> Can someone tell me how I can force the connection to use the point
> >> returned by the anchor class?
> >>
> >> Thanks a lot in advance!
> >>
> >> Nicolás
> >>
> >
> >
Previous Topic:Help in Palette
Next Topic:Does paintFigure method get called all the time?
Goto Forum:
  


Current Time: Sat Dec 04 21:08:05 GMT 2021

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

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

Back to the top