public class NullProgressListener extends Object implements ProgressListener
This implementation supports cancelation and getting/setting the description. The default implementations of the other methods do nothing.
| Constructor and Description |
|---|
NullProgressListener()
Creates a null progress listener with no description.
|
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Notifies this listener that the operation has finished.
|
void |
dispose()
Releases any resources used by this listener.
|
void |
exceptionOccurred(Throwable exception)
Reports an exception.
|
String |
getDescription() |
float |
getProgress()
Returns the current progress as a percent completed.
|
InternationalString |
getTask()
Returns the description of the current task being performed, or
null if none. |
boolean |
isCanceled()
Returns
true if this job is cancelled. |
void |
progress(float percent)
Notifies this listener of progress in the lengthly operation.
|
void |
setCanceled(boolean cancel)
Indicates that task should be cancelled.
|
void |
setDescription(String description) |
void |
setTask(InternationalString task)
Sets the description of the current task being performed.
|
void |
started()
Notifies this listener that the operation begins.
|
void |
warningOccurred(String source,
String location,
String warning)
Reports a warning.
|
public NullProgressListener()
public String getDescription()
public void setDescription(String description)
public void started()
ProgressListenerstarted in interface ProgressListenerpublic void progress(float percent)
ProgressListenerprogress in interface ProgressListenerpercent - The progress as a value between 0 and 100 inclusive.public float getProgress()
ProgressListenergetProgress in interface ProgressListenerpublic void complete()
ProgressListenercomplete in interface ProgressListenerpublic void dispose()
ProgressListenerdispose in interface ProgressListenerpublic void setCanceled(boolean cancel)
ProgressListenersetCanceled in interface ProgressListenercancel - true for cancelling the task.public boolean isCanceled()
ProgressListenertrue if this job is cancelled.isCanceled in interface ProgressListenertrue if this job is cancelled.public void warningOccurred(String source, String location, String warning)
ProgressListenerwarningOccurred in interface ProgressListenersource - Name of the warning source, or null if none. This is typically the
filename in process of being parsed or the URL of the data being processedlocation - 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 or the feature ID of the feature that produced the messagewarning - The warning message.public void exceptionOccurred(Throwable exception)
ProgressListenerexceptionOccurred in interface ProgressListenerexception - The exception to report.public InternationalString getTask()
ProgressListenernull if none. It is
assumed that if the task is null applications may simply report that the process is
"in progress" or "working" as represented in the current locale.getTask in interface ProgressListenernull if none.public void setTask(InternationalString task)
ProgressListenersetTask in interface ProgressListenertask - Description of the task being performed, or null if none.Copyright © 1996–2021 Geotools. All rights reserved.