DE.purple_sunshine.bigbro
Class Animator

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--DE.purple_sunshine.bigbro.SuspendableThread
              |
              +--DE.purple_sunshine.bigbro.Animator
All Implemented Interfaces:
java.lang.Runnable

public class Animator
extends SuspendableThread

The Animator controls a continuous time line and triggers the recomputation of the positions of each person. When this is done, the house is repainted.

Since:
JDK1.1
Version:
1.0
Author:
Holger Wagner
See Also:
SpyApplet, SpyCanvas, PositionLoader, Person, House

Field Summary
static int DEFAULT_FPS
          The default number of frames per second (30fps).
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Animator(java.util.Vector persons, int fps, SpyCanvas canvas)
          Constructs a new Animator.
 
Method Summary
 void resetTime(long timeToNextReset)
          Resets the time to the next position update.
 void run()
          This does the actual animation in an own Thread.
 void smilyAnim()
          Starts the Smily Animation which is done in a Thread of the SpyCanvas.
 
Methods inherited from class DE.purple_sunshine.bigbro.SuspendableThread
finish, isFinished, resume_, suspend_
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_FPS

public static final int DEFAULT_FPS
The default number of frames per second (30fps).
Constructor Detail

Animator

public Animator(java.util.Vector persons,
                int fps,
                SpyCanvas canvas)
Constructs a new Animator.
Parameters:
persons - the persons this animator should animate
fps - if >0, the frames per second
canvas - the SpyCanvas in which the frames shall be drawn
Method Detail

resetTime

public void resetTime(long timeToNextReset)
Resets the time to the next position update.
Parameters:
timeToNextReset - the expected time to the next position update

run

public void run()
This does the actual animation in an own Thread.
Overrides:
run in class java.lang.Thread

smilyAnim

public void smilyAnim()
Starts the Smily Animation which is done in a Thread of the SpyCanvas.
See Also:
SpyCanvas.smilyAnim()


© 2000, Holger Wagner, Purple Sunshine Productions.