Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Curved connections with Bendpoints?
Curved connections with Bendpoints? [message #223323] Mon, 25 September 2006 08:32 Go to next message
Eclipse UserFriend
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 #223331 is a reply to message #223323] Mon, 25 September 2006 08:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: siddharth.star.gmail.com

try doing a con.setRoutingConstraint(pointList)
Re: Curved connections with Bendpoints? [message #223339 is a reply to message #223331] Mon, 25 September 2006 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: branchat.hotmail.com

Siddharth wrote:
> try doing a con.setRoutingConstraint(pointList)
>

Thanks Siddharth! I've added it, but... nothing:

con.removeAllPoints();
BendpointConnectionRouter router = new BendpointConnectionRouter();
con.setConnectionRouter(router);
>con.setRoutingConstraint(pointList);
router.setConstraint(con, pointList);
router.route(con);
return con;

The anchors I'm using are ChopboxAnchors, but I think it can work also
with such an anchor, isn't it?

Or maybe there is a problem with the connection layer?

....

Thanks a lot for your tips!

Robert
Re: Curved connections with Bendpoints? [message #223345 is a reply to message #223339] Mon, 25 September 2006 09:28 Go to previous message
Eclipse UserFriend
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
Previous Topic:Ask for EclipseUML
Next Topic:ComboBox or anything similar in GEF?
Goto Forum:
  


Current Time: Sat Dec 20 08:58:27 GMT 2014

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

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