Package offlineProcessing
Class OfflineTaskGroup.TaskGroupWorker
- All Implemented Interfaces:
Runnable
,Future<Integer>
,RunnableFuture<Integer>
,ViewLoadObserver
- Enclosing class:
OfflineTaskGroup
public class OfflineTaskGroup.TaskGroupWorker
extends SwingWorker<Integer,TaskMonitorData>
implements ViewLoadObserver
Swing worker to do the actual work.
- Author:
- Doug Gillespie
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Ask the load observer if loading should be stopped.protected Integer
protected void
done()
boolean
Check whether the thread has been stopped.void
protected void
process
(List<TaskMonitorData> chunks) void
publish
(TaskMonitorData tmd) void
sayProgress
(int state, long loadStart, long loadEnd, long lastTime, int nLoaded) Report progress back to the load observerMethods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
Method Details
-
killWorker
public void killWorker() -
isInstantKill
public boolean isInstantKill()Check whether the thread has been stopped.- Returns:
- true if the thread has been stopped.
-
doInBackground
- Specified by:
doInBackground
in classSwingWorker<Integer,
TaskMonitorData>
-
publish
-
done
protected void done()- Overrides:
done
in classSwingWorker<Integer,
TaskMonitorData>
-
process
- Overrides:
process
in classSwingWorker<Integer,
TaskMonitorData>
-
sayProgress
public void sayProgress(int state, long loadStart, long loadEnd, long lastTime, int nLoaded) Description copied from interface:ViewLoadObserver
Report progress back to the load observer- Specified by:
sayProgress
in interfaceViewLoadObserver
- Parameters:
state
- LoadQueueProgressData.STATE_LINKINGSUBTABLE, STATE_LOADING or STATE_DONEloadStart
-loadEnd
-lastTime
-nLoaded
-- See Also:
-
cancelLoad
public boolean cancelLoad()Description copied from interface:ViewLoadObserver
Ask the load observer if loading should be stopped.- Specified by:
cancelLoad
in interfaceViewLoadObserver
- Returns:
-