Bug 234808 - Add SplineCurveConnection to get smooth curves instead of polylines
Summary: Add SplineCurveConnection to get smooth curves instead of polylines
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-30 06:14 EDT by Hauke Fuhrmann CLA
Modified: 2012-01-06 11:35 EST (History)
3 users (show)

See Also:


Attachments
SplineCurveConnection class extending a PolylineConnection (7.30 KB, text/plain)
2008-05-30 06:14 EDT, Hauke Fuhrmann CLA
no flags Details
example image showing the splines (12.40 KB, image/png)
2008-05-30 06:15 EDT, Hauke Fuhrmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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