Class ProgressWindow

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

public class ProgressWindow extends JFrame
Window for showing progress of file processing. We may or may not have the total length available; if we do, we show the total length as part of the information. Normally we keep one window alive for the whole application, showing and hiding it as needed.
See Also:
  • Field Details

    • UNKNOWN

      public static final int UNKNOWN
      Progress state: Indeterminate or not yet started.
      See Also:
    • DOWNLOADING

      public static final int DOWNLOADING
      Progress state: URI is being downloaded.
      See Also:
    • PROCESSING

      public static final int PROCESSING
      Progress state: Processing the document.
      See Also:
  • Constructor Details

    • ProgressWindow

      public ProgressWindow(ActionListener canceler)
      Constructor.
      Parameters:
      canceler - An ActionListener which responds to the Cancel button.
  • Method Details

    • setContentLength

      public void setContentLength(long length, boolean update)
      Set the total length to be displayed. If this is set to a positive number, then the display will show "xxxx bytes of yyyy". If it is not set, or is set to a zero or negative number, the display will show "xxxx bytes".
      Parameters:
      length - The length to display
      update - If true, requests a display update.
    • setProgressState

      public void setProgressState(int state, boolean update)
      Set the progress state.
      Parameters:
      state - The state value to assign. Valid values are UNKNOWN, DOWNLOADING, and PROCESSING.
      update - If true, requests a display update
    • setDocName

      public void setDocName(String name, boolean update)
      Set the name of the document being displayed.
      Parameters:
      name - The file name or URL to display
      update - If true, requests a display update
    • setByteCount

      public void setByteCount(long count, boolean update)
      Update the byte count. Setting the count to a negative number blanks the byte count pane.
      Parameters:
      count - The new byte count value
      update - If true, requests a display update