|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjebl.util.ProgressListener
jebl.util.CompositeProgressListener
public final class CompositeProgressListener
| Field Summary | |
|---|---|
protected double |
baseTime
|
protected int |
currentOperationNum
|
protected double |
currentOperationProgress
|
protected ProgressListener |
listener
|
protected int |
numOperations
|
protected double[] |
time
|
| Fields inherited from class jebl.util.ProgressListener |
|---|
EMPTY |
| Constructor Summary | |
|---|---|
CompositeProgressListener(ProgressListener listener,
double[] operationDuration)
|
|
| Method Summary | |
|---|---|
protected void |
_setIndeterminateProgress()
This method is a hook called from ProgressListener.setIndeterminateProgress() to
allow subclasses a custom reaction to setIndeterminateProgress events. |
protected void |
_setMessage(String message)
This method is a hook called from ProgressListener.setMessage(java.lang.String) to allow subclasses a
custom reaction to setMessage events. |
protected void |
_setProgress(double fractionCompleted)
This method is a hook called from ProgressListener.setProgress(double) to allow subclasses a
custom reaction to setProgress events. |
boolean |
addProgress(double fractionCompletedDiff)
|
void |
beginNextSubtask()
begins the next subtask. |
void |
beginNextSubtask(String message)
Convenience method to start the next operation AND set a new message. |
void |
beginSubtask()
Used as an alternative to beginNextSubtask(). |
void |
beginSubtask(String message)
Used as an alternative to beginNextSubtask(). |
void |
clearAllProgress()
Clear all progress, including that of previous subtasks. |
static CompositeProgressListener |
forFiles(ProgressListener listener,
List<File> files)
|
boolean |
hasNextSubtask()
|
boolean |
isCanceled()
This method must be implemented by all subclasses. |
boolean |
setComplete()
|
| Methods inherited from class jebl.util.ProgressListener |
|---|
setIndeterminateProgress, setMessage, setProgress |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int numOperations
protected ProgressListener listener
protected int currentOperationNum
protected double[] time
protected double baseTime
protected double currentOperationProgress
| Constructor Detail |
|---|
public CompositeProgressListener(ProgressListener listener,
double[] operationDuration)
| Method Detail |
|---|
public static CompositeProgressListener forFiles(ProgressListener listener,
List<File> files)
public void beginSubtask()
beginNextSubtask().
Instead of calling beginNextSubtask() once after each subtask
(except the last), you can instead call beginSubTask at the beginning
of every subtask including the first.
public void beginSubtask(String message)
beginNextSubtask().
Instead of calling beginNextSubtask() once after each subtask
(except the last), you can instead call beginSubTask at the beginning
of every subtask including the first.
message - a message to be displayed to the user as part of the progressprotected void _setProgress(double fractionCompleted)
ProgressListenerProgressListener.setProgress(double) to allow subclasses a
custom reaction to setProgress events. Currently, subclasses are required to
implement this method, but in the future it may get an empty default
implementation to make it optional for subclasses to subscribe to setProgress
events.
_setProgress in class ProgressListenerprotected void _setIndeterminateProgress()
ProgressListenerProgressListener.setIndeterminateProgress() to
allow subclasses a custom reaction to setIndeterminateProgress events.
Currently, subclasses are required to implement this method, but in the
future it may get an empty default implementation to make it optional
for subclasses to subscribe to setIndeterminateProgress events.
_setIndeterminateProgress in class ProgressListenerprotected void _setMessage(String message)
ProgressListenerProgressListener.setMessage(java.lang.String) to allow subclasses a
custom reaction to setMessage events. Currently, subclasses are required to
implement this method, but in the future it may get an empty default
implementation to make it optional for subclasses to subscribe to setMessage
events.
_setMessage in class ProgressListenerpublic boolean isCanceled()
ProgressListenerProgressListener.setProgress(double), ProgressListener.setIndeterminateProgress() and ProgressListener.setMessage(java.lang.String)
to determine the return value of these methods.
isCanceled in class ProgressListenerpublic boolean addProgress(double fractionCompletedDiff)
public boolean setComplete()
public boolean hasNextSubtask()
public void clearAllProgress()
public void beginNextSubtask(String message)
message - message to set (will be passed to setMessage()public void beginNextSubtask()
beginSubtask() instead.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||