org.geotools.util
Class NullProgressListener

java.lang.Object
  extended by org.geotools.util.NullProgressListener
All Implemented Interfaces:
org.opengis.util.ProgressListener

public class NullProgressListener
extends java.lang.Object
implements ProgressListener

A default progress listener implementation suitable for subclassing.

This implementation supports cancelation and getting/setting the description. The default implementations of the other methods do nothing.

Since:
2.2
Version:
$Id: NullProgressListener.java 30648 2008-06-12 19:22:35Z acuster $

Constructor Summary
NullProgressListener()
          Creates a null progress listener with no description.
 
Method Summary
 void complete()
          Notifies this listener that the operation has finished.
 void dispose()
          Release any resources used by this listener.
 void exceptionOccurred(java.lang.Throwable exception)
          Reports an exception.
 java.lang.String getDescription()
          Returns the description for the lengthly operation to be reported, or null if none.
 float getProgress()
           
 org.opengis.util.InternationalString getTask()
           
 boolean isCanceled()
          Is this job canceled?
 void progress(float percent)
          Notifies this listener of progress in the lengthly operation.
 void setCanceled(boolean cancel)
          Indicate that progress should is canceled.
 void setDescription(java.lang.String description)
          Set the description for the lenghtly operation to be reported.
 void setTask(org.opengis.util.InternationalString task)
           
 void started()
          Notifies this listener that the operation begins.
 void warningOccurred(java.lang.String source, java.lang.String location, java.lang.String warning)
          Reports a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullProgressListener

public NullProgressListener()
Creates a null progress listener with no description.

Method Detail

getDescription

public java.lang.String getDescription()
Description copied from interface: ProgressListener
Returns the description for the lengthly operation to be reported, or null if none.

Specified by:
getDescription in interface org.opengis.util.ProgressListener

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: ProgressListener
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.

Specified by:
setDescription in interface org.opengis.util.ProgressListener
Parameters:
description - The new description, or null if none.

started

public void started()
Description copied from interface: ProgressListener
Notifies this listener that the operation begins.

Specified by:
started in interface org.opengis.util.ProgressListener

progress

public void progress(float percent)
Description copied from interface: ProgressListener
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.

Specified by:
progress in interface org.opengis.util.ProgressListener

getProgress

public float getProgress()
Specified by:
getProgress in interface org.opengis.util.ProgressListener

complete

public void complete()
Description copied from interface: ProgressListener
Notifies this listener that the operation has finished. The progress indicator will shows 100% or disaspears, at implementor choice. If warning messages were pending, they will be displayed now.

Specified by:
complete in interface org.opengis.util.ProgressListener

dispose

public void dispose()
Description copied from interface: ProgressListener
Release any resources used by this listener. If the progress were reported in a window, this window may be disposed.

Specified by:
dispose in interface org.opengis.util.ProgressListener

setCanceled

public void setCanceled(boolean cancel)
Description copied from interface: ProgressListener
Indicate that progress should is canceled.

Specified by:
setCanceled in interface org.opengis.util.ProgressListener

isCanceled

public boolean isCanceled()
Description copied from interface: ProgressListener
Is this job canceled?

Specified by:
isCanceled in interface org.opengis.util.ProgressListener

warningOccurred

public void warningOccurred(java.lang.String source,
                            java.lang.String location,
                            java.lang.String warning)
Description copied from interface: ProgressListener
Reports a warning. This warning may be printed to the standard error stream, appears in a windows or be ignored, at implementor choice.

Specified by:
warningOccurred in interface org.opengis.util.ProgressListener
Parameters:
source - The source of the warning, or null if none. This is typically the filename in process of being parsed.
location - 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.
warning - The warning message.

exceptionOccurred

public void exceptionOccurred(java.lang.Throwable exception)
Description copied from interface: ProgressListener
Reports an exception. This method may prints the stack trace to the standard error stream or display it in a dialog box, at implementor choice.

Specified by:
exceptionOccurred in interface org.opengis.util.ProgressListener

getTask

public org.opengis.util.InternationalString getTask()
Specified by:
getTask in interface org.opengis.util.ProgressListener

setTask

public void setTask(org.opengis.util.InternationalString task)
Specified by:
setTask in interface org.opengis.util.ProgressListener


Copyright © 1996-2010 Geotools. All Rights Reserved.