4

I know this is a Duplicate question. But, No answers helped me to solve my problem. I'm working on a project in Vaadin. In that I have few layouts (ref this links to understand my layout). When I press a button I need to slide the Components in and out. And, I achieved it successfully.

But, My problem is; to make it feel better, I want to slow down the sliding effect. So, It will look like an animation kind of stuff. I'm sliding the Components by changing the setExpandRatio() from 1 to 0.

setExpandRatio(component, 1.0f);

to

setExpandRatio(component, 0f);

So that it will slide.

And to slow down the sliding, I tried this.

float i = 1.0;
while(i >= 0)
{
  setExpandRatio(component, i);
  i = i - 0.1;
  try {
    Thread.sleep(1000);
      } 
    catch(InterruptedException ex) {}
}

It Just waits for 1 second and slides down the component quickly. I also tried using

wait(1000);

But, no use. Has anyone solved this problem before?

Community
  • 1
  • 1
Gugan
  • 1,625
  • 2
  • 27
  • 65

1 Answers1

3

Take a look at the Animator add-on, it provides nice ways to animate components by using browser's client-side capabilities.

Henri Kerola
  • 4,947
  • 1
  • 17
  • 19
  • This is exactly what I needed. But, What about ROLL_DOWN_CLOSE_REMOVE & ROLL_RIGHT_CLOSE_REMOVE? Is it not possible to implement them? – Gugan Mar 15 '13 at 07:04