|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.gui.headless.ProgressPrinter
Prints progress report of a lengtly 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 stoping the lenghtly task.
| Constructor Summary | |
ProgressPrinter()
Constructs a new object sending progress reports to the standard output stream. |
|
ProgressPrinter(java.io.PrintWriter out)
Constructs a new object sending progress reports to the specified stream. |
|
ProgressPrinter(java.io.PrintWriter out,
int maxLength)
Constructs a new object sending progress reports to the specified stream. |
|
| Method Summary | |
void |
complete()
Notifies this listener that the operation has finished. |
void |
dispose()
Release any resource hold by this object. |
void |
exceptionOccurred(java.lang.Throwable exception)
Prints an exception stack trace in a box. |
java.lang.String |
getDescription()
Returns the description for the lengthly operation to be reported, or if none. |
boolean |
isCanceled()
Is this job canceled? |
void |
progress(float percent)
Notifies this listener of progress in the lengthly operation. Progress are reported as a value between 0 and 100 inclusive. Values out of bounds will be clamped. |
void |
setCanceled(boolean canceled)
Indicate that progress should is canceled. |
void |
setDescription(java.lang.String description)
Set the description for the lenghtly operation to be reported. This method is usually invoked before any progress begins. However, it is legal to invoke this method at any time during the operation, in which case the description display is updated without any change to the percentage accomplished. |
void |
started()
Notifies this listener that the operation begins. |
void |
warningOccurred(java.lang.String source,
java.lang.String margin,
java.lang.String warning)
Prints a warning. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ProgressPrinter()
public ProgressPrinter(java.io.PrintWriter out)
public ProgressPrinter(java.io.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 java.lang.String getDescription()
getDescription in interface ProgressListenerpublic void setDescription(java.lang.String description)
setDescription in interface ProgressListenerdescription - The new description, or if none.public void started()
started in interface ProgressListenerpublic void progress(float percent)
progress in interface ProgressListenerpublic void complete()
complete in interface ProgressListenerpublic void dispose()
dispose in interface ProgressListenerpublic boolean isCanceled()
isCanceled in interface ProgressListenerpublic void setCanceled(boolean canceled)
setCanceled in interface ProgressListener
public void warningOccurred(java.lang.String source,
java.lang.String margin,
java.lang.String warning)
warningOccurred in interface ProgressListenersource - The source of the warning, or 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 if none.
This is typically the line number where the error occured in the 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 marging width.public void exceptionOccurred(java.lang.Throwable exception)
exceptionOccurred in interface ProgressListener
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||