Class ProgressBars

java.lang.Object
jhd.ProgressBars.ProgressBars

public class ProgressBars
extends java.lang.Object
A class for creating and displaying multiple process bars in a Window
Author:
LazzyIzzi
  • Constructor Summary

    Constructors
    Constructor Description
    ProgressBars​(java.lang.String windowTitle)
    Creates a ProgressBars Object to contain multiple progress bars
  • Method Summary

    Modifier and Type Method Description
    void add​(java.lang.String progBarTitle, int progressbarWidth, int progressbarHeight, int minBarValue, int maxBarValue)
    Adds a progress bar to the list, call show() to display
    void close()
    Closes the process monitor window
    int getMaximum​(java.lang.String name)
    Gets the progress right(maximum) position
    returns -1 if the named progress bar is not found.
    int getMinimum​(java.lang.String name)
    Gets the progress left(minimum) position
    java.util.ArrayList<javax.swing.JProgressBar> getProgBars()  
    javax.swing.JProgressBar[] getProgBarsAsArray()  
    int getValue​(java.lang.String name)
    Gets the progress indicator position
    void setBackground​(java.awt.Color color)
    Sets the progress bar window color
    void setMaxBarValue​(java.lang.String name, int value)
    Sets the progress indicator maximum(right) limit
    Use when the number of iterations is determined at run time.
    void setMinBarValue​(java.lang.String name, int value)
    Sets the progress indicator minimum(left) limit
    Use when the number of iterations is determined at run time.
    void setValue​(java.lang.String name, int value)
    Sets and updates the progress indicator position
    Does nothing if the progress bars window is closed.
    void show()
    Shows the progress bars in a Window
    int size()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProgressBars

      public ProgressBars​(java.lang.String windowTitle)
      Creates a ProgressBars Object to contain multiple progress bars
      Parameters:
      windowTitle - The ProgressBars window title
  • Method Details

    • add

      public void add​(java.lang.String progBarTitle, int progressbarWidth, int progressbarHeight, int minBarValue, int maxBarValue)
      Adds a progress bar to the list, call show() to display
      Parameters:
      progBarTitle - The progressBar title
      progressbarWidth - The progressBar width
      progressbarHeight - The progressBar height
      minBarValue - The value at the progressBar's left edge
      maxBarValue - The value at the progressBar's right edge
    • getProgBars

      public java.util.ArrayList<javax.swing.JProgressBar> getProgBars()
      Returns:
      The ArrayList of progressBars created by the add() method
    • getProgBarsAsArray

      public javax.swing.JProgressBar[] getProgBarsAsArray()
      Returns:
      The progressBars created by the add() method as an array
    • setBackground

      public void setBackground​(java.awt.Color color)
      Sets the progress bar window color
      Parameters:
      color - the progress bar new window color
    • show

      public void show()
      Shows the progress bars in a Window
    • size

      public int size()
      Returns:
      The size of the Progress Bar
    • close

      public void close()
      Closes the process monitor window
    • setValue

      public void setValue​(java.lang.String name, int value)
      Sets and updates the progress indicator position
      Does nothing if the progress bars window is closed.
      Parameters:
      name - the name(title) of the progress bar to set to value
      value - the progress bar value between start and end
    • setMinBarValue

      public void setMinBarValue​(java.lang.String name, int value)
      Sets the progress indicator minimum(left) limit
      Use when the number of iterations is determined at run time.
      Parameters:
      name - the name(title) of the progress bar to set to value
      value - the progress bar maximum(right) limit
    • setMaxBarValue

      public void setMaxBarValue​(java.lang.String name, int value)
      Sets the progress indicator maximum(right) limit
      Use when the number of iterations is determined at run time.
      Parameters:
      name - the name(title) of the progress bar to set to value
      value - the progress bar maximum(right) limit
    • getValue

      public int getValue​(java.lang.String name)
      Gets the progress indicator position
      Parameters:
      name - the name(title) of the progress bar to set to value
      Returns:
      the progress indicator position, or -1 if the named progress bar is not found.
    • getMinimum

      public int getMinimum​(java.lang.String name)
      Gets the progress left(minimum) position
      Parameters:
      name - the name(title) of the progress bar to set to value
      Returns:
      the progress left(minimum) position or -1 if the named progress bar is not found.
    • getMaximum

      public int getMaximum​(java.lang.String name)
      Gets the progress right(maximum) position
      returns -1 if the named progress bar is not found.
      Parameters:
      name - the name(title) of the progress bar to set to value
      Returns:
      the progress right(maximum) position or -1 if the named progress bar is not found.