|
Re: Curves [message #220960 is a reply to message #220940] |
Tue, 08 August 2006 13:52 |
Eclipse User |
|
|
|
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 #221001 is a reply to message #220967] |
Tue, 08 August 2006 21:44 |
Eclipse User |
|
|
|
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.
>>
|
|
|
Powered by
FUDForum. Page generated in 0.02822 seconds