The way I would do it would be:

Timer t = new Timer() {

      public void run() {
         // do one pass of the sort
      }
    };

    // Schedule the timer to run once in 5 seconds.
    t.schedule(interval);

where interval is how frequently you wish to animate.

Remeber - javascript is single threaded.  There is no sleep mechanism.

On Mon, Feb 1, 2010 at 9:53 AM, Sean <[email protected]> wrote:

> I"m trying to do a visual sort. Imagine a bubble sort where you see
> the items move from one bucket to the next. The way I would move them
> visually is use a Timer with an AbsolutePanel and move them up.
>
> However, I wouldn't want to move the next guy until my last one has
> finished animating. If I do that, then everything will animate at once
> making a big mess that ends up correct, but you can't see the process
> happening clearly.
>
> What I would want is, on the timer finishing, I'd like to do a
> CallBack and say, I'm done, u can do the next one.
>
> What's the correct way to handle this? a While(Timer!=null){sleep}
> type thing or somehow fake an AsyncCallback or some other way?
>
> Thanks in advance for your suggestions!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to