Interface ProcessingThread.Client

  • Enclosing class:
    ProcessingThread

    public static interface ProcessingThread.Client
    • 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. call context.setProgression() to update visual progress feedback.
        Returns:
        return code, which is either of DONE on success, FAILED on failure, or CANCELLED if cancelled. The implementing class may which to call the context's setException method if an error occurs.
        Throws:
        java.io.IOException
        See Also:
        ProcessingThread.setProgression( float ), ProcessingThread.setException( Exception )
      • processFinished

        void processFinished​(ProcessingThread context)
        This gets invoked when processRun() 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.