# Class JmolThread

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

All Implemented Interfaces:
  `Runnable`

Direct Known Subclasses:
  `AnimationThread, CommandWatcherThread, HoverWatcherThread, MinimizationThread, MoveToThread, Navigator, ScriptQueueThread, SpinThread, TimeoutThread, VibrationThread`

public abstract class JmolThread extends Thread

## Nested Class Summary

### Nested classes/interfaces inherited from class Thread

`Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final int`
`CHECK1`
`protected static final int`
`CHECK2`
`protected static final int`
`CHECK3`
`protected long`
`currentTime`
`protected JmolScriptEvaluator`
`eval`
`protected static final int`
`FINISH`
`protected boolean`
`haveReference`
`protected boolean`
`hoverEnabled`
`protected static final int`
`INIT`
`protected boolean`
`isJS`
`protected boolean`
`isReset`
`protected long`
`lastRepaintTime`
`protected static final int`
`MAIN`
`String`
`name`
`protected ScriptContext`
`sc`
`protected int`
`sleepTime`
`protected long`
`startTime`
`protected boolean`
`stopped`
`protected long`
`targetTime`
`protected boolean`
`useTimeout`
`protected Viewer`
`vwr`

### Fields inherited from class Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

## Constructor Summary

Constructors
Constructor
Description
`JmolThread()`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`checkInterrupted(JmolThread ref)`
`void`
`interrupt()`
`protected void`
`oops(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(Object manager, Viewer vwr, Object params)`
`void`
`setViewer(Viewer vwr, String name)`
`void`
`start()`
`String`
`toString()`

### Methods inherited from class Thread

`activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, threadId, yield`

### Methods inherited from class Object

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

## Field Details

### name

public String name

### 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

## Constructor Details

### JmolThread

public JmolThread()

## Method Details

### setManager

public int setManager(Object manager, Viewer vwr, Object params)

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

### setViewer

public void setViewer(Viewer vwr, String name)

### run1

protected abstract void run1(int mode) throws InterruptedException

Throws:
  `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 `Thread`

### run

public void run()

Specified by:
  `run` in interface `Runnable`
Overrides:
  `run` in class `Thread`

### oops

protected void oops(Exception e)

### runSleep

protected boolean runSleep(int millis, int runPtr) throws InterruptedException

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

### interrupt

public void interrupt()

Overrides:
  `interrupt` in class `Thread`

### checkInterrupted

protected boolean checkInterrupted(JmolThread ref)

### reset

public void reset()

### toString

public String toString()

Overrides:
  `toString` in class `Thread`