|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectProgressController
ProgressPrinter
@ThreadSafe public class ProgressPrinter
Prints progress report of a lengthly operation to an output stream. Progress are reported as percentage on a single line. This class can also prints warning, which is useful for notifications without stopping the lengthly task.
| display/geotk-widgets-swing (download) | View source code for this class |
| Constructor Summary | |
|---|---|
ProgressPrinter()
Constructs a new object sending progress reports to the standard output stream. |
|
ProgressPrinter(PrintWriter out)
Constructs a new object sending progress reports to the specified stream. |
|
ProgressPrinter(PrintWriter out,
int maxLength)
Constructs a new object sending progress reports to the specified stream. |
|
| Method Summary | |
|---|---|
void |
completed()
Notifies this listener that the operation has finished. |
void |
exceptionOccurred(Throwable exception)
Prints an exception stack trace in a box. |
void |
setProgress(float percent)
Notifies this controller of progress in the lengthly operation. |
void |
started()
Notifies this controller that the operation begins. |
void |
warningOccurred(String source,
String margin,
String warning)
Prints a warning. |
| Methods inherited from class ProgressController |
|---|
cancel, completed, failed, getLocale, getProgress, getTask, isCanceled, progressing, setTask, started |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProgressPrinter()
public ProgressPrinter(PrintWriter out)
out - The output stream.
public ProgressPrinter(PrintWriter out,
int maxLength)
out - The output stream.maxLength - The maximal line length. This is used by warningOccurred(java.lang.String, java.lang.String, java.lang.String)
for splitting longer lines into many lines.| Method Detail |
|---|
public void started()
started in class ProgressControllerpublic void setProgress(float percent)
setProgress in class ProgressControllerpercent - The progress as a value between 0 and 100 inclusive.
public void warningOccurred(String source,
String margin,
String warning)
warningOccurred in class ProgressControllersource - The source of the warning, or null if none. This is typically the
filename in process of being parsed.margin - Text to write on the left side of the warning message, or null if none.
This is typically the line number where the error occurred in the source file.warning - The warning message. If this string is longer than the maximal length
specified at construction time (80 characters by default), then it will be splitted
in as many lines as needed and indented according the margin width.public void exceptionOccurred(Throwable exception)
exceptionOccurred in class ProgressControllerexception - The exception to report.public void completed()
completed in class ProgressController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||