Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProgressBarAdapter

        public ProgressBarAdapter​(javax.swing.JProgressBar bar)
        Creates a new progress bar adapter that listens for progress updates and updates the specified progress bar accordingly.
        Parameters:
        bar - the progress bar to update
    • 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 returns true, it is a hint that the operation should be cancelled if possible.
        Specified by:
        progressUpdate in interface ProgressListener
        Parameters:
        source - the source of the progress event
        progress - a value between 0 (none) and 1 (algorithm complete)
        Returns:
        true if the callee wishes to hint that the algorithm be cancelled