Package de.sciss.common
Interface ProcessingThread.Client
-
- Enclosing class:
- ProcessingThread
public static interface ProcessingThread.Client
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidprocessCancel(ProcessingThread context)This gets invoked when the user requests to abort the process.voidprocessFinished(ProcessingThread context)This gets invoked whenprocessRun()is finished or aborted.intprocessRun(ProcessingThread context)Does the processing.
-
-
-
Field Detail
-
DONE
static final int DONE
- See Also:
- Constant Field Values
-
FAILED
static final int FAILED
- See Also:
- Constant Field Values
-
CANCELLED
static final int CANCELLED
- See Also:
- Constant Field Values
-
-
Method Detail
-
processRun
int processRun(ProcessingThread context) throws java.io.IOException
Does the processing. This is called inside a separate asynchronous thread. synchronization: like Thread's run method, this is called inside a custom thread- Parameters:
context- the corresponding thread. callcontext.setProgression()to update visual progress feedback.- Returns:
- return code, which is either of
DONEon success,FAILEDon failure, orCANCELLEDif cancelled. The implementing class may which to call the context'ssetExceptionmethod if an error occurs. - Throws:
java.io.IOException- See Also:
ProcessingThread.setProgression( float ),ProcessingThread.setException( Exception )
-
processFinished
void processFinished(ProcessingThread context)
This gets invoked whenprocessRun()is finished or aborted. It's useful to place GUI related stuff in here since this gets called inside the Swing thread. synchronization: this is called in the event thread- Parameters:
context- the corresponding thread. in case of failure can be used to query the exception.
-
processCancel
void processCancel(ProcessingThread context)
This gets invoked when the user requests to abort the process. The client should set a signal flag for the processing routine to cancel as soon as possible. All partly commited edits should be undone. synchronization: this is called in the event thread- Parameters:
context- the corresponding thread. in case of failure can be used to query the exception.
-
-