Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Arrange action & transition effect
Arrange action & transition effect [message #483852] Thu, 03 September 2009 11:37 Go to next message
Javier is currently offline JavierFriend
Messages: 57
Registered: July 2009
Member
I've implemented my own layout for certain compartments in my application.
The way I did is changing the LayotManager of the
ResizableCompartmentFigure. Distribution of nodes inside the compartment
is made accordingly to some element information stored in the model, and
it works fine.

The only problem I see is that changes are made very "fast". Inserting a
node, the layout will locate it in the proper place but to the user vision
of the change may seem to happen too fast. I saw that when you invoke the
"Arrange All" action, nodes are distributed accordingly to the
LayoutProvider installed. But this distribution shows a transitional
effect in which you can see the node moving to the target position. I
would like to know where is that behavior implemented and try to adapt it
for my own layout, if possible.

I checked DefaultProvider class but I didn't find that, or maybe I didn't
notice.

Thanks!
Re: Arrange action & transition effect [message #483894 is a reply to message #483852] Thu, 03 September 2009 14:14 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Hi Javier,

Have a look at org.eclipse.gmf.runtime.diagram.ui.actions.internal.ArrangeA ction#doRun(IProgressMonitor progressMonitor) code.
It used org.eclipse.draw2d.Animation class.

Hope this help.
Regards,

Mariot

Javier a écrit :
> I've implemented my own layout for certain compartments in my
> application. The way I did is changing the LayotManager of the
> ResizableCompartmentFigure. Distribution of nodes inside the compartment
> is made accordingly to some element information stored in the model, and
> it works fine.
>
> The only problem I see is that changes are made very "fast". Inserting a
> node, the layout will locate it in the proper place but to the user
> vision of the change may seem to happen too fast. I saw that when you
> invoke the "Arrange All" action, nodes are distributed accordingly to
> the LayoutProvider installed. But this distribution shows a transitional
> effect in which you can see the node moving to the target position. I
> would like to know where is that behavior implemented and try to adapt
> it for my own layout, if possible.
>
> I checked DefaultProvider class but I didn't find that, or maybe I
> didn't notice.
>
> Thanks!
>
Re: Arrange action & transition effect [message #484086 is a reply to message #483894] Fri, 04 September 2009 08:52 Go to previous messageGo to next message
Javier is currently offline JavierFriend
Messages: 57
Registered: July 2009
Member
Thanks for the answer!
Ok so I took a look at that class and LayoutAnimator too.
I have my own layout extending ToolbarLayout, for my compartment. To put
each figure I caculate its coordinates an call to setBounds().

Before the layout() method of my layout, I set the begin mark. And after
the layout() method, I called Animation.run(1000)... I can see the delay
provoked by the Animation class, but no figure in transition.

How is this class working? I read something like it gets all the figures
that calls invalidate() and tracks the initial and final position, but it
is apparently not happening in my case.

Any idea on how to properly use this?

Thanks!
Re: Arrange action & transition effect [message #484154 is a reply to message #483852] Fri, 04 September 2009 12:47 Go to previous message
Eclipse UserFriend
Originally posted by: laura.hernandez.dunait.es

Hi! I found useful information in this thread. :)

By the way, do you know how can I do to call the Arrange Action
programmatically? I need to rearrange the nodes of a compartment from my
code.

Thank you very much.

Laura.
Previous Topic:Extend autogen EditPart per extension
Next Topic:GMFGraph and indirect references
Goto Forum:
  


Current Time: Fri Apr 26 16:21:23 GMT 2024

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

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

Back to the top