|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.control.InGameInputHandler.SwingTask
abstract static class InGameInputHandler.SwingTask
This utility class is the base class for tasks that need to run in the event dispatch thread.
| Field Summary | |
|---|---|
private java.lang.Object |
_result
|
private boolean |
_started
|
private boolean |
_synchronous
|
private static java.util.logging.Logger |
taskLogger
|
| Constructor Summary | |
|---|---|
InGameInputHandler.SwingTask()
|
|
| Method Summary | |
|---|---|
protected abstract java.lang.Object |
doWork()
Override this method to do the actual work. |
java.lang.Object |
getResult()
Get the return vale from doWork(). |
java.lang.Object |
invokeAndWait()
Run the task and wait for it to complete. |
void |
invokeLater()
Run the task at some later time. |
java.lang.Object |
invokeSpecial()
|
private boolean |
isSynchronous()
Check if the client is waiting. |
private void |
markDone()
Mark finished. |
private void |
markStarted(boolean synchronous)
Mark started and set the synchronous flag. |
void |
run()
Run method, call doWork() and save the return value. |
private void |
setResult(java.lang.Object r)
Save result. |
private void |
verifyNotStarted()
Throw an exception if the task is started. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger taskLogger
private java.lang.Object _result
private boolean _synchronous
private boolean _started
| Constructor Detail |
|---|
InGameInputHandler.SwingTask()
| Method Detail |
|---|
public java.lang.Object invokeAndWait()
throws java.lang.reflect.InvocationTargetException
doWork().
java.lang.reflect.InvocationTargetException - on unexpected exceptions.public void invokeLater()
public java.lang.Object invokeSpecial()
throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetExceptionprivate void markStarted(boolean synchronous)
synchronous - The synch/asynch flag.private void markDone()
private void verifyNotStarted()
private boolean isSynchronous()
public final void run()
doWork() and save the return value. Also
catch any exceptions. In synchronous mode they will be rethrown to
the original thread, in asynchronous mode they will be logged and
ignored. Nothing is gained by crashing the event dispatch thread.
run in interface java.lang.Runnablepublic java.lang.Object getResult()
doWork().
private void setResult(java.lang.Object r)
r - The result.protected abstract java.lang.Object doWork()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||