Home » Eclipse Projects » GEF » Draw curve in GEF
Draw curve in GEF [message #20150] |
Mon, 23 September 2002 20:08  |
Eclipse User |
|
|
|
Hi,
Does GEF support curve drawing like the way in MS Word? in other word, user
clicks 3 points on the sreen, it will draw a smooth curve?
Thanks.
Sam
|
|
| | |
Re: Draw curve in GEF [message #20165 is a reply to message #20156] |
Mon, 23 September 2002 22:24   |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
See AWT's CubicCurve2D#getPathIterator.
See GEF's StrokePointList class for an example using the iterator.
BTW, GEF uses this to produce an outline around a connection (for
representing focus). To see focus on a connection, select one of its nodes
and press Control+'/'
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:amogao$afd$1@rogue.oti.com...
> We don't have a ConnectionRouter for this. SWT does not support control
> points, so you would have to approximate the curve with a polyline. There
> are well-known algorithms for generating approximations with a given
> "flatness". You could probably find something in AWT geometry packages to
> do this. Look at GeneralPath, Shape, and Stroke.
>
> If you find something useful or write your own curve-to-polyline
converter,
> feel free to share ;-)
>
> "Sam Cheung" <scheung@novarra.com> wrote in message
> news:amo9bl$7i6$1@rogue.oti.com...
> > Hi,
> >
> > Does GEF support curve drawing like the way in MS Word? in other word,
> user
> > clicks 3 points on the sreen, it will draw a smooth curve?
> >
> > Thanks.
> > Sam
> >
> >
> >
>
>
|
|
|
Re: Draw curve in GEF [message #20292 is a reply to message #20165] |
Tue, 24 September 2002 11:36   |
Eclipse User |
|
|
|
Thanks for your response.
But in MS Word, when you are drawing a curve, after you first the first 2
points, it shows you the curve dynamically as you move the mouse, and when
you click the 3rd point, it draws that curve. And you can continue by
clicking the 4th, 5th times... or you finish the curve drawing by double
clicking.
In others words, I need more than just a curve-to-polyline converter, right?
I need to capture mouse click and mouse move eveents and draw the curve
dynamically. Correct?
Thanks.
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:amoh9m$asd$1@rogue.oti.com...
> See AWT's CubicCurve2D#getPathIterator.
> See GEF's StrokePointList class for an example using the iterator.
>
> BTW, GEF uses this to produce an outline around a connection (for
> representing focus). To see focus on a connection, select one of its
nodes
> and press Control+'/'
>
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:amogao$afd$1@rogue.oti.com...
> > We don't have a ConnectionRouter for this. SWT does not support control
> > points, so you would have to approximate the curve with a polyline.
There
> > are well-known algorithms for generating approximations with a given
> > "flatness". You could probably find something in AWT geometry packages
to
> > do this. Look at GeneralPath, Shape, and Stroke.
> >
> > If you find something useful or write your own curve-to-polyline
> converter,
> > feel free to share ;-)
> >
> > "Sam Cheung" <scheung@novarra.com> wrote in message
> > news:amo9bl$7i6$1@rogue.oti.com...
> > > Hi,
> > >
> > > Does GEF support curve drawing like the way in MS Word? in other
word,
> > user
> > > clicks 3 points on the sreen, it will draw a smooth curve?
> > >
> > > Thanks.
> > > Sam
> > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Draw curve in GEF [message #20308 is a reply to message #20292] |
Tue, 24 September 2002 13:08  |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
Yes, you need a new ConnectionCreationTool subclass, or similar. It will
probably need some new states and some new handling of mouse Pressed.
And you'll need to generate the feedback somehow during the clicks. This is
done now by asking the source node to show feedback, but the tool can manage
this as well.
"Sam Cheung" <scheung@novarra.com> wrote in message
news:ampvnm$3ot$1@rogue.oti.com...
> Thanks for your response.
>
> But in MS Word, when you are drawing a curve, after you first the first 2
> points, it shows you the curve dynamically as you move the mouse, and when
> you click the 3rd point, it draws that curve. And you can continue by
> clicking the 4th, 5th times... or you finish the curve drawing by double
> clicking.
>
> In others words, I need more than just a curve-to-polyline converter,
right?
> I need to capture mouse click and mouse move eveents and draw the curve
> dynamically. Correct?
>
> Thanks.
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:amoh9m$asd$1@rogue.oti.com...
> > See AWT's CubicCurve2D#getPathIterator.
> > See GEF's StrokePointList class for an example using the iterator.
> >
> > BTW, GEF uses this to produce an outline around a connection (for
> > representing focus). To see focus on a connection, select one of its
> nodes
> > and press Control+'/'
> >
> >
> > "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> > news:amogao$afd$1@rogue.oti.com...
> > > We don't have a ConnectionRouter for this. SWT does not support
control
> > > points, so you would have to approximate the curve with a polyline.
> There
> > > are well-known algorithms for generating approximations with a given
> > > "flatness". You could probably find something in AWT geometry
packages
> to
> > > do this. Look at GeneralPath, Shape, and Stroke.
> > >
> > > If you find something useful or write your own curve-to-polyline
> > converter,
> > > feel free to share ;-)
> > >
> > > "Sam Cheung" <scheung@novarra.com> wrote in message
> > > news:amo9bl$7i6$1@rogue.oti.com...
> > > > Hi,
> > > >
> > > > Does GEF support curve drawing like the way in MS Word? in other
> word,
> > > user
> > > > clicks 3 points on the sreen, it will draw a smooth curve?
> > > >
> > > > Thanks.
> > > > Sam
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Wed Jun 04 11:32:19 EDT 2025
Powered by FUDForum. Page generated in 0.04415 seconds
|