Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Spline/Curved polyline
Spline/Curved polyline [message #223029] Fri, 27 March 2009 21:27
BG is currently offline BGFriend
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
Previous Topic:GMF Editor without FileInput
Next Topic:Save button doesnt enable using set methods
Goto Forum:
  


Current Time: Fri Apr 26 12:33:30 GMT 2024

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

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

Back to the top