demos.powerwindow.gui
Class WindowGUI.RepaintThread

java.lang.Object
  extended by java.lang.Thread
      extended by demos.powerwindow.gui.WindowGUI.RepaintThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
WindowGUI

private static class WindowGUI.RepaintThread
extends java.lang.Thread

Since calling repaint() each time there is a change leads to the window lagging behind the simulation, we don't call repaint at each change. Instead, we use a thread to periodically call repaint. There is something weird in the management of the graphical updates in Swing...

Author:
boulange

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  long delay_
           
private  WindowGUI myWindow_
           
private  boolean run_
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WindowGUI.RepaintThread(WindowGUI win, long delay)
           
 
Method Summary
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myWindow_

private WindowGUI myWindow_

delay_

private long delay_

run_

private boolean run_
Constructor Detail

WindowGUI.RepaintThread

public WindowGUI.RepaintThread(WindowGUI win,
                               long delay)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread