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 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
private boolean
useTimeout
protected Viewer
vwr
-
Constructor Summary
Constructors Constructor Description JmolThread()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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 commandint
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, 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:
start
in classjava.lang.Thread
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in 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:
interrupt
in classjava.lang.Thread
-
checkInterrupted
protected boolean checkInterrupted(JmolThread ref)
-
reset
public void reset()
-
-