public abstract class MultiPassKernelSwingWorker
extends javax.swing.SwingWorker<java.lang.Void,java.lang.Void>
Kernel
s.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_POLL_INTERVAL |
private Kernel |
kernel |
private javax.swing.Timer |
timer |
Modifier | Constructor and Description |
---|---|
protected |
MultiPassKernelSwingWorker(Kernel kernel) |
Modifier and Type | Method and Description |
---|---|
void |
cancelExecution()
Utility method which just invokes
Kernel.cancelMultiPass() on the executing kernel. |
private void |
cleanUpExecution() |
protected java.lang.Void |
doInBackground()
Executes the
kernel via executeKernel(Kernel) , whilst also managing progress updates for the kernel's passId. |
protected abstract void |
executeKernel(Kernel kernel)
This method must invoke one of the
kernel 's execute() methods. |
protected int |
getPollIntervalMillis()
The interval at which the Kernel's current passId is polled.
|
private void |
setUpExecution() |
private void |
updatePassId() |
protected abstract void |
updatePassId(int passId)
This method, which is always invoked on the swing event dispatch thread, should be used to update any components (such as a
JProgressBar ) so
as to reflect the progress of the multi-pass Kernel being executed. |
public static final int DEFAULT_POLL_INTERVAL
private Kernel kernel
private javax.swing.Timer timer
protected MultiPassKernelSwingWorker(Kernel kernel)
public void cancelExecution()
Kernel.cancelMultiPass()
on the executing kernel.protected abstract void executeKernel(Kernel kernel)
kernel
's execute() methods.protected abstract void updatePassId(int passId)
JProgressBar
) so
as to reflect the progress of the multi-pass Kernel being executed.passId
- The passId for the Kernel's current pass, or one of the constant fields returnable by KernelRunner.getCurrentPass()
.protected final java.lang.Void doInBackground() throws java.lang.Exception
kernel
via executeKernel(Kernel)
, whilst also managing progress updates for the kernel's passId.doInBackground
in class javax.swing.SwingWorker<java.lang.Void,java.lang.Void>
java.lang.Exception
private void setUpExecution()
private void cleanUpExecution()
private void updatePassId()
protected int getPollIntervalMillis()
DEFAULT_POLL_INTERVAL
.