|
|
|
Re: Rotate GraphicsAlgorithm [message #1269863 is a reply to message #1266449] |
Wed, 12 March 2014 09:10 |
John Cole Messages: 66 Registered: June 2013 |
Member |
|
|
Hello Michael,
can you tell me, how I can rotate a polyline or a polygon?
For the text there is a method called setAngle:
int angle = 90;
Shape shape = peCreateService.createShape(containerShape, false);
Text text = gaService.createText(shape);
text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
text.setAngle(angle);
I can't find such a method for the polyline/polygon.
Thank you very much in advance!
John
[Updated on: Wed, 12 March 2014 09:10] Report message to a moderator
|
|
|
|
|
Re: Rotate GraphicsAlgorithm [message #1385394 is a reply to message #1270793] |
Fri, 06 June 2014 06:55 |
John Cole Messages: 66 Registered: June 2013 |
Member |
|
|
I want to refer on that topic again, as I haven't found a solution yet.
I have defined some quite extensive shapes as following:
There is a container shape placed somewhere on the graphical editor (not he origin of course), which contains other shapes (rectangles, lines, polygons, etc.). All these basic shapes in the container form a complex overall shape.
In some cases I want to rotate that compound shape by an defined angle. Of course it would be the best solution to just rotate the container and the content would be rotated automatically (that would be the case if the container rectangle would define its own coordinate system) but unfortunately it is not possible. I also tried to translate each of the shapes to the origin, rotate it by using coordinate transformation
http://en.wikipedia.org/wiki/Transformation_matrix#Rotation
and then translate it back to the original position. But as the shapes are really complex, I am not able to represent them properly.
I also thought about using Graphics2D - as it supports AffineTransform - by converting the Graphiti shapes into Graphics2D shapes, rotate them and then transform them back to Graphiti shapes. But in my oppinion this is not a really good solution, as Graphics2D and Graphiti are quite different.
What in your opinion would be the best solution to realise that?
P.S. It would be sufficient to just rotate the elements by 90°, 180° and 270° for now.
[Updated on: Fri, 06 June 2014 06:57] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05694 seconds