Different Routing for different type of connections [message #628831] |
Fri, 24 September 2010 11:05 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have a GEF editor in which there are different types of connections between nodes.
i need different type of routing for specific type of connections and different one for others.
like SPCR for certain types and Manhattan for others.can it be done??
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
Re: Different Routing for different type of connections [message #631732 is a reply to message #628831] |
Fri, 08 October 2010 14:41 |
|
See if this helps you
I have modified connection edit part in GEF Shapes example and added the following method..
@Override
protected void refreshVisuals() {
super.refreshVisuals();
if (getSource() instanceof ShapeEditPart ) {
IFigure figure = ((ShapeEditPart)getSource()).getFigure();
if (figure instanceof RectangleFigure) {
((PolylineConnection) getFigure()).setConnectionRouter(new ManhattanConnectionRouter());
}
}
}
Now all the routes emerging from rectangular figures will be routed by Manhattan router and from elliptical figures will be routed by shortest path connection router (which is default router for the connection layer).
Regards,
Prasad
http://marketplace.eclipse.org/user/9964/listings
|
|
|
|
Powered by
FUDForum. Page generated in 0.02771 seconds