DE.purple_sunshine.bigbro
Class PositionLoader

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

public class PositionLoader
extends SuspendableThread

The PositionLoader loads the current real world position for each Person from a server. If the file cannot be loaded, random positions are used and a message is shown. When the applet is stopped and started again, it tries loading the positions from the server again.

Since:
JDK1.1
Version:
1.0
Author:
Holger Wagner

Field Summary
static java.lang.String[] areaNames
           
static long DEFAULT_REFRESH_DELAY
           
static long TIMEOUT
          Timeout after which the applet gives up loading from the server.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PositionLoader(java.util.Vector persons, java.net.URL positionFileURL, long refreshDelay, Animator animator)
          Constructs a new PositionLoader.
 
Method Summary
 java.net.URL getPositionFileURL()
           
 long getRefreshDelay()
           
 void run()
          Loads the new positions every refreshDelay ms.
 void setPositionFileURL(java.net.URL positionFileURL)
           
 void setRefreshDelay(long refreshDelay)
           
 
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_REFRESH_DELAY

public static final long DEFAULT_REFRESH_DELAY

TIMEOUT

public static final long TIMEOUT
Timeout after which the applet gives up loading from the server.

areaNames

public static final java.lang.String[] areaNames
Constructor Detail

PositionLoader

public PositionLoader(java.util.Vector persons,
                      java.net.URL positionFileURL,
                      long refreshDelay,
                      Animator animator)
Constructs a new PositionLoader.
Parameters:
persons - the Vector of Persons postions should be loaded for
positionFileURL - the URL of the file (or script) where the positions are updated in
refreshDelay - the amount of ms between two updates
animator - the animator that needs to be updated when the positions are updated
Method Detail

run

public void run()
Loads the new positions every refreshDelay ms.
Overrides:
run in class java.lang.Thread

getPositionFileURL

public java.net.URL getPositionFileURL()

setPositionFileURL

public void setPositionFileURL(java.net.URL positionFileURL)

getRefreshDelay

public long getRefreshDelay()

setRefreshDelay

public void setRefreshDelay(long refreshDelay)


© 2000, Holger Wagner, Purple Sunshine Productions.