com.swfm.mica.animators
Class MiAnimatingWorker

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.swfm.mica.animators.MiAnimatingWorker
All Implemented Interfaces:
MiiAnimatable, java.lang.Runnable

public class MiAnimatingWorker
extends java.lang.Thread
implements MiiAnimatable

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
   
Constructor Summary
MiAnimatingWorker(MiPart somePartInAWindow)
           
MiAnimatingWorker(MiPart somePartInAWindow, long stepTime, long duration)
           
 
Method Summary
 void animate(double startOfStep, double endOfStep)
          It is safe to call graphics to update animation now.
 void end()
          Clean up after animation.
 void ready()
          Call this from a Mica thread to kick animation off.
 void run()
          This is called by the Thread.
 void start()
          Initialize before animation.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiAnimatingWorker

public MiAnimatingWorker(MiPart somePartInAWindow)

MiAnimatingWorker

public MiAnimatingWorker(MiPart somePartInAWindow,
                         long stepTime,
                         long duration)
Method Detail

ready

public void ready()
Call this from a Mica thread to kick animation off. Mica will first call start() and then call animate() until animation is complete.


start

public void start()
Initialize before animation. This starts the Thread. This is called by Mica. Override to do any modifications of Mica (aka animation) and other setup.

Specified by:
start in interface MiiAnimatable

run

public void run()
This is called by the Thread. Override to do any lengthy calculations. It is NOT safe to call Mica from here.

Specified by:
run in interface java.lang.Runnable

animate

public void animate(double startOfStep,
                    double endOfStep)
It is safe to call graphics to update animation now. This is called by Mica. Override to do any modifications of Mica (aka animation)

Specified by:
animate in interface MiiAnimatable
Parameters:
startOfStep - the beginning of the time slice
endOfStep - the end of the time slice

end

public void end()
Clean up after animation. This animator is automatically removed from the MiAnimationManager. This is called by Mica. Override to do any necessary cleanup.

Specified by:
end in interface MiiAnimatable