Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Curves
Curves [message #220940] Tue, 08 August 2006 08:08 Go to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
Hi.

I wonder if somebody has implemented curve figures like quadratic and/or cubic curves
like awt's. (java.awt.geom.QuadCurve2D) I'm planing to do this but i'm not sure if it
is best to draw the curve with Graphics.drawArc(...) or with Graphics.drawPoint(). The
curve must also have "control points" for adjusting the "curvature". I hope somebody
give me any tips.

Thanks and excuse me for my bad english.
Re: Curves [message #220960 is a reply to message #220940] Tue, 08 August 2006 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dscholz.htwm.de

Hello,

i would suggest to use a Path (org.eclipse.swt.graphics.Path) where you
can find the methods quadTo(...) for quadratic curves with one control
point and cubicTo(...) for a bezier curve with two control points. You can
add several curves to the path before drawing it with
Graphics.drawPath(...) At first move the Path with moveTo(...) to the
Location where you want to begin the curve and then you can add curves
with the mentioned methods above. Dispose the path if it's not needed any
longer. e.g. I already implemented a sine figure which is drawn with a
Path and cubicTo(...)

Sebastian Gurin wrote:

> Hi.

> I wonder if somebody has implemented curve figures like quadratic and/or
cubic curves
> like awt's. (java.awt.geom.QuadCurve2D) I'm planing to do this but i'm not
sure if it
> is best to draw the curve with Graphics.drawArc(...) or with
Graphics.drawPoint(). The
> curve must also have "control points" for adjusting the "curvature". I hope
somebody
> give me any tips.

> Thanks and excuse me for my bad english.
Re: Curves [message #220967 is a reply to message #220960] Tue, 08 August 2006 09:35 Go to previous messageGo to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
thanks! will try that

On Tue, 8 Aug 2006 13:52:30 +0000 (UTC)
dscholz@htwm.de (Daniel Scholz) wrote:

> Hello,
>
> i would suggest to use a Path (org.eclipse.swt.graphics.Path) where you
> can find the methods quadTo(...) for quadratic curves with one control
> point and cubicTo(...) for a bezier curve with two control points. You can
> add several curves to the path before drawing it with
> Graphics.drawPath(...) At first move the Path with moveTo(...) to the
> Location where you want to begin the curve and then you can add curves
> with the mentioned methods above. Dispose the path if it's not needed any
> longer. e.g. I already implemented a sine figure which is drawn with a
> Path and cubicTo(...)
>
> Sebastian Gurin wrote:
>
> > Hi.
>
> > I wonder if somebody has implemented curve figures like quadratic and/or
> cubic curves
> > like awt's. (java.awt.geom.QuadCurve2D) I'm planing to do this but i'm not
> sure if it
> > is best to draw the curve with Graphics.drawArc(...) or with
> Graphics.drawPoint(). The
> > curve must also have "control points" for adjusting the "curvature". I hope
> somebody
> > give me any tips.
>
> > Thanks and excuse me for my bad english.
>
Re: Curves [message #221001 is a reply to message #220967] Tue, 08 August 2006 21:44 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If Path causes you too much trouble (requires advanced graphics), you can
approximate the path using AWT's geometry package and its path iterator,
then just paint the resulting polyline. We do this for connection focus.
Select a connection and press CTRL+SPACE to see what I'm talking about.

"Sebastian Gurin" <sgurin@montevideo.com.uy> wrote in message
news:20060808113545.15b35427@localhost.localdomain...
> thanks! will try that
>
> On Tue, 8 Aug 2006 13:52:30 +0000 (UTC)
> dscholz@htwm.de (Daniel Scholz) wrote:
>
>> Hello,
>>
>> i would suggest to use a Path (org.eclipse.swt.graphics.Path) where you
>> can find the methods quadTo(...) for quadratic curves with one control
>> point and cubicTo(...) for a bezier curve with two control points. You
>> can
>> add several curves to the path before drawing it with
>> Graphics.drawPath(...) At first move the Path with moveTo(...) to the
>> Location where you want to begin the curve and then you can add curves
>> with the mentioned methods above. Dispose the path if it's not needed any
>> longer. e.g. I already implemented a sine figure which is drawn with a
>> Path and cubicTo(...)
>>
>> Sebastian Gurin wrote:
>>
>> > Hi.
>>
>> > I wonder if somebody has implemented curve figures like quadratic
>> > and/or
>> cubic curves
>> > like awt's. (java.awt.geom.QuadCurve2D) I'm planing to do this but i'm
>> > not
>> sure if it
>> > is best to draw the curve with Graphics.drawArc(...) or with
>> Graphics.drawPoint(). The
>> > curve must also have "control points" for adjusting the "curvature". I
>> > hope
>> somebody
>> > give me any tips.
>>
>> > Thanks and excuse me for my bad english.
>>
Previous Topic:When to assign TextFlow font?
Next Topic:Displaced text with Antialiasing
Goto Forum:
  


Current Time: Wed Jan 22 19:18:33 GMT 2025

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

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

Back to the top