com.dlsc.flexgantt.swing.timeline
Class TimeNowThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.dlsc.flexgantt.swing.timeline.TimeNowThread
All Implemented Interfaces:
java.lang.Runnable

public class TimeNowThread
extends java.lang.Thread

A thread that is specialized on updating the time now variable inside the Eventline. This variable is used to express which time point will be considered to be the current time by the Gantt chart.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
Eventline.setTimeNow(long), TimeNowLayer

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
 
Constructor Summary
TimeNowThread(AbstractGanttChart gc)
          Constructs a new thread.
TimeNowThread(AbstractGanttChart gc, long delay)
          Constructs a new thread.
 
Method Summary
 long getDelay()
          Returns the number of milliseconds to pause between two successive calls to the eventline.
 void run()
           
 void setDelay(long millis)
          Sets the number of milliseconds to pause between two successive calls to the eventline.
 void stopThread()
          Stops the thread.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeNowThread

public TimeNowThread(AbstractGanttChart gc,
                     long delay)
Constructs a new thread.

Parameters:
gc - the Gantt chart to which the eventline belongs that will be updated by the thread
delay - the number of milliseconds to pause before successive update calls
Since:
1.0

TimeNowThread

public TimeNowThread(AbstractGanttChart gc)
Constructs a new thread. The number of milliseconds to pause between two successive calls to the eventline defaults to 1000 (one second).

Parameters:
gc - the Gantt chart to which the eventline belongs that will be updated by the thread
Since:
1.0
Method Detail

getDelay

public long getDelay()
Returns the number of milliseconds to pause between two successive calls to the eventline.

Returns:
the delay in milliseconds
Since:
1.0

setDelay

public void setDelay(long millis)
Sets the number of milliseconds to pause between two successive calls to the eventline.

Parameters:
millis - the delay in milliseconds
Since:
1.0

run

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

stopThread

public void stopThread()
Stops the thread.

Since:
1.0