org.bs.mdi.swing
Class SwingProgressMonitor

java.lang.Object
  extended byorg.bs.mdi.swing.SwingProgressMonitor
All Implemented Interfaces:
ActionListener, EventListener, ProgressMonitor

public class SwingProgressMonitor
extends Object
implements ProgressMonitor, ActionListener

A ProgressMonitor which uses Swing components for display.


Constructor Summary
SwingProgressMonitor(JProgressBar progressBar)
          Creates a new SwingProgressMonitor, which uses the specified progress bar to give the user feedback about currently running tasks.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void add(Task task)
          Registers the given Task.
protected  void finalize()
           
 void remove(Task task)
          Unregisters the given Task.
protected  void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingProgressMonitor

public SwingProgressMonitor(JProgressBar progressBar)
Creates a new SwingProgressMonitor, which uses the specified progress bar to give the user feedback about currently running tasks.

Parameters:
progressBar - the progress bar used for display
Method Detail

add

public void add(Task task)
Description copied from interface: ProgressMonitor
Registers the given Task. After this method got called, the given Task is periodically queried for its progress. This progress is displayed to the user.

Specified by:
add in interface ProgressMonitor
Parameters:
task -

remove

public void remove(Task task)
Description copied from interface: ProgressMonitor
Unregisters the given Task. The task is no longer queried for its progress after this method got called.

Specified by:
remove in interface ProgressMonitor
Parameters:
task -

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

update

protected void update()

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable