Package org.geotools.data.util
Class SubProgressListener
Object
DelegateProgressListener
SubProgressListener
- All Implemented Interfaces:
ProgressListener
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
ConstructorsConstructorDescriptionSubProgressListener
(ProgressListener progress, float amount) Create a sub progress monitor, used to delegate work to a separate process.SubProgressListener
(ProgressListener progress, float start, float amount) Create a sub progress monitor, used to delegate work to a separate process. -
Method Summary
Modifier and TypeMethodDescriptionvoid
complete()
Notifies this listener that the operation has finished.float
Returns the current progress as a percent completed.void
progress
(float progress) Notifies this listener of progress in the lengthly operation.void
started()
Notifies this listener that the operation begins.Methods inherited from class DelegateProgressListener
dispose, exceptionOccurred, getDelegate, getTask, isCanceled, setCanceled, setTask, warningOccurred
-
Constructor Details
-
SubProgressListener
Create a sub progress monitor, used to delegate work to a separate process.- Parameters:
progress
- parent progress to notify as we get work donestart
- the starting offset for the progressamount
- amount of progress represented
-
SubProgressListener
Create a sub progress monitor, used to delegate work to a separate process.- Parameters:
progress
- parent progress to notify as we get work doneamount
- amount of progress represented
-
-
Method Details
-
started
public void started()Description copied from interface:ProgressListener
Notifies this listener that the operation begins.- Specified by:
started
in interfaceProgressListener
- Overrides:
started
in classDelegateProgressListener
-
complete
public void complete()Description copied from interface:ProgressListener
Notifies this listener that the operation has finished. The progress indicator will shows 100% or disappears, at implementor choice. If warning messages were pending, they will be displayed now.- Specified by:
complete
in interfaceProgressListener
- Overrides:
complete
in classDelegateProgressListener
-
getProgress
public float getProgress()Description copied from interface:ProgressListener
Returns the current progress as a percent completed.- Specified by:
getProgress
in interfaceProgressListener
- Overrides:
getProgress
in classDelegateProgressListener
- Returns:
- Percent completed between 0 and 100 inclusive.
-
progress
public void progress(float progress) 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 interfaceProgressListener
- Overrides:
progress
in classDelegateProgressListener
- Parameters:
progress
- The progress as a value between 0 and 100 inclusive.
-