Package 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
-
-
Field Summary
Fields Modifier and Type Field Description protected static intCHECK1protected static intCHECK2protected static intCHECK3protected longcurrentTimeprotected JmolScriptEvaluatorevalprotected static intFINISHprotected booleanhaveReferenceprotected booleanhoverEnabledprotected static intINITprotected booleanisJSprotected booleanisReset(package private) doublejunkprotected longlastRepaintTimeprotected static intMAINjava.lang.Stringnameprotected ScriptContextscprotected intsleepTimeprotected longstartTimeprotected booleanstoppedprotected longtargetTimeprivate static intthreadIndexprivate booleanuseTimeoutprotected Viewervwr
-
Constructor Summary
Constructors Constructor Description JmolThread()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancheckInterrupted(JmolThread ref)voidinterrupt()protected voidoops(java.lang.Exception e)voidreset()voidresumeEval()voidrun()protected abstract voidrun1(int mode)protected booleanrunSleep(int millis, int runPtr)voidsetEval(JmolScriptEvaluator eval)JavaScript only -- -- scriptDelay, moveTo, spin -- save context for restoration later -- move program counter forward one commandintsetManager(java.lang.Object manager, Viewer vwr, java.lang.Object params)voidsetViewer(Viewer vwr, java.lang.String name)voidstart()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
-
-
-
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
private boolean useTimeout
-
junk
double junk
-
-
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:
startin classjava.lang.Thread
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.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:
interruptin classjava.lang.Thread
-
checkInterrupted
protected boolean checkInterrupted(JmolThread ref)
-
reset
public void reset()
-
-