|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbodhidharma.utilities.ProgressBarTaskMonitor
public abstract class ProgressBarTaskMonitor
An abstract class that is used by ProgressBarDialog
windows
in order to perform the processing that is measured by the window as well
as keep the window updated.
All parts of this class are implemented here except for the go
method. This method shoulud use a SwingWorker
object to
start and perform the task to be performed. It should also keep the
current_amount_completed, time_started, task_completed,
task_completed, task_canceled, progress_message and
error_message fields updated so that they can be queried by the calling
ProgressBarDialog
.
The part of the class implemented here essentially provides an interface
for the calling ProgressBarDialog
and calculates the time elapsed
and the estimated processing time remaining. The get and is methods can be called to
get updates on how the process is progressing. The stop
method
can be called in order to stop processing if the process is to be cancelled.
ProgressBarDialog
,
SwingWorker
Field Summary | |
---|---|
protected int |
current_amount_completed
|
protected java.lang.String |
error_message
|
protected int |
length_of_task
|
protected java.lang.String |
progress_message
|
protected boolean |
task_canceled
|
protected boolean |
task_completed
|
protected long |
time_started
|
Constructor Summary | |
---|---|
ProgressBarTaskMonitor(int number_of_sub_tasks)
Basic constructor that sets the overall task to complete as well as the total number of sub-tasks to be completed in the overall task. |
Method Summary | |
---|---|
int |
getCurrentAmountCompleted()
Called from a ProgressBarDialog to find out how many sub-tasks have been done. |
java.lang.String |
getErrorMessage()
Returns the most recent error message(s), or null if there is no current error message. |
int |
getLengthOfTask()
Called from a ProgressBarDialog to find out how many sub-tasks remain to be done. |
java.lang.String |
getProgressMessage()
Returns the most recent progress message(s), or null if there is no current progress message. |
java.lang.String |
getTimeMessage()
Returns a String indicating how much time has already passed and the
estimated time remaining. |
abstract void |
go()
Called from ProgressBarDialog to start the overall task. |
boolean |
isCancelled()
Called from a ProgressBarDialog to find out if the overall task has been cancelled. |
boolean |
isDone()
Called from a ProgressBarDialog to find out if the overall task has completed. |
void |
stop()
Called if the overall task is cancelled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int length_of_task
protected int current_amount_completed
protected long time_started
protected boolean task_completed
protected boolean task_canceled
protected java.lang.String progress_message
protected java.lang.String error_message
Constructor Detail |
---|
public ProgressBarTaskMonitor(int number_of_sub_tasks)
NOTE: All sub-tasks are assumed to be of equal length in terms of processing duration.
number_of_sub_tasks
- Number of sub-tasks that will need to be completed in all.Method Detail |
---|
public abstract void go()
public int getLengthOfTask()
public int getCurrentAmountCompleted()
public boolean isDone()
public boolean isCancelled()
public java.lang.String getTimeMessage()
String
indicating how much time has already passed and the
estimated time remaining.
public java.lang.String getProgressMessage()
public java.lang.String getErrorMessage()
public void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |