Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to Rotate rectangle in GEF?(How to Rotate rectangle in GEF?)
How to Rotate rectangle in GEF? [message #1053243] Fri, 03 May 2013 07:13 Go to next message
Charu Sharma is currently offline Charu Sharma
Messages: 17
Registered: May 2011
Location: Pune
Junior Member
Hello,

Currently thr figure which I want to rotate is like :
I have a 'rectangle figure' which has a header to diaplay anme of the rectangle in a Label (Figure1).
Now in the remaining empty space of rectangle I have drawn a content pane which contains child figure(Figure2) of 'Figure1'.

Now I want to provide the functionality to user to rotate the retangle at any specified angle, say 45 degrees. Here, command will be fired to rotate will be on Figure1. Now when user fires command to rotate the 'Figure1', child figure 'Figure2' should also rotate with its parent.

I have tried to use graphics.rotate(45) method but catch here is label does not rotate with it and then the child figure also. And, I have to provide user functionality to resize and move the figure. Of course child figures should also resize and move. Confused
All these functionality is to provided to user

Any help on this will be GREATFUL!!!


Thanks in advance
Re: How to Rotate rectangle in GEF? [message #1057739 is a reply to message #1053243] Wed, 08 May 2013 10:02 Go to previous message
Rüschenbaum Kai is currently offline Rüschenbaum Kai
Messages: 2
Registered: April 2013
Junior Member
As far as I know, rotating figures in general is not supported by GEF.
There is a convenient way to do this for Polygons though, using org.eclipse.draw2d.geometry.Transform.

You could build your own Rectangle in a PolygonFigure and rotate it via Transform().setRotation(double angle) and Transform().getTransformed(Point)

Previous Topic:PolylineConnection figure disappears
Next Topic:Add a newly created/custom component on the palette
Goto Forum:
  


Current Time: Fri Aug 29 10:17:43 EDT 2014

Powered by FUDForum. Page generated in 0.02153 seconds