Skip to main content



      Home
Home » Eclipse Projects » GEF » Draw2d/GEF Connection Router
Draw2d/GEF Connection Router [message #9480] Mon, 10 June 2002 18:57 Go to next message
Eclipse UserFriend
Hello,
I am looking for a Draw2D Connection Routing algorithm to use when
drawing a graph with GEF. The routing algorithm should route edges of a
graph from left to right, and be composed of horizontal and vertical
line segments. Each edge will have an arrow pointing from left to
right, on the right end of each edge. Here's an example of what I'm
looking for, for a graph Rooted at A, where A has three children, B C &
D, and B has two children E & F, and finally D has child G which has
child H:


---->E
|
----->B----|
| |
| ---->F
|
A-----|---->C
|
|
|
----->D---->G---->H


I found that the com.ibm.etools.draw2d.ManhattanConectionRouter
algorithm draws the edges with horizontal and vertical line segments (as
opposed to, say, the com.ibm.etools.draw2d.AutomaticRouter which draws a
single line segment between each pair of nodes). However,
ManhattanConnectionRouter doesn't route the edges and arrows in an
intuitive way for the left-to-right graph that I'm trying to draw. I
understand that the ManhattanConnectionRouter has its own specialized
purpose for which it works well, but it's not targeted at the kind of
edge routing I'm looking for.
Each of the arrows drawn by ManhattanConnectionRouter is on the
right end of the edge, but the arrows point either up or down, they
don't point left to right. Further, the edges are not always routed in
a natural way, for instance D has one child G, which has one child H,
but the edge between D-G and between G-H does not go directly to the
node, it goes up, then to the right, then down. Here's what the above
graph looks like using the ManhattanConnectionRouter:


/\E
|
------|
|
/\B|
| |
----------| ------|
| | |
A| \/C \/F
|
|
|---------| ------| ------|
| | | | |
\/D| \/G| \/H


Hopefully you can see the graph clearly even though it is shown with
ASCII characters. The up arrow looks like:
/\
|
|

and the down arrow looks like:
|
|
\/


Has anybody else developed a routing algorithm that would draw the
connections in a way that's similar to the first graph above? Or does
anybody else have a need for such an algorithm?


Thanks,
Andy Lavery
alavery@us.ibm.com
Re: Draw2d/GEF Connection Router [message #9932 is a reply to message #9480] Thu, 13 June 2002 13:57 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

That is a problem with the anchors you are using, not the router. Are you
using ChopBox?

"Andy Lavery" <alavery@us.ibm.com> wrote in message
news:3D052ED7.10708@us.ibm.com...
> Hello,
> I am looking for a Draw2D Connection Routing algorithm to use when
> drawing a graph with GEF. The routing algorithm should route edges of a
> graph from left to right, and be composed of horizontal and vertical
> line segments. Each edge will have an arrow pointing from left to
> right, on the right end of each edge. Here's an example of what I'm
> looking for, for a graph Rooted at A, where A has three children, B C &
> D, and B has two children E & F, and finally D has child G which has
> child H:
>
>
> ---->E
> |
> ----->B----|
> | |
> | ---->F
> |
> A-----|---->C
> |
> |
> |
> ----->D---->G---->H
>
>
> I found that the com.ibm.etools.draw2d.ManhattanConectionRouter
> algorithm draws the edges with horizontal and vertical line segments (as
> opposed to, say, the com.ibm.etools.draw2d.AutomaticRouter which draws a
> single line segment between each pair of nodes). However,
> ManhattanConnectionRouter doesn't route the edges and arrows in an
> intuitive way for the left-to-right graph that I'm trying to draw. I
> understand that the ManhattanConnectionRouter has its own specialized
> purpose for which it works well, but it's not targeted at the kind of
> edge routing I'm looking for.
> Each of the arrows drawn by ManhattanConnectionRouter is on the
> right end of the edge, but the arrows point either up or down, they
> don't point left to right. Further, the edges are not always routed in
> a natural way, for instance D has one child G, which has one child H,
> but the edge between D-G and between G-H does not go directly to the
> node, it goes up, then to the right, then down. Here's what the above
> graph looks like using the ManhattanConnectionRouter:
>
>
> /\E
> |
> ------|
> |
> /\B|
> | |
> ----------| ------|
> | | |
> A| \/C \/F
> |
> |
> |---------| ------| ------|
> | | | | |
> \/D| \/G| \/H
>
>
> Hopefully you can see the graph clearly even though it is shown with
> ASCII characters. The up arrow looks like:
> /\
> |
> |
>
> and the down arrow looks like:
> |
> |
> \/
>
>
> Has anybody else developed a routing algorithm that would draw the
> connections in a way that's similar to the first graph above? Or does
> anybody else have a need for such an algorithm?
>
>
> Thanks,
> Andy Lavery
> alavery@us.ibm.com
>
Previous Topic:GridLayout
Next Topic:more simple example please
Goto Forum:
  


Current Time: Sat May 10 22:33:06 EDT 2025

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

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

Back to the top