vanetsim.gui.helpers
Class ReRenderManager

java.lang.Object
  extended by java.lang.Thread
      extended by vanetsim.gui.helpers.ReRenderManager
All Implemented Interfaces:
java.lang.Runnable

public final class ReRenderManager
extends java.lang.Thread

A small manager to get better user experience through buffering ReRender-calls. By using this, the GUI gets (almost) immediately responsive again upon clicking a button. If rendering the background takes longer than the time between multiple button clicks (made by the user), some ReRender-events are kind of silently dropped.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void doReRender()
          Schedule a re-render-Operation.
static ReRenderManager getInstance()
          Gets the single instance of this manager.
 void run()
          A thread which checks if a re-rendering is scheduled and then sleeps 50ms.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static ReRenderManager getInstance()
Gets the single instance of this manager.

Returns:
single instance of this manager

doReRender

public void doReRender()
Schedule a re-render-Operation.


run

public void run()
A thread which checks if a re-rendering is scheduled and then sleeps 50ms. If necessary, it calls the Renderer to perform a full re-render.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
Thread.run()