JmolThread
Date: 2019-10-22

org.jmol.thread

## Class JmolThread

- java.lang.Object
- - java.lang.Thread
  - - org.jmol.thread.JmolThread

- All Implemented Interfaces:
    java.lang.Runnable
  Direct Known Subclasses:
    AnimationThread, CommandWatcherThread, FileLoadThread, HoverWatcherThread, MinimizationThread, MoveToThread, Navigator, ScriptDelayThread, ScriptQueueThread, SpinThread, TimeoutThread, VibrationThread

      public abstract class JmolThread
      extends java.lang.Thread

- - ### Nested Class Summary

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

      `java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `CHECK1`
    `protected static int` | `CHECK2`
    `protected static int` | `CHECK3`
    `protected long` | `currentTime`
    `protected JmolScriptEvaluator` | `eval`
    `protected static int` | `FINISH`
    `protected boolean` | `haveReference`
    `protected boolean` | `hoverEnabled`
    `protected static int` | `INIT`
    `protected boolean` | `isJS`
    `protected boolean` | `isReset`
    `(package private) double` | `junk`
    `protected long` | `lastRepaintTime`
    `protected static int` | `MAIN`
    `java.lang.String` | `name`
    `protected ScriptContext` | `sc`
    `protected int` | `sleepTime`
    `protected long` | `startTime`
    `protected boolean` | `stopped`
    `protected long` | `targetTime`
    `private static int` | `threadIndex`
    `protected boolean` | `useTimeout`
    `protected Viewer` | `vwr`

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

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JmolThread()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `checkInterrupted(JmolThread ref)`
    `void` | `interrupt()`
    `protected void` | `oops(java.lang.Exception e)`
    `void` | `reset()`
    `void` | `resumeEval()`
    `void` | `run()`
    `protected abstract void` | `run1(int mode)`
    `protected boolean` | `runSleep(int millis, int runPtr)`
    `void` | `setEval(JmolScriptEvaluator eval)` JavaScript only -- -- scriptDelay, moveTo, spin -- save context for restoration later -- move program counter forward one command
    `int` | `setManager(java.lang.Object manager, Viewer vwr, java.lang.Object params)`
    `void` | `setViewer(Viewer vwr, java.lang.String name)`
    `void` | `start()`

    - ### 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, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### name

          public java.lang.String name

    - #### threadIndex

          private static int threadIndex

    - #### INIT

          protected static final int INIT

      See Also:
        Constant Field Values

    - #### MAIN

          protected static final int MAIN

      See Also:
        Constant Field Values

    - #### FINISH

          protected static final int FINISH

      See Also:
        Constant Field Values

    - #### CHECK1

          protected static final int CHECK1

      See Also:
        Constant Field Values

    - #### CHECK2

          protected static final int CHECK2

      See Also:
        Constant Field Values

    - #### CHECK3

          protected static final int CHECK3

      See Also:
        Constant Field Values

    - #### vwr

          protected Viewer vwr

    - #### eval

          protected JmolScriptEvaluator eval

    - #### sc

          protected ScriptContext sc

    - #### haveReference

          protected boolean haveReference

    - #### hoverEnabled

          protected boolean hoverEnabled

    - #### startTime

          protected long startTime

    - #### targetTime

          protected long targetTime

    - #### lastRepaintTime

          protected long lastRepaintTime

    - #### currentTime

          protected long currentTime

    - #### sleepTime

          protected int sleepTime

    - #### isJS

          protected boolean isJS

    - #### stopped

          protected boolean stopped

    - #### isReset

          protected boolean isReset

    - #### useTimeout

          protected boolean useTimeout

    - #### junk

          double junk

  - ### Constructor Detail

    - #### JmolThread

          public JmolThread()

  - ### Method Detail

    - #### setManager

          public int setManager(java.lang.Object manager,
                                Viewer vwr,
                                java.lang.Object params)

      Parameters:
        `manager` -
        `vwr` -
        `params` -
      Returns:
        TODO

    - #### setViewer

          public void setViewer(Viewer vwr,
                                java.lang.String name)

    - #### run1

          protected abstract void run1(int mode)
                                throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`

    - #### setEval

          public void setEval(JmolScriptEvaluator eval)

      JavaScript only -- -- scriptDelay, moveTo, spin -- save context for restoration later -- move program counter forward one command
      Parameters:
        `eval` -

    - #### resumeEval

          public void resumeEval()

    - #### start

          public void start()

      Overrides:
        `start` in class `java.lang.Thread`

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `java.lang.Thread`

    - #### oops

          protected void oops(java.lang.Exception e)

    - #### runSleep

          protected boolean runSleep(int millis,
                                     int runPtr)
                              throws java.lang.InterruptedException

      Parameters:
        `millis` -
        `runPtr` -
      Returns:
        true if we can continue on with this thread (Java, not JavaScript)
      Throws:
        `java.lang.InterruptedException`

    - #### interrupt

          public void interrupt()

      Overrides:
        `interrupt` in class `java.lang.Thread`

    - #### checkInterrupted

          protected boolean checkInterrupted(JmolThread ref)

    - #### reset

          public void reset()