| java.lang.Object org.geotools.gui.headless.ProgressPrinter
ProgressPrinter | public class ProgressPrinter implements ProgressListener(Code) | | 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.
since: 2.0 version: $Id: ProgressPrinter.java 22680 2006-11-09 22:32:27Z jgarnett $ author: Martin Desruisseaux |
Constructor Summary | |
public | ProgressPrinter() Constructs a new object sending progress reports to the
. | public | ProgressPrinter(PrintWriter out) Constructs a new object sending progress reports to the specified stream. | public | ProgressPrinter(PrintWriter out, int maxLength) Constructs a new object sending progress reports to the specified stream.
Parameters: out - The output stream. Parameters: maxLength - The maximal line length. |
ProgressPrinter | public ProgressPrinter()(Code) | | Constructs a new object sending progress reports to the
.
The maximal line length is assumed 80 characters.
|
ProgressPrinter | public ProgressPrinter(PrintWriter out)(Code) | | Constructs a new object sending progress reports to the specified stream.
The maximal line length is assumed 80 characters.
|
ProgressPrinter | public ProgressPrinter(PrintWriter out, int maxLength)(Code) | | Constructs a new object sending progress reports to the specified stream.
Parameters: out - The output stream. Parameters: maxLength - The maximal line length. This is used by ProgressPrinter.warningOccurredfor splitting longer lines into many lines. |
complete | public synchronized void complete()(Code) | | Notifies this listener that the operation has finished. The progress indicator will
shows 100% or disaspears. If warning messages were pending, they will be printed now.
|
dispose | public void dispose()(Code) | | Release any resource hold by this object.
|
exceptionOccurred | public synchronized void exceptionOccurred(Throwable exception)(Code) | | Prints an exception stack trace in a box.
|
getTask | public InternationalString getTask()(Code) | | |
isCanceled | public boolean isCanceled()(Code) | | |
progress | public synchronized void progress(float percent)(Code) | | |
setCanceled | public void setCanceled(boolean canceled)(Code) | | |
setDescription | public synchronized void setDescription(String description)(Code) | | |
setTask | public void setTask(InternationalString task)(Code) | | |
started | public synchronized void started()(Code) | | |
warningOccurred | public synchronized void warningOccurred(String source, String margin, String warning)(Code) | | Prints a warning. The first time this method is invoked, the localized word "WARNING" will
be printed in the middle of a box. If a source is specified, it will be printed only if it
is not the same one than the source of the last warning. If a marging is specified, it will
be printed of the left side of the first line of the warning message.
Parameters: source - The source of the warning, or null if none. This is typically thefilename in process of being parsed. Parameters: 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 occured in the source file. Parameters: warning - The warning message. If this string is longer than the maximal lengthspecified at construction time (80 characters by default), then it will be splittedin as many lines as needed and indented according the marging width. |
|
|