Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » problems with ManhattanConnectionRouter
problems with ManhattanConnectionRouter [message #184252] Fri, 10 June 2005 21:08 Go to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 193
Registered: July 2009
Senior Member
Hi,

can anyone help me to customize a ManhattanConnection Router.
I have written a GEF Edtitor with some Edit Parts an Connections. I use the
ManhattanConnectionRouter. So far all works fine.
But as my EditParts have fixed positions and the user should only define
which connections he needs, I whant to refine the ManhattanRouting a little
bit ;-)
Just whant to add some smal edges for better look.

My code is now very simple. Where can I influence the routig path?

Thanks for help
Ralph

public class AssociationEditPart extends AbstractConnectionEditPart {
PolylineConnection polylineConnection;
protected IFigure createFigure() {
polylineConnection = new PolylineConnection();
polylineConnection.setTargetDecoration(new PolygonDecoration());
ManhattanConnectionRouter manhattanConnectionRouter= new
ManhattanConnectionRouter();
polylineConnection.setConnectionRouter( manhattanConnectionRouter);
return polylineConnection;
}

protected void createEditPolicies() {
installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new
ConnectionEndpointEditPolicy());

installEditPolicy(EditPolicy.CONNECTION_ROLE, new
ConnectionEditPolicy() {
protected Command getDeleteCommand(final GroupRequest request) {
return new AssociationDeleteCommand((Association)
getModel());
}
});
}
Re: problems with ManhattanConnectionRouter [message #184279 is a reply to message #184252] Sat, 11 June 2005 12:12 Go to previous message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 193
Registered: July 2009
Senior Member
in the meantime I found out that is very simple to write a own
connectionRouter
Here a simple example for a ConnectionRouter with fixed Points:


import org.eclipse.draw2d.*;
import org.eclipse.draw2d.geometry.*;
public class MyConnectionRouter extends AbstractRouter {

public void route(Connection connection) {
PointList points = connection.getPoints();
points.removeAllPoints();

points.addPoint(new Point(100,100));
points.addPoint(new Point(120,100));
points.addPoint(new Point(120,120));

connection.setPoints(points);


}
}
Previous Topic:problems with ManhattanConnectionRouter
Next Topic:ActionBarContributor why?
Goto Forum:
  


Current Time: Mon Dec 02 21:11:43 GMT 2024

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

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

Back to the top