org.crosswire.common.progress.swing
Class JobsProgressBar.JobData

java.lang.Object
  extended by org.crosswire.common.progress.swing.JobsProgressBar.JobData
All Implemented Interfaces:
PropertyChangeListener, EventListener
Enclosing class:
JobsProgressBar

private static class JobsProgressBar.JobData
extends Object
implements PropertyChangeListener

A simple struct to group information about a Job


Field Summary
private  JButton cancelButton
           
private  Component comp
           
private  int index
           
private  Job job
           
private  JProgressBar progress
           
 
Constructor Summary
JobsProgressBar.JobData(Job job, int index, JProgressBar progress)
          Simple ctor
 
Method Summary
private  JButton createCancelButton()
          Create a cancel button that only shows the cancel icon.
private  Component decorateProgressBar()
          Decorate the progress bar if the job can be interrupted.
 JButton getCancelButton()
           
 Component getComponent()
           
(package private)  int getIndex()
          Accessor for the index
(package private)  Job getJob()
          Accessor for the Job
(package private)  JProgressBar getProgress()
          Accessor for the Progress Bar
(package private)  void invalidate()
          ensure we can't be used again
 void propertyChange(PropertyChangeEvent evt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

job

private Job job

index

private int index

progress

private JProgressBar progress

comp

private Component comp

cancelButton

private JButton cancelButton
Constructor Detail

JobsProgressBar.JobData

JobsProgressBar.JobData(Job job,
                        int index,
                        JProgressBar progress)
Simple ctor

Method Detail

invalidate

void invalidate()
ensure we can't be used again


getJob

Job getJob()
Accessor for the Job


getProgress

JProgressBar getProgress()
Accessor for the Progress Bar


getComponent

public Component getComponent()

getCancelButton

public JButton getCancelButton()
Returns:
Returns the cancelButton.

getIndex

int getIndex()
Accessor for the index


propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

createCancelButton

private JButton createCancelButton()
Create a cancel button that only shows the cancel icon. When the button is pressed the job is interrupted.

Returns:
a custom cancel button

decorateProgressBar

private Component decorateProgressBar()
Decorate the progress bar if the job can be interrupted. We put the cancel button in a 1 row, 2 column grid where the button is in a minimally sized fixed cell and the progress meter follows in a horizontally stretchy cell


Copyright ? 2003-2004