org.geotools.util
Class SubProgressListener

Object
  extended by DelegateProgressListener
      extended by SubProgressListener
All Implemented Interfaces:
ProgressListener

public class SubProgressListener
extends DelegateProgressListener

A sub progress monitor, used to delegate a portion of work to a separate process.

Example:


 if( progress == null ) progress = new NullProgressListener();
 progress.started();
 progress.setDecsription("Connect");
 ..connect to data store and obtain feature collection...
 progress.progress( 20 ); // connecting represents 20% of the work
 progress.setDescription("Process features");
 featureCollection.accepts( visitor, new SubProgress( progress, 80 ) );
 progress.completed();
 

Author:
Jody

Field Summary
 
Fields inherited from class DelegateProgressListener
delegate
 
Constructor Summary
SubProgressListener(ProgressListener progress, float amount)
          Create a sub progress monitor, used to delegate work to a separate process.
 
Method Summary
 void complete()
           
 float getProgress()
           
 void progress(float progress)
           
 void started()
           
 
Methods inherited from class DelegateProgressListener
dispose, exceptionOccurred, getDescription, getTask, isCanceled, setCanceled, setDescription, setTask, warningOccurred
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubProgressListener

public SubProgressListener(ProgressListener progress,
                           float amount)
Create a sub progress monitor, used to delegate work to a separate process.

Parameters:
progress - parent progress to notify as we get work done
amount - amount of progress represented
Method Detail

started

public void started()
Specified by:
started in interface ProgressListener
Overrides:
started in class DelegateProgressListener

complete

public void complete()
Specified by:
complete in interface ProgressListener
Overrides:
complete in class DelegateProgressListener

getProgress

public float getProgress()
Specified by:
getProgress in interface ProgressListener
Overrides:
getProgress in class DelegateProgressListener

progress

public void progress(float progress)
Specified by:
progress in interface ProgressListener
Overrides:
progress in class DelegateProgressListener


Copyright © 1996-2009 Geotools. All Rights Reserved.