Skip to main content



      Home
Home » Eclipse Projects » GEF » Different Routing for different type of connections
Different Routing for different type of connections [message #628831] Fri, 24 September 2010 07:05 Go to next message
Eclipse UserFriend
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??
Re: Different Routing for different type of connections [message #631732 is a reply to message #628831] Fri, 08 October 2010 10:41 Go to previous messageGo to next message
Eclipse UserFriend
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).

Re: Different Routing for different type of connections [message #632726 is a reply to message #631732] Thu, 14 October 2010 01:34 Go to previous message
Eclipse UserFriend
Thanks prasad,

i implemented the same by writing a deligating router which implements ConnectionRouter but deligates the calls to specific routers for specific conditions...
Previous Topic:Repeating/Streching with ImageFigures
Next Topic:Stange behaviour on resolution change
Goto Forum:
  


Current Time: Wed Jul 23 15:17:08 EDT 2025

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

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

Back to the top