Curved connections with Bendpoints? [message #223323] |
Mon, 25 September 2006 04:32  |
Eclipse User |
|
|
|
Originally posted by: branchat.hotmail.com
Hallo,
I'm trying to do an editor with curved connections, e.g. like in
MatLab/StateFlow. For each connection I have the 2 anchors and one extra
point. I'm doing this:
(...)
con.removeAllPoints();
BendpointConnectionRouter router = new BendpointConnectionRouter();
con.setConnectionRouter(router);
router.setConstraint(con, pointList);
router.route(con);
return con;
But the connection aren't curved, like before. I don't get to understand
how it works. I've looked on the doc, on the news, etc, and I don't find
how to do it.
Could you please give me some tip, or where I can read more about it?
Thanks a lot! :)
Robert
|
|
|
|
|
Re: Curved connections with Bendpoints? [message #223345 is a reply to message #223339] |
Mon, 25 September 2006 05:28  |
Eclipse User |
|
|
|
Originally posted by: siddharth.star.gmail.com
Hi,
I had implemented bendpoint sometime ago and this is how I had done it
Edit Part corresponding to the main model class#createFigure
ConnectionLayer connLayer =
(ConnectionLayer)getLayer(LayerConstants.CONNECTION_LAYER);
connLayer.setConnectionRouter(new AutomaticBendpointConnectionRouter());
Then in ConnectionEditPart (plz dont look at the coding style)
propertyChange method
((PolylineConnection)getFigure()).getConnectionRouter().rout e((PolylineConnection)
getFigure());
((org.eclipse.draw2d.Connection)getFigure()).setRoutingConst raint(getCastedModel().getBendpoints());
The above property change method should be called whenever the
ConnectionModel has a change in the List of bendpoints it has
I am assuming that you already have installed bendpoint editpolicy for
your connection edit part
Wish You Luck
Thanks,
Siddharth
|
|
|
Powered by
FUDForum. Page generated in 0.23352 seconds