All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class taxman.ProgressBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----taxman.ProgressBar

public class ProgressBar
extends Canvas
This is a special canvas that acts as a status bar. You can set the insets (space on all sides), update its value and set a max value for it.


Constructor Index

 o ProgressBar()
Simplest constructor.
 o ProgressBar(float, float)
Lets you supply the intitial value and maximum value.
 o ProgressBar(float, float, boolean)
Lets you supply the intitial value and maximum value.
 o ProgressBar(float, float, boolean, boolean)
Lets you supply the intitial value and maximum value.
 o ProgressBar(int, int)
Lets you supply the intitial value and maximum value.
 o ProgressBar(int, int, boolean)
Lets you supply the intitial value and maximum value.
 o ProgressBar(int, int, boolean, boolean)
Lets you supply the intitial value and maximum value.

Method Index

 o drawFromLeft(Graphics)
Draws the progress bar from left to right
 o drawValue(Graphics)
Draws the value of the progress bar (numerically)
 o getFloatValue()
Gets the current value of the progress bar as a float
 o getInsets()
Gets the current value of the spacing surrounding the progress bar
 o getIntValue()
Gets the current value of the progress bar as an int
 o getMaxFloatValue()
Gets the maximum value of the progress bar as a float
 o getMaxIntValue()
Gets the maximum value of the progress bar as an int
 o paint(Graphics)
Paints the progress bar
 o setInsets(Insets)
Sets the spacing around the status bar
 o setMaxValue(float)
Gets the current value of the progress bar as an int
 o setMaxValue(int)
Sets the maximum value for this progress bar
 o setValue(float)
Sets the value of the progress bar to some number < maximum value
 o setValue(int)
Sets the value of the progress bar to some number < maximum value

Constructors

 o ProgressBar
 public ProgressBar()
Simplest constructor. Uses all defaults Positive numbers, no numeric input, initial value = 0, max value = 1

 o ProgressBar
 public ProgressBar(float init_val,
                    float max_val)
Lets you supply the intitial value and maximum value. (floats)

Parameters:
init_val - The initial value of the progress bar
max_val - The maximum value of the progress bar
 o ProgressBar
 public ProgressBar(int init_val,
                    int max_val)
Lets you supply the intitial value and maximum value. (ints)

Parameters:
init_val - The initial value of the progress bar
max_val - The maximum value of the progress bar
 o ProgressBar
 public ProgressBar(float init_val,
                    float max_val,
                    boolean AddPercent)
Lets you supply the intitial value and maximum value. (floats)

Parameters:
init_val - The initial value of the progress bar
max_val - The maximum value of the progress bar
AddPercent - True if the progress bar should add a percent sign
 o ProgressBar
 public ProgressBar(int init_val,
                    int max_val,
                    boolean AddPercent)
Lets you supply the intitial value and maximum value. (ints)

Parameters:
init_val - The initial value of the progress bar
max_val - The maximum value of the progress bar
AddPercent - True if the progress bar should add a percent sign
 o ProgressBar
 public ProgressBar(float init_val,
                    float max_val,
                    boolean Negative,
                    boolean ShowNums)
Lets you supply the intitial value and maximum value. (floats) It also lets you specify whether or not to use a number value on the bar (i.e. %) and whether or not to allow negative values

Parameters:
init_val - The initial value of the progress bar
max_val - The maximum value of the progress bar
Negative - True if negative values are allowed (bar will be centered)
ShowNums - True if a number should be written into middle of bar.
 o ProgressBar
 public ProgressBar(int init_val,
                    int max_val,
                    boolean Negative,
                    boolean ShowNums)
Lets you supply the intitial value and maximum value. (ints) It also lets you specify whether or not to use a number value on the bar (i.e. %) and whether or not to allow negative values

Parameters:
init_val - The initial value of the progress bar
max_val - The maximum value of the progress bar
Negative - True if negative values are allowed (bar will be centered)
ShowNums - True if a number should be written into middle of bar.

Methods

 o setValue
 public void setValue(int NewValue)
Sets the value of the progress bar to some number < maximum value

Parameters:
NewValue - The new value for the progress bar
 o setValue
 public void setValue(float NewValue)
Sets the value of the progress bar to some number < maximum value

Parameters:
NewValue - The new value for the progress bar
 o getFloatValue
 public float getFloatValue()
Gets the current value of the progress bar as a float

Returns:
Returns a float version of the progress bar value
 o getIntValue
 public float getIntValue()
Gets the current value of the progress bar as an int

Returns:
Returns an int version of the progress bar value
 o setMaxValue
 public void setMaxValue(int max)
Sets the maximum value for this progress bar

Parameters:
max - The maximum value for this progress bar
 o setMaxValue
 public void setMaxValue(float max)
Gets the current value of the progress bar as an int

Returns:
Returns an int version of the progress bar value
 o getMaxFloatValue
 public float getMaxFloatValue()
Gets the maximum value of the progress bar as a float

Returns:
Returns a float version of the progress bar maximum value
 o getMaxIntValue
 public int getMaxIntValue()
Gets the maximum value of the progress bar as an int

Returns:
Returns an int version of the progress bar maximum value
 o setInsets
 public void setInsets(Insets NewInsets)
Sets the spacing around the status bar

Parameters:
NewInsets - An Insets object indicating the right, top, left bottom spacing around the status bar.
 o getInsets
 public Insets getInsets()
Gets the current value of the spacing surrounding the progress bar

Returns:
An Insets object indicating the right, top, left bottom spacing around the status bar.
 o paint
 public void paint(Graphics g)
Paints the progress bar

Parameters:
g - The graphics context on which to draw
Overrides:
paint in class Canvas
 o drawFromLeft
 public void drawFromLeft(Graphics g)
Draws the progress bar from left to right

Parameters:
g - The graphics context on which to draw
 o drawValue
 public void drawValue(Graphics g)
Draws the value of the progress bar (numerically)


All Packages  Class Hierarchy  This Package  Previous  Next  Index