Bug 234808

Summary: Add SplineCurveConnection to get smooth curves instead of polylines
Product: [Tools] GEF Reporter: Hauke Fuhrmann <haf>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: hudsonr, nyssen, xraynaud
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
SplineCurveConnection class extending a PolylineConnection
none
example image showing the splines none

Description Hauke Fuhrmann CLA 2008-05-30 06:14:17 EDT
Created attachment 102829 [details]
SplineCurveConnection class extending a PolylineConnection

The request is to add smooth curves to the list of available connections instead of polylines only. This could be bezier curves or cubic splines.

See attached my version of a cubic spline curve connection, which extends a PolylineConnection. It still has room for improvements but already looks quite nice. If interested you can use it.
Comment 1 Hauke Fuhrmann CLA 2008-05-30 06:15:39 EDT
Created attachment 102832 [details]
example image showing the splines
Comment 2 Randy Hudson CLA 2008-05-30 12:07:36 EDT
Regarding the patch, I think we should be using either SWT's Path or AWT's geometry package (see StrokePointList) to compute/render the curve.  In the attached screenshot you can still see the staight-line segments.
Comment 3 Hauke Fuhrmann CLA 2008-06-09 05:00:44 EDT
Yeah, that would be nice. I gave it a first try with the drawPath(Path) method, but I got this exception:

Exception in thread "Thread-1" java.lang.RuntimeException: The class:
class org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics
has not implemented this new graphics function

The GEF newsgroup said: 
"This is not a exactly GEF issue, the code you are using is in GMF.
The exception indicates that this support is not implemented in the 
ScaledGraphics in GMF. I would raise an enhancement request in Bugzilla.It 
is not clear to me if the ScaledGraphics in GEF has implemented this feature 
either."

I'm not enough involved to comment on this, sorry. Maybe someone else can?
Comment 4 Randy Hudson CLA 2008-06-09 13:08:22 EDT
bug 168307 may have recently addressed that exception you were seeing.
Comment 5 joseph CLA 2008-11-11 05:05:38 EST
can anyone tell me how to render a curve by using SplineCurveConnection.

any help is much appreciated..

Thanks
Joseph