Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Connection routing style while drawing
Connection routing style while drawing [message #57798] Fri, 29 September 2006 22:25 Go to next message
Eclipse UserFriend
Originally posted by: tim.rti.com

In my application, a user can add rectangles as well as make connections
between rectangles. Ideally, when a user makes connections, the connection
will be rectilinear, avoiding obstacles.

I modified my connector editpart (extends ConnectionNodeEditPart)
createConnectionFigure method with the following code:

RoutingStyle style = (RoutingStyle) ((View) getModel())
..getStyle(NotationPackage.eINSTANCE.getRoutingStyle());

style.setAvoidObstructions(true);
style.setRouting(Routing.RECTILINEAR_LITERAL);

The problem is, when a user clicks on a rectangle and starts to drag away
from it, there is a straight dotted line that appears. Is there any way to
make this dotted line also rectilinear and avoid obstacles?

Thanks in advance!

Tim
Re: Connection routing style while drawing [message #70353 is a reply to message #57798] Thu, 26 October 2006 17:30 Go to previous message
Tom Macdougall is currently offline Tom MacdougallFriend
Messages: 4
Registered: July 2009
Junior Member
I don't know of an easy solution for this but you may want to watch:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=158844

If this extension point is exposed then you may be able to add your own
router or possibly extend another with the functionality that you need.
GEF's ShortestPathConnectionRouter seems to be a step in the direction
that you want to go.

-Tom

Timothy Lee wrote:
> In my application, a user can add rectangles as well as make connections
> between rectangles. Ideally, when a user makes connections, the connection
> will be rectilinear, avoiding obstacles.
>
> I modified my connector editpart (extends ConnectionNodeEditPart)
> createConnectionFigure method with the following code:
>
> RoutingStyle style = (RoutingStyle) ((View) getModel())
> .getStyle(NotationPackage.eINSTANCE.getRoutingStyle());
>
> style.setAvoidObstructions(true);
> style.setRouting(Routing.RECTILINEAR_LITERAL);
>
> The problem is, when a user clicks on a rectangle and starts to drag away
> from it, there is a straight dotted line that appears. Is there any way to
> make this dotted line also rectilinear and avoid obstacles?
>
> Thanks in advance!
>
> Tim
>
>
Previous Topic:how to reflect model inheritance hierarchy in the generated editParts ?
Next Topic:how to associate model objects with a Resource?
Goto Forum:
  


Current Time: Wed Jul 17 15:09:23 GMT 2024

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

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

Back to the top