Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:05 Go to next message
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 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad Bandaru
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

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 05:34 Go to previous message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
Thanks prasad,

i implemented the same by writing a deligating router which implements ConnectionRouter but deligates the calls to specific routers for specific conditions...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Previous Topic:Repeating/Streching with ImageFigures
Next Topic:Stange behaviour on resolution change
Goto Forum:
  


Current Time: Tue Oct 21 03:56:20 GMT 2014

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

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