|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbodhidharma.utilities.LargeProgressBarTaskMonitor
public abstract class LargeProgressBarTaskMonitor
An abstract class that is used by LargeProgressBarDialog
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 should use a SwingWorker
object to
start and perform the task to be performed. It should also keep the
fields of this object updated so that they can be queried by the calling
LargeProgressBarDialog
.
The part of the class implemented here essentially provides an interface
for the calling LargeProgressBarDialog
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.
The markTaskComplete
method is used to note that the task has
been completed.
LargeProgressBarDialog
,
SwingWorker
Field Summary | |
---|---|
protected int |
bottom_current_amount_completed
|
protected int |
bottom_length_of_task
|
protected java.lang.String |
bottom_progress_message
|
protected long |
bottom_time_started
|
protected int |
middle_current_amount_completed
|
protected int |
middle_length_of_task
|
protected java.lang.String |
middle_progress_message
|
protected long |
middle_time_started
|
protected boolean |
new_bottom_task_started
|
protected boolean |
new_middle_task_started
|
protected boolean |
new_top_task_started
|
protected boolean |
task_canceled
|
protected boolean |
task_completed
|
protected int |
top_current_amount_completed
|
protected int |
top_length_of_task
|
protected java.lang.String |
top_progress_message
|
protected long |
top_time_started
|
Constructor Summary | |
---|---|
LargeProgressBarTaskMonitor()
Basic constructor that sets other private fields to defaluts. |
Method Summary | |
---|---|
protected java.lang.String |
findTimeWithProperUnits(int seconds)
|
int |
getBottomCurrentAmountCompleted()
Called from a LargeProgressBarDialog to find out how many sub-tasks have been done. |
int |
getBottomLengthOfTask()
Called from a LargeProgressBarDialog to find out how many sub-tasks remain to be done. |
java.lang.String |
getBottomTextMessage()
Returns a String indicating how much time has already passed and the
estimated time remaining as well as the task currently being performed. |
int |
getMiddleCurrentAmountCompleted()
Called from a LargeProgressBarDialog to find out how many sub-tasks have been done. |
int |
getMiddleLengthOfTask()
Called from a LargeProgressBarDialog to find out how many sub-tasks remain to be done. |
java.lang.String |
getMiddleTextMessage()
Returns a String indicating how much time has already passed and the
estimated time remaining as well as the task currently being performed. |
int |
getTopCurrentAmountCompleted()
Called from a LargeProgressBarDialog to find out how many sub-tasks have been done. |
int |
getTopLengthOfTask()
Called from a LargeProgressBarDialog to find out how many sub-tasks remain to be done. |
java.lang.String |
getTopTextMessage()
Returns a String indicating how much time has already passed and the
estimated time remaining as well as the task currently being performed. |
abstract void |
go()
Called from ProgressBarDialog to start the overall task. |
boolean |
isCancelled()
Called if the overall task has been cancelled. |
boolean |
isDone()
Called to find out if the overall task has completed. |
void |
markTaskComplete()
Called if the overall task is complete. |
boolean |
startNewBottomProgress()
Called from a LargeProgressBarDialog to find out how many sub-tasks remain to be done. |
boolean |
startNewMiddleProgress()
Called from a LargeProgressBarDialog to find out how many sub-tasks remain to be done. |
boolean |
startNewTopProgress()
Called from a LargeProgressBarDialog to find out how many sub-tasks remain to be done. |
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 top_length_of_task
protected int middle_length_of_task
protected int bottom_length_of_task
protected boolean new_top_task_started
protected boolean new_middle_task_started
protected boolean new_bottom_task_started
protected int top_current_amount_completed
protected int middle_current_amount_completed
protected int bottom_current_amount_completed
protected long top_time_started
protected long middle_time_started
protected long bottom_time_started
protected java.lang.String top_progress_message
protected java.lang.String middle_progress_message
protected java.lang.String bottom_progress_message
protected boolean task_completed
protected boolean task_canceled
Constructor Detail |
---|
public LargeProgressBarTaskMonitor()
Method Detail |
---|
public abstract void go()
public boolean startNewTopProgress()
public boolean startNewMiddleProgress()
public boolean startNewBottomProgress()
public int getTopLengthOfTask()
public int getMiddleLengthOfTask()
public int getBottomLengthOfTask()
public int getTopCurrentAmountCompleted()
public int getMiddleCurrentAmountCompleted()
public int getBottomCurrentAmountCompleted()
public boolean isDone()
public boolean isCancelled()
public java.lang.String getTopTextMessage()
String
indicating how much time has already passed and the
estimated time remaining as well as the task currently being performed.
public java.lang.String getMiddleTextMessage()
String
indicating how much time has already passed and the
estimated time remaining as well as the task currently being performed.
public java.lang.String getBottomTextMessage()
String
indicating how much time has already passed and the
estimated time remaining as well as the task currently being performed.
public void stop()
public void markTaskComplete()
protected java.lang.String findTimeWithProperUnits(int seconds)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |