Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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: Wed Jul 23 11:52:53 EDT 2025

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

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

Back to the top