Spline/Curved polyline [message #223029] |
Fri, 27 March 2009 21:27 |
BG Messages: 45 Registered: July 2009 |
Member |
|
|
Hi,
I would like to know how to create the spline/curved polyline. I tried by
some approach as suggested in below specified links
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg1 7070.html
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 5911.html
http://www.eclipsezone.com/eclipse/forums/t76409.html
As suggested i extended the PolylineConnectionEx class and tried to
override the method
protected void outlineShape(Graphics g) {
//super.outlineShape(g);
PointList newPoints = new PointList();
//newPoints.addPoint(originalPoints.getFirstPoint());
Point startPoint = originalPoints.getFirstPoint().getCopy();
Point endPoint = originalPoints.getLastPoint().getCopy();
int xd = Math.abs((endPoint.x - startPoint.x)/10);
Point startMidPoint = new Point(startPoint.x-xd,startPoint.y);
Point endMidPoint = new Point(endPoint.x+xd,endPoint.y);
newPoints.addPoint(startPoint);
newPoints.addPoint(startMidPoint);
newPoints.addPoint(endMidPoint);
newPoints.addPoint(endPoint);
g.drawPolyline(newPoints);
}
But it did't work as expected. Let me know if some one has come across
this issue and possible solutuion for it.
I had also tried introducing absolutependboint that also doest seems to
work fine.
Regards
Byre
|
|
|
Powered by
FUDForum. Page generated in 0.03796 seconds