Package jhd.ProgressBars
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 voidadd(java.lang.String progBarTitle, int progressbarWidth, int progressbarHeight, int minBarValue, int maxBarValue)Adds a progress bar to the list, call show() to displayvoidclose()Closes the process monitor windowintgetMaximum(java.lang.String name)Gets the progress right(maximum) position
returns -1 if the named progress bar is not found.intgetMinimum(java.lang.String name)Gets the progress left(minimum) positionjava.util.ArrayList<javax.swing.JProgressBar>getProgBars()javax.swing.JProgressBar[]getProgBarsAsArray()intgetValue(java.lang.String name)Gets the progress indicator positionvoidsetBackground(java.awt.Color color)Sets the progress bar window colorvoidsetMaxBarValue(java.lang.String name, int value)Sets the progress indicator maximum(right) limit
Use when the number of iterations is determined at run time.voidsetMinBarValue(java.lang.String name, int value)Sets the progress indicator minimum(left) limit
Use when the number of iterations is determined at run time.voidsetValue(java.lang.String name, int value)Sets and updates the progress indicator position
Does nothing if the progress bars window is closed.voidshow()Shows the progress bars in a Windowintsize()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 titleprogressbarWidth- The progressBar widthprogressbarHeight- The progressBar heightminBarValue- The value at the progressBar's left edgemaxBarValue- 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 valuevalue- 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 valuevalue- 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 valuevalue- 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.
-