Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Custom ConnectionAnchor - How to set the connection points to the center of each side?
Custom ConnectionAnchor - How to set the connection points to the center of each side? [message #242944] Thu, 15 May 2008 11:49 Go to next message
Eclipse User
Originally posted by: rolfes.daniel.web.de

Hi,

I have two rectangular figures and want to connect them. The four
target and source connection points have to be at the center of each side.
So I think I have to override the methodes getSourceConnectionAnchor(..)
and getTargetConnectionAchor(...) in my XXXEditPart class and I've tried
to use the FixedConnectionAnchor. I've played around with the
getLocation(...) method and managed to place the anchors on the
bottom-center of the rectangle. My problem is that the connection points
depend on where the two figures are located.
If one figure is at the top and the other below it, the connection has
to be from the bottom of the first figure to the top of the second one.
If the first one is left and the second one on the right side, the
connection has to be from the right side of figure one to the left side
of figure two. And so one.
How do I determine where the two figures are located? Or is there an
easier approach?

Thanks,
Daniel
Re: Custom ConnectionAnchor - How to set the connection points to the center of each side? [message #243117 is a reply to message #242944] Sat, 24 May 2008 10:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: rolfes.daniel.web.de

anyone?

D. Rolfes schrieb:
> Hi,
>
> I have two rectangular figures and want to connect them. The four
> target and source connection points have to be at the center of each side.
> So I think I have to override the methodes getSourceConnectionAnchor(..)
> and getTargetConnectionAchor(...) in my XXXEditPart class and I've tried
> to use the FixedConnectionAnchor. I've played around with the
> getLocation(...) method and managed to place the anchors on the
> bottom-center of the rectangle. My problem is that the connection points
> depend on where the two figures are located.
> If one figure is at the top and the other below it, the connection has
> to be from the bottom of the first figure to the top of the second one.
> If the first one is left and the second one on the right side, the
> connection has to be from the right side of figure one to the left side
> of figure two. And so one.
> How do I determine where the two figures are located? Or is there an
> easier approach?
>
> Thanks,
> Daniel
Re: Custom ConnectionAnchor - How to set the connection points to the center of each side? [message #485656 is a reply to message #242944] Mon, 14 September 2009 11:07 Go to previous message
Eclipse User
Originally posted by: luimarr1.upvnet.upv.es

D. Rolfes escribió:
> Hi,
>
> I have two rectangular figures and want to connect them. The four
> target and source connection points have to be at the center of each side.
> So I think I have to override the methodes getSourceConnectionAnchor(..)
> and getTargetConnectionAchor(...) in my XXXEditPart class and I've tried
> to use the FixedConnectionAnchor. I've played around with the
> getLocation(...) method and managed to place the anchors on the
> bottom-center of the rectangle. My problem is that the connection points
> depend on where the two figures are located.
> If one figure is at the top and the other below it, the connection has
> to be from the bottom of the first figure to the top of the second one.
> If the first one is left and the second one on the right side, the
> connection has to be from the right side of figure one to the left side
> of figure two. And so one.
> How do I determine where the two figures are located? Or is there an
> easier approach?
>
> Thanks,
> Daniel
Hi Daniel,
the Schema Diagram Editor example does it in the same way you want. Have
a look the part.connectors package.

Luis
Previous Topic:How to create a floating figure
Next Topic:Zest: Use of setUseHashlookup(false)
Goto Forum:
  


Current Time: Tue Oct 21 09:03:59 GMT 2014

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

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