Package ca.cgjennings.algo
Class ProgressBarAdapter
- java.lang.Object
-
- ca.cgjennings.algo.ProgressBarAdapter
-
- All Implemented Interfaces:
ProgressListener
,java.util.EventListener
public class ProgressBarAdapter extends java.lang.Object implements ProgressListener
A progress listener that safely updates a progress bar from any thread.- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description ProgressBarAdapter(javax.swing.JProgressBar bar)
Creates a new progress bar adapter that listens for progress updates and updates the specified progress bar accordingly.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
progressUpdate(java.lang.Object source, float progress)
Called to indicate that an algorithm has made progress towards completion.
-
-
-
Method Detail
-
progressUpdate
public boolean progressUpdate(java.lang.Object source, float progress)
Description copied from interface:ProgressListener
Called to indicate that an algorithm has made progress towards completion. If the listener returnstrue
, it is a hint that the operation should be cancelled if possible.- Specified by:
progressUpdate
in interfaceProgressListener
- Parameters:
source
- the source of the progress eventprogress
- a value between 0 (none) and 1 (algorithm complete)- Returns:
true
if the callee wishes to hint that the algorithm be cancelled
-
-