| 
| Connection routing style while drawing [message #57798] | Fri, 29 September 2006 18:25  |  | 
| Eclipse User  |  |  |  |  | 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 13:30  |  | 
| Eclipse User  |  |  |  |  | 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
 >
 >
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.04624 seconds