Home » Eclipse Projects » GEF » Rotate figures
Rotate figures [message #56486] |
Mon, 20 January 2003 08:32  |
Eclipse User |
|
|
|
Originally posted by: g.wagenknecht.intershop.de
Hi!
How can I rotate a figure? Does the GEF provide calculation utilities for
rotating rectangles (and/ locations) around a specified center? (eg.
rotating one figure around its center and rotating more figures around a
specified center).
Thanks, Gunnar
|
|
| | | | |
Re: Rotate figures [message #58506 is a reply to message #58339] |
Tue, 28 January 2003 03:09   |
Eclipse User |
|
|
|
Originally posted by: g.wagenknecht.intershop.de
Hi Randy,
"Randy Hudson" <hudsonr@us.i_b_m.com> schrieb im Newsbeitrag
news:b13k7r$8ov$1@rogue.oti.com...
> Connection decorations support rotation, but they aren't generically
> reusable. IMO, rotation is something that takes place at a layer above
> Draw2d, since the figure's rectangular bounds need to be updated when
> rotating a shape such as a rectangle. You probably want to represent the
> actual polygon in your model, and thus rotation would be something that
> happens to your model. No?
Not really, I just want to rotate my edit part figures to have them layouted
in a better way. If I paint the figures using shapes it is very difficult to
rotate such shapes. Exampla: how to rotate an rounded rectangle? IMHO there
is no support for this in the graphics. The graphics should be able to paint
rotated things. The only way I can handle this is to convert the rectangle
into a point list, move every point with
Point#translate(Rectangle#getCenter()#getNegated(), rotate the points using
the draw2d Transform, move the points back using
Point#translate(Rectangle#getCenter() and paint a polygon using the point
list. That may be ok for rectangles but what about rounded rectangles, ovals
and arcs?
There is not really support in draw2d, isn't it?
Cu, Gunnar
|
|
| |
Re: Rotate figures, bezier, antialiasing etc. [message #58724 is a reply to message #58511] |
Tue, 28 January 2003 14:49   |
Eclipse User |
|
|
|
Not only, but you are right, currently all affine transformations is a pain
(or you must use your own polyline for everything).
We are doing our Graphics class with primary goal to supprot antialiasing
(see picture attached). We can also extend this class with bezier curves and
polybezier and provide more support for affine transforms.
But currently we are working on Win32 version (using GDI+ wrapper), and to
make that in a right way we need enthusiasts from the other worlds...
Regards,
as
----- Original Message -----
From: "Gunnar Wagenknecht" <g.wagenknecht@intershop.de>
Newsgroups: eclipse.tools.gef
Sent: Tuesday, January 28, 2003 11:09 AM
Subject: Re: Rotate figures
>
> "Alex Selkov" <as@empproject.com> schrieb im Newsbeitrag
> news:b0hkjt$c75$1@rogue.oti.com...
> > Look at org.eclipse.draw2d.geometry.Transform. You may easely create
> Figures
> > with rotation.
>
> Yes I can, but only polygons and polylines.
> :(
>
> Cu, Gunnar
>
>
Attachment: image002.jpg
(Size: 36.97KB, Downloaded 139 times)
|
|
|
Re: Rotate figures [message #59120 is a reply to message #58506] |
Tue, 28 January 2003 18:15   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Correct, there is no support in SWT for this.
"Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
news:b15ckn$b1h$1@rogue.oti.com...
> Hi Randy,
>
> "Randy Hudson" <hudsonr@us.i_b_m.com> schrieb im Newsbeitrag
> news:b13k7r$8ov$1@rogue.oti.com...
>
> > Connection decorations support rotation, but they aren't generically
> > reusable. IMO, rotation is something that takes place at a layer above
> > Draw2d, since the figure's rectangular bounds need to be updated when
> > rotating a shape such as a rectangle. You probably want to represent
the
> > actual polygon in your model, and thus rotation would be something that
> > happens to your model. No?
>
> Not really, I just want to rotate my edit part figures to have them
layouted
> in a better way. If I paint the figures using shapes it is very difficult
to
> rotate such shapes. Exampla: how to rotate an rounded rectangle? IMHO
there
> is no support for this in the graphics. The graphics should be able to
paint
> rotated things. The only way I can handle this is to convert the rectangle
> into a point list, move every point with
> Point#translate(Rectangle#getCenter()#getNegated(), rotate the points
using
> the draw2d Transform, move the points back using
> Point#translate(Rectangle#getCenter() and paint a polygon using the point
> list. That may be ok for rectangles but what about rounded rectangles,
ovals
> and arcs?
>
> There is not really support in draw2d, isn't it?
>
> Cu, Gunnar
>
>
|
|
|
Re: Rotate figures, bezier, antialiasing etc. [message #59152 is a reply to message #58724] |
Tue, 28 January 2003 18:17   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Cool, please try to get this into the SWT GC class. Some of the features
could be hints (not rotation, of course), which are ignored on other
platforms.
"Alex Selkov" <as@empproject.com> wrote in message
news:b16lle$d8j$1@rogue.oti.com...
> Not only, but you are right, currently all affine transformations is a
pain
> (or you must use your own polyline for everything).
>
> We are doing our Graphics class with primary goal to supprot antialiasing
> (see picture attached). We can also extend this class with bezier curves
and
> polybezier and provide more support for affine transforms.
>
> But currently we are working on Win32 version (using GDI+ wrapper), and to
> make that in a right way we need enthusiasts from the other worlds...
>
> Regards,
>
> as
>
> ----- Original Message -----
> From: "Gunnar Wagenknecht" <g.wagenknecht@intershop.de>
> Newsgroups: eclipse.tools.gef
> Sent: Tuesday, January 28, 2003 11:09 AM
> Subject: Re: Rotate figures
>
>
> >
> > "Alex Selkov" <as@empproject.com> schrieb im Newsbeitrag
> > news:b0hkjt$c75$1@rogue.oti.com...
> > > Look at org.eclipse.draw2d.geometry.Transform. You may easely create
> > Figures
> > > with rotation.
> >
> > Yes I can, but only polygons and polylines.
> > :(
> >
> > Cu, Gunnar
> >
> >
>
>
>
|
|
|
Re: Rotate figures, bezier, antialiasing etc. [message #59175 is a reply to message #59152] |
Tue, 28 January 2003 19:00   |
Eclipse User |
|
|
|
I don't think that SWT people will like that idea... They already have heavy
classes and they don't need such functionality as we are here :)
Currently we will do that as a GEF patch (substituting SWTGraphics with our
own class if gdiplus.dll was detected).
Features like setSmoothingMode indeed will behave as hint and can be easely
added.
But we also like the idea to implement things like alpha blending and
gradient fills. That is absolutely another story, because in such case we
need to have Color (new one with additional constructor), Pen, Brush etc.
But i think that all of this can be very useful in modern 2d application.
OK, we will publish preliminary as soon as we will able to show the Logic
example with antialiasing :).
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b1721n$n2v$1@rogue.oti.com...
> Cool, please try to get this into the SWT GC class. Some of the features
> could be hints (not rotation, of course), which are ignored on other
> platforms.
>
>
>
> "Alex Selkov" <as@empproject.com> wrote in message
> news:b16lle$d8j$1@rogue.oti.com...
> > Not only, but you are right, currently all affine transformations is a
> pain
> > (or you must use your own polyline for everything).
> >
> > We are doing our Graphics class with primary goal to supprot
antialiasing
> > (see picture attached). We can also extend this class with bezier curves
> and
> > polybezier and provide more support for affine transforms.
> >
> > But currently we are working on Win32 version (using GDI+ wrapper), and
to
> > make that in a right way we need enthusiasts from the other worlds...
> >
> > Regards,
> >
> > as
> >
> > ----- Original Message -----
> > From: "Gunnar Wagenknecht" <g.wagenknecht@intershop.de>
> > Newsgroups: eclipse.tools.gef
> > Sent: Tuesday, January 28, 2003 11:09 AM
> > Subject: Re: Rotate figures
> >
> >
> > >
> > > "Alex Selkov" <as@empproject.com> schrieb im Newsbeitrag
> > > news:b0hkjt$c75$1@rogue.oti.com...
> > > > Look at org.eclipse.draw2d.geometry.Transform. You may easely create
> > > Figures
> > > > with rotation.
> > >
> > > Yes I can, but only polygons and polylines.
> > > :(
> > >
> > > Cu, Gunnar
> > >
> > >
> >
> >
> >
>
>
|
|
|
Re: Rotate figures, bezier, antialiasing etc. [message #59201 is a reply to message #58724] |
Tue, 28 January 2003 20:08   |
Eclipse User |
|
|
|
Alex Selkov wrote:
> Not only, but you are right, currently all affine transformations is a pain
> (or you must use your own polyline for everything).
>
> We are doing our Graphics class with primary goal to supprot antialiasing
> (see picture attached). We can also extend this class with bezier curves and
> polybezier and provide more support for affine transforms.
>
> But currently we are working on Win32 version (using GDI+ wrapper), and to
> make that in a right way we need enthusiasts from the other worlds...
Alex,
I opened bug #30329 asking for support for Bezier curves to be added to
the SWT GC class. Sounds like you have some implementation which might
help out with that - the SWT team tend to be more receptive to ideas
which are backed by code ;-)
Although these features are not strictly necessary for Eclipse itself,
they would be very useful for GEF applications built on top of Eclipse,
so I think it is reasonable to ask for SWT to support it.
Feel free to contribute to bug #30329.
--
Colin M Sharples/New Zealand/IBM, IT Architect, IBM Global Services
sharples@nz.ibm.com, t: 64-4-5769853, m: 64-21-402085, f: 64-4-5765616
"Sometimes I think the surest sign intelligent life exists
elsewhere in the Universe is that it's never tried to contact us"
|
|
| | | |
Re: Rotate figures, bezier, antialiasing etc. [message #159109 is a reply to message #59299] |
Mon, 22 November 2004 16:02  |
Eclipse User |
|
|
|
Hello,
I know its been a while since the last posting, but I´m really
interested in this GEF-Patch, has it ever been released? And if where
can I find it?
I´m interested in it, because i´m currently working on Project based on
GEF 3.1 and it is nearly complete. I already have a lot of things
implemented, e.g. rulers and grid like in the logic example and
everything works fine. But because I have to be backwards-compatible
with an old file-format which supports rotation, I really need a general
mechanism for rotating figures. This is important, because I have
several basic geometric shapes (polylines, rectangles, arcs, ...) but
beyond this also rotated texts, with different fonts.
I started this project nearly 1 year ago, based on Java2D, but because
of the decision of our company to use the RCP as base for our client,
I restarted the project from scratch based on GEF, first trying to use
the Holongate J2D2SWT-Bridge, but as this Project works only with
GEF 2.x, I decided not to use it.
But now I´m at the point where I realized that GEF and Draw2D
respectivly do not support rotation of Figures, and I can´t believe that
such a powerful Graphical Framework, does not contain such a feature.
I really like the new 3.1 features e.g. the SnapToGeometry, but I do
think that rotation is a REALLY FUNDAMENTAL Feature, that should be
implemented. It would be nice if this could be done until the final
release of GEF 3.1. Further on I wonder what the
org.eclipse.draw2d.geometry.Transform Class is good for, because I
thought, that similary to Java2D (AffineTransform) I could transform any
Shape with such a Transform-Object, but as I saw this is not the case.
I wonder if someone can help me with this, or does anyone know when the
3.0 Release of the Holongate.org J2D2SWT-Bridge for 3.0 will be
available? Or have I just overseen anything?
Thank you very much in advance
Daniel
Alex Selkov wrote:
> "Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
> news:b18694$bvd$1@rogue.oti.com...
>
>
>>Do you have plans to contribute your work to Eclipse? IMHO it must not be
>>implemented in SWT. It would be better to have it in Draw2D only.
>
>
> All code will be under CPL.
>
>
>>Sorry, I don't understand it completly. Are you looking for enthusiasts
>
> that
>
>>do the port to Motif, GTK and others or to Win32?
>
>
> Yes, it's better to have someone who knows GTK/Motif/Carbon and who can help
> us with advices.
>
>
|
|
|
Goto Forum:
Current Time: Thu May 01 10:40:43 EDT 2025
Powered by FUDForum. Page generated in 0.38978 seconds
|