Skip to main content



      Home
Home » Eclipse Projects » GEF » ConnectionRouter
ConnectionRouter [message #167369] Mon, 07 February 2005 16:55 Go to next message
Eclipse UserFriend
Hi,

Is there any way I can mix different ConnectionRouters in a diagram?

The thing is, that I can set the routing of PolylineConnection on a per line
basis using getFigure().setConnectionRouter(router).

However, this doesn't seem to work for the FanRouter using for example
Manhattan oder Bendpoint as their nextRouter.

FanRouter seems to work when setting it as ConnectionRouter on the
CONNECTION_LAYER.
This on the other hand resets my per line router settings. All lines will
then be routed by the CONNECTION_LAYER-router.


What I would like to do is use the

FanRouter with
ShortesPathConnectionRouter
ManhattanRouter and
BendpointRouter
as its nextRouter.
All this on a per line basis.

How could this be achieved? If at all....


Thanks for any help
Fabian
Re: ConnectionRouter [message #167377 is a reply to message #167369] Mon, 07 February 2005 18:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> ShortesPathConnectionRouter

This router handles bendpoints already.

> ManhattanRouter and

Why would you ever want to use this router ;-)?

> BendpointRouter

See first comment

> as its nextRouter.
> All this on a per line basis.
>
> How could this be achieved? If at all....

The FanRouter instance must be shared for all connections. It wrappers
another router, so build a multiplexer which keeps a Map of
connection->secondary connectionrouter. It would contain the available
instances which are choices.

BTW, ShortestPathConnectionRouter must also be one instance per diagram. It
will increasingly offset connections similar to fan router.

> Thanks for any help
> Fabian
Re: ConnectionRouter [message #167407 is a reply to message #167377] Tue, 08 February 2005 04:31 Go to previous messageGo to next message
Eclipse UserFriend
Randy Hudson wrote:

>> ShortesPathConnectionRouter
>
> This router handles bendpoints already.

Great :)

>> ManhattanRouter and
>
> Why would you ever want to use this router ;-)?

It looks good?

> [...]
>
> The FanRouter instance must be shared for all connections. It wrappers
> another router, so build a multiplexer which keeps a Map of
> connection->secondary connectionrouter. It would contain the available
> instances which are choices.

ah,... it's getting clear...

> BTW, ShortestPathConnectionRouter must also be one instance per diagram.
> It will increasingly offset connections similar to fan router.

You mean it doesn't make sense to use FanRouter and
ShortestPathConnectionRouter as its nextRouter b/c SPCR already does
fanning?


Thanks a lot!
Fabian
Re: ConnectionRouter [message #167437 is a reply to message #167407] Tue, 08 February 2005 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> You mean it doesn't make sense to use FanRouter and
> ShortestPathConnectionRouter as its nextRouter b/c SPCR already does
> fanning?

No, SPCR only does fanning if the connection bend around an obstacle.
Otherwise it does straight-line routeing. I just wanted to stress the fact
that almost all router implementations need to be per-diagram. For example,
with BendpointRouter, every connection could have a unique instance of that
type of router, and the only sideeffect would be small memory wasted. SPCR
on the other hand must have shared access to all connections it deals with.

Your multiplexer will have to be careful in satisfying SPCR. It relies on
all API being forwarded to it to keep track of incremental updates.

>
>
> Thanks a lot!
> Fabian
Re: ConnectionRouter [message #167555 is a reply to message #167437] Wed, 09 February 2005 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Randy Hudson wrote:

>> You mean it doesn't make sense to use FanRouter and
>> ShortestPathConnectionRouter as its nextRouter b/c SPCR already does
>> fanning?
>
> No, SPCR only does fanning if the connection bend around an obstacle.
> Otherwise it does straight-line routeing. I just wanted to stress the
> fact
> that almost all router implementations need to be per-diagram. For
> example, with BendpointRouter, every connection could have a unique
> instance of that
> type of router, and the only sideeffect would be small memory wasted.
> SPCR on the other hand must have shared access to all connections it deals
> with.
>
> Your multiplexer will have to be careful in satisfying SPCR. It relies on
> all API being forwarded to it to keep track of incremental updates.
>

Thanks Randy for answering all those (to you probably stupid questions) in
here with such a patience.

I'm finally getting to it :)

What I was wondering now, after having bent two or three times, SPCR runs
through figures again,...
Is there some limit in routing around figures?
I started playing with NUM_GROW_PASSES in your ShortestPathRouter to see if
this shows any effect...
I tend to believe it did help sometimes - not always(?). Don't really know.


Fabian
Re: ConnectionRouter [message #167635 is a reply to message #167555] Wed, 09 February 2005 17:22 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> What I was wondering now, after having bent two or three times, SPCR runs
> through figures again,...
> Is there some limit in routing around figures?

There is no limit at all. I can get 100 bends to showup easily in the logic
example. Figure's whose bounds contain the starting or ending point are
ignored.

> I started playing with NUM_GROW_PASSES in your ShortestPathRouter to see
> if

This type of pass refers to when the connection is bent around an obstacle
and then incrementally offset from that obstacle, does it now intersect some
new obstacle as a result. The default value should handle normal cases.

> this shows any effect...
> I tend to believe it did help sometimes - not always(?). Don't really
> know.
>
Previous Topic:Moving figures requires two steps??
Next Topic:Spell checker like decoration (~~~~~~) for org.eclipse.draw2d.Label
Goto Forum:
  


Current Time: Wed Jun 18 12:04:53 EDT 2025

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

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

Back to the top