All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.trumphurst.controls.ProgressBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----com.trumphurst.controls.ProgressBar

public class ProgressBar
extends Canvas
A simple progress bar to indicate how long a lengthy task has run.


Constructor Index

 o ProgressBar(int)
Constructor (min = 0).
 o ProgressBar(int, int)
Constructor.

Method Index

 o getCurrent()
Return the current bar position.
 o getMaximum()
Return the maximum value.
 o getMinimum()
Return the minimum value.
 o getPreferredSize()
Standard preferred size routine.
 o paint(Graphics)
Standard paint routine.
 o setCurrent(int)
Move the bar position.
 o setMaximum(int)
Reset the maximum values (min = 0).
 o setMinimum(int)
Reset the minimum value.
 o update(Graphics)
Standard update routine.

Constructors

 o ProgressBar
 public ProgressBar(int min,
                    int max)
Constructor.

Parameters:
min - the minimum value expected.
max - the maximum value expected.
 o ProgressBar
 public ProgressBar(int max)
Constructor (min = 0).

Parameters:
max - the maximum value expected.

Methods

 o setCurrent
 public void setCurrent(int current)
Move the bar position.

Parameters:
current - (between min and max).
 o getCurrent
 public int getCurrent()
Return the current bar position.

 o setMinimum
 public void setMinimum(int min)
Reset the minimum value.

Parameters:
min - the minimum value.
 o getMinimum
 public int getMinimum()
Return the minimum value.

 o setMaximum
 public void setMaximum(int max)
Reset the maximum values (min = 0).

Parameters:
max - the maximum value.
 o getMaximum
 public int getMaximum()
Return the maximum value.

 o update
 public void update(Graphics g)
Standard update routine. We optimise to prevent background being cleared.

Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
Standard paint routine.

Overrides:
paint in class Canvas
 o getPreferredSize
 public Dimension getPreferredSize()
Standard preferred size routine. Actually returns the current size, or 100 x 10 if there isn't one.

Overrides:
getPreferredSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index