Class DynamicLoaderThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--DynamicLoaderThread
All Implemented Interfaces:
java.util.Observer, java.lang.Runnable

public class DynamicLoaderThread
extends java.lang.Thread
implements java.util.Observer

DynamicLoaderThread
This thread load RobotProgram and runs them.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DynamicLoaderThread(java.lang.String programName, Robot mainRobotProgram)
          programName - is the name of the program to be run.
 
Method Summary
 void loadingRobotProgram(java.lang.String programName)
          it loads the robotProgram called programName.
 void paint(java.awt.Graphics g)
          paint the robotProgram
 void repaint()
          repaint and sleep 1.5 sec.
 void run()
          loads the program.
 void setWorld(BasicWorld world)
          set the world to the robot program.
 void update(java.util.Observable o, java.lang.Object arg)
          activate when one of the basicRobot of the robotProgram done something.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DynamicLoaderThread

public DynamicLoaderThread(java.lang.String programName,
                           Robot mainRobotProgram)
programName - is the name of the program to be run. mainRobotProgram - is the object to inform of the robot changing.
Method Detail

run

public void run()
loads the program.
Overrides:
run in class java.lang.Thread

repaint

public void repaint()
repaint and sleep 1.5 sec.

paint

public void paint(java.awt.Graphics g)
paint the robotProgram

loadingRobotProgram

public void loadingRobotProgram(java.lang.String programName)
it loads the robotProgram called programName.

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
activate when one of the basicRobot of the robotProgram done something.
Specified by:
update in interface java.util.Observer

setWorld

public void setWorld(BasicWorld world)
set the world to the robot program.