Package ij.gui

Class ProgressBar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ProgressBar
extends Canvas
This is the progress bar that is displayed in the lower right hand corner of the ImageJ window. Use one of the static IJ.showProgress() methods to display and update the progress bar.
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • ProgressBar

      public ProgressBar​(int canvasWidth, int canvasHeight)
      This constructor is called once by ImageJ at startup.
  • Method Details

    • init

      public void init​(int canvasWidth, int canvasHeight)
    • show

      public void show​(double progress)
      Updates the progress bar, where abs(progress) should run from 0 to 1. If abs(progress) == 1 the bar is erased. The bar is updated only if more than 90 ms have passed since the last call. Does nothing if the ImageJ window is not present.
      Parameters:
      progress - Length of the progress bar to display (0...1). Using progress with negative sign (0 .. -1) will regard subsequent calls with positive argument as sub-ordinate processes that are displayed as moving dot.
    • show

      public void show​(double progress, boolean showInBatchMode)
      Updates the progress bar, where abs(progress) should run from 0 to 1.
      Parameters:
      progress - Length of the progress bar to display (0...1).
      showInBatchMode - show progress bar in batch mode macros?
    • show

      public void show​(int currentIndex, int finalIndex)
      Updates the progress bar, where the length of the bar is set to ((abs(currentIndex)+1)/abs(finalIndex) of the maximum bar length. Use a negative currentIndex to show subsequent plugin calls as moving dot. The bar is erased if currentIndex>=finalIndex-1 or finalIndex == 0.
    • update

      public void update​(Graphics g)
      Overrides:
      update in class Canvas
    • paint

      public void paint​(Graphics g)
      Overrides:
      paint in class Canvas
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class Component
    • setBatchMode

      public void setBatchMode​(boolean batchMode)