Skip to main content


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
Hi,

why all standard connection routers do that? Let's say the NullConnectionRouter:
public void route(Connection conn) {
	PointList points = conn.getPoints();
	points.removeAllPoints();
	Point p;
	conn.translateToRelative(p = getStartPoint(conn));
	points.addPoint(p);
	conn.translateToRelative(p = getEndPoint(conn));
	points.addPoint(p);
	conn.setPoints(points);
}
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));
and
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:Adding Custom Connections
Next Topic:No labels after using IFigureProvider
Goto Forum:
  


Current Time: Tue Mar 19 06:14:46 GMT 2024

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

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

Back to the top