com.pixelmed.display

## Class SafeProgressBarUpdaterThread

- java.lang.Object
- - com.pixelmed.display.SafeProgressBarUpdaterThread

All Implemented Interfaces:
  java.lang.Runnable

    public class SafeProgressBarUpdaterThread
    extends java.lang.Object
    implements java.lang.Runnable

A class that implements `Runnable` so that it can be invoked by `EventQueue.invokeLater()`.

This is needed, for example, to call from a worker thread, since the progress bar methods used MUST be invoked on the AWT Event Dispatch Thread.

So, for example, instead of directly accessing the `JProgressBar` methods:

            progressBar.setMaximum(maximum);
            progressBar.setValue(value);
            progressBar.repaint();

do the following instead:

      progressBarUpdater = new SafeProgressBarUpdaterThread(progressBar);
      ...
            progressBarUpdater.setMaximum(maximum);
            progressBarUpdater.setValue(value);
            java.awt.EventQueue.invokeLater(progressBarUpdater);

### Field Summary

Fields
`protected int` `maximum`
`protected javax.swing.JProgressBar` `progressBar`
`protected boolean` `stringPainted`
`protected int` `value`

### Constructor Summary

Constructors
Constructor and Description
`SafeProgressBarUpdaterThread(javax.swing.JProgressBar progressBar)`

### Method Summary

Methods
`void` `endProgressBar()`
`static void` `endProgressBar(SafeProgressBarUpdaterThread progressBarUpdater)`
`javax.swing.JProgressBar` `getProgressBar()`
`void` `run()`
`void` `setMaximum(int maximum)`
`void` `setStringPainted(boolean b)`
`void` `setValue(int value)`
`void` `startProgressBar()`
`void` `startProgressBar(int maximum)`
`static void` `startProgressBar(SafeProgressBarUpdaterThread progressBarUpdater)`
`static void` `startProgressBar(SafeProgressBarUpdaterThread progressBarUpdater, int maximum)`
`void` `updateProgressBar(int value)`
`void` `updateProgressBar(int value, int maximum)`
`static void` `updateProgressBar(SafeProgressBarUpdaterThread progressBarUpdater, int value)`
`static void` `updateProgressBar(SafeProgressBarUpdaterThread progressBarUpdater, int value, int maximum)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### progressBar

    protected javax.swing.JProgressBar progressBar

#### value

    protected int value

#### maximum

    protected int maximum

#### stringPainted

    protected boolean stringPainted

### Constructor Detail

#### SafeProgressBarUpdaterThread

    public SafeProgressBarUpdaterThread(javax.swing.JProgressBar progressBar)

### Method Detail

#### run

    public void run()

Specified by:
  `run` in interface `java.lang.Runnable`

#### setValue

    public void setValue(int value)

#### setMaximum

    public void setMaximum(int maximum)

#### setStringPainted

    public void setStringPainted(boolean b)

#### getProgressBar

    public javax.swing.JProgressBar getProgressBar()

#### startProgressBar

    public void startProgressBar(int maximum)

#### startProgressBar

    public void startProgressBar()

#### updateProgressBar

    public void updateProgressBar(int value)

#### updateProgressBar

    public void updateProgressBar(int value,
                         int maximum)

#### endProgressBar

    public void endProgressBar()

#### startProgressBar

    public static void startProgressBar(SafeProgressBarUpdaterThread progressBarUpdater,
                        int maximum)

#### startProgressBar

    public static void startProgressBar(SafeProgressBarUpdaterThread progressBarUpdater)

#### updateProgressBar

    public static void updateProgressBar(SafeProgressBarUpdaterThread progressBarUpdater,
                         int value)

#### updateProgressBar

    public static void updateProgressBar(SafeProgressBarUpdaterThread progressBarUpdater,
                         int value,
                         int maximum)

#### endProgressBar

    public static void endProgressBar(SafeProgressBarUpdaterThread progressBarUpdater)