Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Why all connection routers do translateToRelative when routing?
Why all connection routers do translateToRelative when routing? [message #784384] Fri, 27 January 2012 12:53
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member

why all standard connection routers do that? Let's say the NullConnectionRouter:
public void route(Connection conn) {
	PointList points = conn.getPoints();
	Point p;
	conn.translateToRelative(p = getStartPoint(conn));
	conn.translateToRelative(p = getEndPoint(conn));
I have a PolyLineConnection with XYAnchors on my graph. Those anchors are absolute points.
When I zoom in my ScalableFreeformRootEditPart and also scroll it little bit, the connection is translated and zoomed out.

It is because of
conn.translateToRelative(p = getStartPoint(conn));
conn.translateToRelative(p = getEndPoint(conn));
where startPoint and endPoint are those mine absolute XYAnchor points.

Why the connection router does this traslation anyway? How does it work when connections are used appropriately in the connection layer?
Previous Topic:Algorithm to reposition shapes automatically
Next Topic:No labels after using IFigureProvider
Goto Forum:

Current Time: Thu Apr 26 15:43:44 GMT 2018

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

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