Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Best way to rotate an object
Best way to rotate an object [message #629454] Tue, 28 September 2010 10:35 Go to next message
VincentL is currently offline VincentLFriend
Messages: 88
Registered: July 2009
Member
Hi,

What is the best way to implements a rotate feature on an object ?

Is there any examples ?

Thanks for your anwsers...

Regards

Vincent
Re: Best way to rotate an object [message #629507 is a reply to message #629454] Tue, 28 September 2010 14:15 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi,

there is no out-of-the box rotate in Graphiti as of now.

But you might implement a Custom Feature
and do the rotation on GEF basis (use Transform).
It works well for instance with a Polygon Graphics Algorithm.
You can just rotate the underlying points,
(you have to map between draw2d points and
graphiti metamodel points)

Best, Tim
Re: Best way to rotate an object [message #629629 is a reply to message #629507] Wed, 29 September 2010 02:42 Go to previous messageGo to next message
VincentL is currently offline VincentLFriend
Messages: 88
Registered: July 2009
Member
Tim Kaiser wrote:
> Hi,
>
> there is no out-of-the box rotate in Graphiti as of now.
>
> But you might implement a Custom Feature
> and do the rotation on GEF basis (use Transform).
> It works well for instance with a Polygon Graphics Algorithm. You can
> just rotate the underlying points,
> (you have to map between draw2d points and
> graphiti metamodel points)
>
> Best, Tim
>

Hi Tim,

I understand that it is easy to rotate simple polygons (graphics algorithm,) but I would
also like to understand how to rotate containerShapes, shapes since GA should also be rotated.

Could you provide me an example? I not sure to understand

Thanks for your answer

Best regards

Vincent
Re: Best way to rotate an object [message #629672 is a reply to message #629454] Wed, 29 September 2010 08:28 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi Vincent,

ContainerShapes are PictogramElements, as such they are
elements for describing the structure of a diagram.

Rotating certain graphical representations does not change the containment structure of the diagram elements.
It affects only their GraphicAlgorithms.

If you want to rotate complex graphics algorithms with child algorithms
you have to compute the new coordinates "by hand".

Best regards, Tim

Re: Best way to rotate an object [message #631530 is a reply to message #629672] Thu, 07 October 2010 20:41 Go to previous messageGo to next message
VincentL is currently offline VincentLFriend
Messages: 88
Registered: July 2009
Member
Hi Tim,

Sorry, you are right! I'm starting using graphiti!

I tried what you said and it works fine except one thing....

When I change all my shapes' location in my rotate feature (using for example setX or
setY), it doesn't update the pictogram. (the coordinates are correctly change) but the
pictogram is not refresh...

It only update the pictogram if I also change the width and height of the item. It is normal?

I tried to call "layoutPictogramElement(pe)" to force the layout at the end of the rotate
feature but it doesn't work.

What should I call to force pictogram refresh at the end of the rotate feature ?


Thanks

Regards,
Re: Best way to rotate an object [message #632257 is a reply to message #629454] Tue, 12 October 2010 10:22 Go to previous message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi Vincent,

thanks for the hint.
There was a bug in the eventing component.
I fixed it.

Best regards, Tim
Previous Topic:Non-Rounded Polyline connection
Next Topic:How to have multidecorators
Goto Forum:
  


Current Time: Thu Apr 18 20:22:30 GMT 2024

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

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

Back to the top