Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how to show multiple rectilinear lines between two nodes
how to show multiple rectilinear lines between two nodes [message #158384] Mon, 05 November 2007 18:15 Go to next message
Li Ding is currently offline Li DingFriend
Messages: 29
Registered: July 2009
Junior Member
Hi,

I am wondering if there is a way to show multiple rectilinear lines
between two nodes. My editor programmatically creates these connections
between two related nodes. The default slidable anchors are used for
source and target anchors.
The problem is that multiple rectilinear connections are displayed as
one line because these lines are totally overlaid. I tried to set jump
link and status in routing style but the jumps only display at the corner
and are not selectable. Using oblique lines are fine because multiple
lines are displayed.

Thanks.

Li
Re: how to show multiple rectilinear lines between two nodes [message #162181 is a reply to message #158384] Thu, 22 November 2007 20:39 Go to previous messageGo to next message
Li Ding is currently offline Li DingFriend
Messages: 29
Registered: July 2009
Junior Member
Just report back in case other people has similar problem. I extends
AutomaticRouter and wrap Rectilinear router with it. Used similar approach
of FanRouter to resolve the line overlap. I only handled the overlapped
rectilinear lines with 2 or 3 bendpoints but that is good enough for me.

Li
Re: how to show multiple rectilinear lines between two nodes [message #162754 is a reply to message #162181] Tue, 27 November 2007 05:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hello Li,

I have explicitly set the default connection style to be rectilinear,so
i'm having similar problem if there are more than one connection between 2
nodes.Can you send me code snippet.

Thanks in advance.

Regards,
Shwetha
Re: how to show multiple rectilinear lines between two nodes [message #163994 is a reply to message #162181] Tue, 04 December 2007 06:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi Li,

Even i have similar problem can please send me the code snippet.

Thanks in advance.

Regards,
Shwetha
Re: how to show multiple rectilinear lines between two nodes [message #165573 is a reply to message #162754] Mon, 17 December 2007 04:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi Li..

I have more than 2 connection between the nodes and by default i have set
connection style to be rectilinear so i have similar problem of
overlapping connections.

Can you please send me the code snippet...

Thanks in advance.

Regards,
Shwetha
Re: how to show multiple rectilinear lines between two nodes [message #165778 is a reply to message #165573] Tue, 18 December 2007 16:53 Go to previous messageGo to next message
Li Ding is currently offline Li DingFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Shwetha,

You may try this:
1. Extend AutomaticRouter to override route(). AutomaticRouter defines
collision as 2 connections with no bendpoints and whose start and end
points coincide. This is not adequate for rectilinear line. You need to
determine when the two lines are overlapped. One way to do this to compare
all the bendpoints. I only check 2 or 3 bendpoints so far for performance
reason. However the checking is extensible by subclass.
2. Once you know the two lines are overlapped, you need to find a way
to modify one of the lines to avoid the overlap. You can do similar fan
out as what FanRouter does to insert additional bendpoints to the line.
Just to make sure it still is a rectilinear line.
3. Finally you extend ConnectionLayerEx and override
getRectilinearRouter() to return your router in step 1. Remember to set
the next router to normal RectilinearRouter.

Unfortunately you have to extend some internal GMF runtime classes.

My code is not open-sourced yet. I have not checked if the enhancement
work on rectilinear routing in GMF will cover this in the future. If not
and there is a general interest for this problem, I can contribute this
piece to GMF.

Li
Re: how to show multiple rectilinear lines between two nodes [message #167027 is a reply to message #165778] Mon, 07 January 2008 09:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi Li,

Thanks for the info. I tried to override installRouter() inside the
ConnectorEditPart class but of no use.The route() of FanRouter class is
invoked before the installRouter()

Can you please let me know where exactly should I make changes?
Should I use by own MyRouter class instead of FanRouter class?


Thanks in advance.Awaiting u'r reply.

Regards,
Shwetha
Re: how to show multiple rectilinear lines between two nodes [message #167414 is a reply to message #167027] Tue, 08 January 2008 18:19 Go to previous message
Li Ding is currently offline Li DingFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Shwetha,

I forgot to mention the changes in connection editpart. The
installRouter() of your connection editpart should check the routing
style. If the routing is rectilinear style, set the router to your own
router class, not the default GMF's FanRouter. If you extends
ConnectionLayerEx already (see step 3 in my previous post), then you can
simply asks the connection layer for your rectilinear router.

Li
Previous Topic:Tutorial??
Next Topic:How to put a label on a gif image
Goto Forum:
  


Current Time: Sun Sep 01 05:43:18 GMT 2024

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

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

Back to the top