|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.org.retep.util.monitor.JProgressBarListener
public class JProgressBarListener
A ProgressListener that can update progress on one or two JProgressBar component(s), depending on the action being monitored.
When an update is performed, this class ensures that the updates to the JProgressBar's are done from within the Swing event thread as the process being monitored is most likely being run from another Thread.
| Constructor Summary | |
|---|---|
JProgressBarListener(javax.swing.JProgressBar component)
Construct a ProgressListener with a single JProgressBar to update. |
|
JProgressBarListener(javax.swing.JProgressBar component,
javax.swing.JProgressBar secondaryComponent)
Construct a ProgressListener with two JProgressBar's to update. |
|
| Method Summary | |
|---|---|
javax.swing.JProgressBar |
getComponent()
|
javax.swing.JProgressBar |
getSecondaryComponent()
|
void |
setMaximum(long maximum)
Notify the listeners that the maximum value has changed |
void |
setMaximum(long inputMaximum,
long outputMaximum)
Notify the listeners that the maximum value has changed |
void |
showProgress(int progress)
Notify listeners of the current progress. |
void |
showProgress(long inputSize,
long outputSize)
Notify listners of the current progress. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JProgressBarListener(javax.swing.JProgressBar component)
This component must be used from within the Swing Event Thread
component - JProgressBar to update
public JProgressBarListener(javax.swing.JProgressBar component,
javax.swing.JProgressBar secondaryComponent)
This component must be used from within the Swing Event Thread
component - JProgressBar to update when the input changes, null for nonesecondaryComponent - JProgressBar to update when the output changes, null for none
java.lang.IllegalArgumentException - if both component and secondaryComponent are null| Method Detail |
|---|
public javax.swing.JProgressBar getComponent()
public javax.swing.JProgressBar getSecondaryComponent()
@DispatchThread(invocationType=INVOKE_LATER) public void showProgress(int progress)
ProgressListener
showProgress in interface ProgressListenerprogress - The current value of the process
@DispatchThread(invocationType=INVOKE_LATER)
public void showProgress(long inputSize,
long outputSize)
ProgressListener
showProgress in interface ProgressListenerinputSize - The current size of the input, possibly the amount read so faroutputSize - The current size of the output, probably the total size
of the compressed output@DispatchThread(invocationType=INVOKE_IMMEDIATE) public void setMaximum(long maximum)
ProgressListener
setMaximum in interface ProgressListenermaximum - The new maximum
@DispatchThread(invocationType=INVOKE_IMMEDIATE)
public void setMaximum(long inputMaximum,
long outputMaximum)
ProgressListener
setMaximum in interface ProgressListenerinputMaximum - The new maximum for the inputoutputMaximum - The new maximum for the output.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||