com.dlsc.flexgantt.swing.timeline

## Class TimeNowThread

- java.lang.Object
- - java.lang.Thread
  - - com.dlsc.flexgantt.swing.timeline.TimeNowThread

- All Implemented Interfaces:
    Runnable

      public class TimeNowThread
      extends 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
  Version:
    $Revision: 1.7 $
  Author:
    Dirk Lemmermann
  See Also:
    `Eventline.setTimeNow(long)`, `TimeNowLayer`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `Thread.State, Thread.UncaughtExceptionHandler`

  - ### Field Summary

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeNowThread(AbstractGanttChart gc)` Constructs a new thread.
    `TimeNowThread(AbstractGanttChart gc, long delay)` Constructs a new thread.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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, 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`

- - ### 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 `Runnable`
      Overrides:
        `run` in class `Thread`

    - #### stopThread

          public void stopThread()

      Stops the thread.
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.