Package org.astrogrid.samp.gui
Class SampThread
- java.lang.Object
-
- java.lang.Thread
-
- org.astrogrid.samp.gui.SampThread
-
- All Implemented Interfaces:
java.lang.Runnable
abstract class SampThread extends java.lang.Thread
Helper class for performing a SAMP operation from within the Event Dispatch Thread. You must implement the#runSamp
method to do the work; any resulting SampException will be suitably displayed to the user.- Since:
- 27 Jul 2011
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description SampThread(java.awt.Component parent, java.lang.String errTitle, java.lang.String errText)
Constructs a SampThread given a parent component.SampThread(java.util.EventObject evt, java.lang.String errTitle, java.lang.String errText)
Constructs a SampThread given an event object with a source which presumably corresponds to a parent component.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
run()
protected abstract void
sampRun()
Called from therun()
method.-
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, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
SampThread
public SampThread(java.awt.Component parent, java.lang.String errTitle, java.lang.String errText)
Constructs a SampThread given a parent component. Arguments are required for posting an error if one occurs.- Parameters:
parent
- parent componenterrTitle
- title of error window if one is needederrText
- text of error messsage if one is needed
-
SampThread
public SampThread(java.util.EventObject evt, java.lang.String errTitle, java.lang.String errText)
Constructs a SampThread given an event object with a source which presumably corresponds to a parent component.- Parameters:
evt
- triggering eventerrTitle
- title of error window if one is needederrText
- text of error messsage if one is needed
-
-
Method Detail
-
sampRun
protected abstract void sampRun() throws SampException
Called from therun()
method.- Throws:
SampException
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-