Tuesday, August 19, 2008

BEND IT LIKE BECKHAM IN GEF...

Provide the following implementation in createFigure() of RootEditPartClass


//NOTE:-
The SmoothLineAlg Based on below 2Lines & Return the figure

f = new FreeformLayer();
f.setLayoutManager(new FreeformLayout());
f.setBorder(new MarginBorder(5));
ConnectionLayerconnLayer=(ConnectionLayer)getLayer(LayerConstants.CONNECTION_LAYER);
connLayer.setConnectionRouter(new ShortestPathConnectionRouter(f));
return
f;

Result will be like this…



Regards
karthik N:)

2 comments:

Prakash G.R. said...

Guess its the property of ShortestPathRouter. If you use others like ManhattanRouter, you won't get this

David Green said...

It would be nice to get curved lines. Is there an easy way to get bezier curves?