|
Re: Self-Connections When Using BendpointConnectionRouter [message #194663 is a reply to message #194648] |
Sun, 04 September 2005 09:14 |
Eclipse User |
|
|
|
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 |
Felix L J Mayer 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 #195093 is a reply to message #195085] |
Wed, 07 September 2005 21:02 |
Eclipse User |
|
|
|
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 #195340 is a reply to message #194648] |
Fri, 09 September 2005 14:18 |
Sapna George 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
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.09718 seconds