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

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: Mon Oct 25 04:35:07 GMT 2021

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

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

Back to the top