Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Self-Connections When Using BendpointConnectionRouter
Self-Connections When Using BendpointConnectionRouter [message #194648] Fri, 02 September 2005 18:20 Go to next message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
In my diagram, I have rectangular nodes with PolylineConnections between
them. I want to provide self-connection support, i.e. the source and
target of the connection is the same node. '


like this:


|----|
| |
| |-V---|
|--|Node |
|-----|


I followed the suggestions in a earlier post on the same topic - Aug 4
2005 by Chirstian Sell titled "Self-Referencing Connections". My source
anchor is getBounds().getLeft() and target is getBounds().getTop().
However, that post uses ManhanttanRouter, while I'm using (i NEED)
BandpointConnectionRouter. So, by default I don't get the neat
right-angled connection like in the diagram, instead it just draws a
straight line between the source and target anchors.


Like this:


|--/---|
| / |
|/Node |
|------|



So, I forcibly inserted 3 bendpoints correponding to the 3 corners that i
need in my connection. And it seems ok.



My problem is that i want to support multiple such self-connections. Since
i'm hard-coding these anchors and bendpoints, i can't draw more than 1
such connection. Is there a less painful way to achieve support for
mulitple self-connections when using BendpointConnectionRouter?

Any help/suggestion is greatly appreciated.
thanks
Sapna
Re: Self-Connections When Using BendpointConnectionRouter [message #194663 is a reply to message #194648] Sun, 04 September 2005 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.sell.netcologne.de

Hi,

my feeling from my own experience is that this subject is going to
remain tricky. Even when using the MCR, I had to invent special
"slot-assignment" logic for the connection anchors to avoid several
connections being anchored at the same point, which did not look good at
all. I think this might be a good generic extension to the existing GEF
infrastructure (my implementation is too hacky, I am afraid), along with
a connection router that avoids crossing other figure boundaries.

christian


Sapna George wrote:
> In my diagram, I have rectangular nodes with PolylineConnections between
> them. I want to provide self-connection support, i.e. the source and
> target of the connection is the same node. '
>
>
> like this:
>
>
> |----|
> | | | |-V---|
> |--|Node |
> |-----|
>
>
> I followed the suggestions in a earlier post on the same topic - Aug 4
> 2005 by Chirstian Sell titled "Self-Referencing Connections". My source
> anchor is getBounds().getLeft() and target is getBounds().getTop().
> However, that post uses ManhanttanRouter, while I'm using (i NEED)
> BandpointConnectionRouter. So, by default I don't get the neat
> right-angled connection like in the diagram, instead it just draws a
> straight line between the source and target anchors.
>
> Like this:
>
>
> |--/---|
> | / |
> |/Node |
> |------|
>
>
>
> So, I forcibly inserted 3 bendpoints correponding to the 3 corners that
> i need in my connection. And it seems ok.
>
>
> My problem is that i want to support multiple such self-connections.
> Since i'm hard-coding these anchors and bendpoints, i can't draw more
> than 1 such connection. Is there a less painful way to achieve support
> for mulitple self-connections when using BendpointConnectionRouter?
> Any help/suggestion is greatly appreciated. thanks
> Sapna
>
>
>
>
>
>
Re: Self-Connections When Using BendpointConnectionRouter [message #194955 is a reply to message #194648] Tue, 06 September 2005 19:37 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
I ended up writing a special router for self-connections that routes them
similar to the FanRouter, but around a specific corner of the node. I also
had to change the FanRouter to not touch self-connections.

"Sapna George" <sgeorge@vt.edu> wrote in message
news:35a1d6568fb1b45789c5e4978ac25635$1@www.eclipse.org...
> In my diagram, I have rectangular nodes with PolylineConnections between
> them. I want to provide self-connection support, i.e. the source and
> target of the connection is the same node. '
>
>
> like this:
>
>
> |----|
> | | | |-V---|
> |--|Node |
> |-----|
>
>
> I followed the suggestions in a earlier post on the same topic - Aug 4
> 2005 by Chirstian Sell titled "Self-Referencing Connections". My source
> anchor is getBounds().getLeft() and target is getBounds().getTop().
> However, that post uses ManhanttanRouter, while I'm using (i NEED)
> BandpointConnectionRouter. So, by default I don't get the neat
> right-angled connection like in the diagram, instead it just draws a
> straight line between the source and target anchors.
>
> Like this:
>
>
> |--/---|
> | / |
> |/Node |
> |------|
>
>
>
> So, I forcibly inserted 3 bendpoints correponding to the 3 corners that i
> need in my connection. And it seems ok.
>
>
> My problem is that i want to support multiple such self-connections. Since
> i'm hard-coding these anchors and bendpoints, i can't draw more than 1
> such connection. Is there a less painful way to achieve support for
> mulitple self-connections when using BendpointConnectionRouter?
> Any help/suggestion is greatly appreciated. thanks
> Sapna
>
>
>
>
>
>
Re: Self-Connections When Using BendpointConnectionRouter [message #195028 is a reply to message #194955] Wed, 07 September 2005 14:44 Go to previous messageGo to next message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
Could i request you to share the logic of the new router? May be i can
follow it to create a new SelfConnectionBendpointRouter for my needs!

thanks!
Sapna
Re: Self-Connections When Using BendpointConnectionRouter [message #195036 is a reply to message #195028] Wed, 07 September 2005 15:47 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
The code was written for GEF 2.1, but it still seems to work.
Note that my AutomaticRouter works a little different from the one in GEF.

"Sapna George" <sgeorge@vt.edu> wrote in message
news:8fcd9bdcc13e9340f7b4107ca9fa8fb8$1@www.eclipse.org...
> Could i request you to share the logic of the new router? May be i can
> follow it to create a new SelfConnectionBendpointRouter for my needs!
>
> thanks!
> Sapna
>
>




Re: Self-Connections When Using BendpointConnectionRouter [message #195085 is a reply to message #195036] Wed, 07 September 2005 20:31 Go to previous messageGo to next message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
I don't know if it is some setting in my browser, but the code that you
pasted in the previous post is garbled. I can't make out anything.

thanks
sapna
Re: Self-Connections When Using BendpointConnectionRouter [message #195093 is a reply to message #195085] Wed, 07 September 2005 21:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Sapna George" <sgeorge@vt.edu> wrote in message
news:363ed1550a9d030f98626cb5706bd831$1@www.eclipse.org...
>I don't know if it is some setting in my browser, but the code that you
>pasted in the previous post is garbled. I can't make out anything.
The files are in uuencoded format.
Most newsreaders should be able to decode them and make them available as
attachments.
What newsreader are you using?
---
Sunil
Re: Self-Connections When Using BendpointConnectionRouter [message #195117 is a reply to message #195085] Wed, 07 September 2005 21:58 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
I use Outlook Express as my news reader, you should have that too if you
have Windows XP.

"Sapna George" <sgeorge@vt.edu> wrote in message
news:363ed1550a9d030f98626cb5706bd831$1@www.eclipse.org...
>I don't know if it is some setting in my browser, but the code that you
>pasted in the previous post is garbled. I can't make out anything.
> thanks
> sapna
>
>
Re: Self-Connections When Using BendpointConnectionRouter [message #195149 is a reply to message #195117] Thu, 08 September 2005 13:48 Go to previous messageGo to next message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
Ah ha! I am using plain old vanilla Internet Explorer and the website
http://www.eclipse.org/newsportal/thread.php?group=eclipse.t ools.gef. :-)

I switched to Outlook Express and got the attachments.

thanks a bunch.
Sapna
Re: Self-Connections When Using BendpointConnectionRouter [message #195340 is a reply to message #194648] Fri, 09 September 2005 14:18 Go to previous message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
I got my solution to this problem. I ended up writing a new
BendpointSelfConnectionRouter and a new CornerAnchor. The CornerAnchor and
BendpointSelfConnectionRouter are used only for SelfConnections. Regular
Connections use org.eclipse.draw2d.ChopboxAnchor and
org.eclipse.draw2d.BendpointConnectionRouter

The CornerAnchor attatches the SelfConnection to the closest corner of the
Rectangle. This way. i don't have to hardcode the anchors to a single
corner. The new router is a combination of the BendpointConnectionRouter and
the FanRouter. My problem with the original BendpointConnectionRotuer is
that in the case of a Self Connection, it just draws a diagonal line cutting
through the node connecting the start and end anchors like this:
+--/--- +
| / |
|/Node |
+------ +

So, following the logic in FanRouter, my new Router just inserts a new Point
so that the connection is routed around the corner outside the node:
\
\ \
\ \
\ +--\-----+
\ | |
| Node |
+------ +

Like the FanRouter, it also detects collisions so that new Connections
around the same corner fans out into longer triangles.

It's not the prettiest connection ever, but it works!!

Attached are both the classes.
thanks for all the help

Sapna


"Sapna George" <sgeorge@vt.edu> wrote in message
news:35a1d6568fb1b45789c5e4978ac25635$1@www.eclipse.org...
> In my diagram, I have rectangular nodes with PolylineConnections between
> them. I want to provide self-connection support, i.e. the source and
> target of the connection is the same node. '
>
>
> like this:
>
>
> |----|
> | |
> | |-V---|
> |--|Node |
> |-----|
>
>
> I followed the suggestions in a earlier post on the same topic - Aug 4
> 2005 by Chirstian Sell titled "Self-Referencing Connections". My source
> anchor is getBounds().getLeft() and target is getBounds().getTop().
> However, that post uses ManhanttanRouter, while I'm using (i NEED)
> BandpointConnectionRouter. So, by default I don't get the neat
> right-angled connection like in the diagram, instead it just draws a
> straight line between the source and target anchors.
>
>
> Like this:
>
>
> |--/---|
> | / |
> |/Node |
> |------|
>
>
>
> So, I forcibly inserted 3 bendpoints correponding to the 3 corners that i
> need in my connection. And it seems ok.
>
>
>
> My problem is that i want to support multiple such self-connections. Since
> i'm hard-coding these anchors and bendpoints, i can't draw more than 1
> such connection. Is there a less painful way to achieve support for
> mulitple self-connections when using BendpointConnectionRouter?
>
> Any help/suggestion is greatly appreciated.
> thanks
> Sapna
>
>
>
>
>
>



Previous Topic:Label does not resize after changing text in GEF 3.1
Next Topic:Change perspective on selection
Goto Forum:
  


Current Time: Tue Jan 21 19:58:12 GMT 2025

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

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

Back to the top