Module org.jpo
Package org.jpo.gui

Class ProgressGui

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, ProgressListener

public class ProgressGui extends JFrame implements ProgressListener
a private class that allows the PictureAdder to show what it is doing.
See Also:
  • Constructor Details

    • ProgressGui

      public ProgressGui(int max, String title, String doneString)
      Constructor for a progress GUI
      Parameters:
      max - The total to count to
      title - The Title to be shown in the dialog
      doneString - The text to show when done.
  • Method Details

    • setDoneString

      public void setDoneString(String newDoneString)
      Sets the text that will be shown when the processing is over.
      Parameters:
      newDoneString - The text to be shown when the processing is over
    • progressIncrement

      public void progressIncrement()
      Adds 1 to the progress counter
      Specified by:
      progressIncrement in interface ProgressListener
    • progressIncrement

      public void progressIncrement(int n)
      Adds n to the progress counter
      Parameters:
      n - the amount to increment
    • decrementTotal

      public void decrementTotal()
      decreases the total by 1
    • setMaximum

      public void setMaximum(int max)
      set the maximum
      Parameters:
      max - maximum
    • switchToDoneMode

      public void switchToDoneMode()
      removes the Cancel Button and adds an OK button
    • getInterruptSemaphore

      public InterruptSemaphore getInterruptSemaphore()
      returns the interrupt semaphore object
      Returns:
      true if the thread should be interrupted