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 TypeMethodDescriptionvoidcomplete()Notifies this listener that the operation has finished.floatReturns the current progress as a percent completed.voidprogress(float progress) Notifies this listener of progress in the lengthly operation.voidstarted()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:ProgressListenerNotifies this listener that the operation begins.- Specified by:
startedin interfaceProgressListener- Overrides:
startedin classDelegateProgressListener
-
complete
public void complete()Description copied from interface:ProgressListenerNotifies 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:
completein interfaceProgressListener- Overrides:
completein classDelegateProgressListener
-
getProgress
public float getProgress()Description copied from interface:ProgressListenerReturns the current progress as a percent completed.- Specified by:
getProgressin interfaceProgressListener- Overrides:
getProgressin classDelegateProgressListener- Returns:
- Percent completed between 0 and 100 inclusive.
-
progress
public void progress(float progress) Description copied from interface:ProgressListenerNotifies 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:
progressin interfaceProgressListener- Overrides:
progressin classDelegateProgressListener- Parameters:
progress- The progress as a value between 0 and 100 inclusive.
-