public interface ProgressMonitor
setMaximum(int)
method must always be called first to determine
the number of steps at which the task is finished. After that,
setProgress(int)
will be called repeatedly to indicate how
far one has got. The progress monitor is assumed to have an
internal state in which it remembers the maximum
value
set by the setMaximum(int)
method.
A more general alternative would be to have tasks accept progress listeners, but we probably don't want more than one progress bar anyway.
Modifier and Type | Interface and Description |
---|---|
static class |
ProgressMonitor.Empty
A progress monitor that does nothing.
|
Modifier and Type | Method and Description |
---|---|
void |
setMaximum(int maximum)
Set the maximum number of steps for this task.
|
void |
setProgress(int progress)
Set the progress achieved so far.
|
void setProgress(int progress)
progress
has to be >=0 and <= to the maximum
value previously set with setMaximum(int)
.progress
- number of steps completedvoid setMaximum(int maximum)
maximum
- maximum number of steps, >=0.