All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.util.ProgressBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----symantec.itools.awt.util.ProgressBar

public class ProgressBar
extends Canvas
implements BevelStyle, AlignStyle
ProgressBar component. Creates a bar that displays a percentage. Commonly used to indicate the percentage completed of a lengthy task.


Variable Index

 o INDENT_ONE
Border Indent constant INDENT_ONE.
 o INDENT_TWO
Border Indent constant INDENT_TWO.
 o INDENT_ZERO
Border Indent constant INDENT_ZERO.

Constructor Index

 o ProgressBar()
Constructs a progress bar with a centered progress %, no border and zero indentation.
 o ProgressBar(int, int, int)
Constructs a progress bar with the style and indentation variables specified.

Method Index

 o getAlignStyle()
Get the current style of the progress bar's alignment
 o getBevelStyle()
Get the current style of the progress bar's border
 o getBorderedColor()
Get the color for the border of BEVEL_LINE style ProgressBar.
 o getBorderIndent()
Get the border indent amount.
 o getBoxWidth()
Get the width of the boxes drawn for the progress bar.
 o getDrawBoxes()
Get the boolean that controls the drawing of the progress bar as a series of boxes.
 o getGapWidth()
Get the gap width of the boxes drawn for the progress bar.
 o getProgressBarColor()
Get the color that the progress bar will be drawing in.
 o getProgressBarTextColor()
Get the color of the percentage completed text in the progress bar.
 o getShowProgress()
Get the boolean that controls the display of the progress number as a percentage.
 o getValue()
Get the current percentage complete.
 o minimumSize()
Returns the minimum dimensions to properly display this component.
 o paint(Graphics)
Paints this component using the given graphics context.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o setAlignStyle(int)
Set the style of the progress bar's alignment.
 o setBevelStyle(int)
Set the style of the progress bar's border.
 o setBorderedColor(Color)
Set the color for the border of BEVEL_LINE style ProgressBar.
 o setBorderIndent(int)
Set the border indent amount.
 o setBoxWidth(int)
Set the width of the boxes drawn for the progress bar.
 o setDrawBoxes(boolean)
Set the boolean that controls the drawing of the progress bar as a series of boxes.
 o setGapWidth(int)
Set the gap width between boxes drawn for the progress bar.
 o setProgressBarColor(Color)
Set the color that the progress bar will be drawn in.
 o setProgressBarTextColor(Color)
Set the color of the percentage completed text in the progress bar.
 o setShowProgress(boolean)
Set the boolean that controls the display of the progress number as an percentage.
 o setValue(int)
Set the current percentage complete.
 o update(Graphics)
Handles redrawing of this component on the screen.
 o updateProgress(int)
Set the percentage complete for the process being tracked.

Variables

 o INDENT_ZERO
  public final static int INDENT_ZERO
Border Indent constant INDENT_ZERO.

 o INDENT_ONE
  public final static int INDENT_ONE
Border Indent constant INDENT_ONE.

 o INDENT_TWO
  public final static int INDENT_TWO
Border Indent constant INDENT_TWO.

Constructors

 o ProgressBar
  public ProgressBar()
Constructs a progress bar with a centered progress %, no border and zero indentation.

 o ProgressBar
  public ProgressBar(int align,
                     int bevel,
                     int indent)
Constructs a progress bar with the style and indentation variables specified. The default parameters are the bordered color and progress % color as black, the progress bar color as blue.

Parameters:
align - progress bar alignment style
bevel - progress bar bevel style
indent - border indent INDENT_ZERO, INDENT_ONE, or INDENT_TWO

Methods

 o setProgressBarColor
  public void setProgressBarColor(Color c)
Set the color that the progress bar will be drawn in.

Parameters:
color - the color that the progress bar will be drawn in.
See Also:
getProgressBarColor
 o getProgressBarColor
  public Color getProgressBarColor()
Get the color that the progress bar will be drawing in. The default color is blue.

Returns:
Color that the Progress Bar will be drawn in.
See Also:
setProgressBarColor
 o setProgressBarTextColor
  public void setProgressBarTextColor(Color c)
Set the color of the percentage completed text in the progress bar.

Parameters:
c - the color that the progress bar text will be drawn in.
See Also:
getProgressBarTextColor
 o getProgressBarTextColor
  public Color getProgressBarTextColor()
Get the color of the percentage completed text in the progress bar. The default color is black.

Returns:
Color that the progress bar text will be drawn in.
See Also:
setProgressBarTextColor
 o getDrawBoxes
  public boolean getDrawBoxes()
Get the boolean that controls the drawing of the progress bar as a series of boxes. The default value is false.

Returns:
boolean indicating if the bar should be composed of multiple boxes.
See Also:
setDrawBoxes
 o setDrawBoxes
  public void setDrawBoxes(boolean b)
Set the boolean that controls the drawing of the progress bar as a series of boxes.

Parameters:
b - indicating if the bar should be composed of multiple boxes.
See Also:
getDrawBoxes
 o setBoxWidth
  public void setBoxWidth(int i)
Set the width of the boxes drawn for the progress bar.

Parameters:
i - the pixel width of the boxes in the progress bar.
See Also:
getBoxWidth
 o getBoxWidth
  public int getBoxWidth()
Get the width of the boxes drawn for the progress bar. The default value is 8 pixels.

Returns:
int the pixel width of the boxes in the progress bar.
See Also:
setBoxWidth
 o setGapWidth
  public void setGapWidth(int i)
Set the gap width between boxes drawn for the progress bar.

Parameters:
i - the pixel width of the boxes in the progress bar.
See Also:
getBoxWidth, getGapWidth
 o getGapWidth
  public int getGapWidth()
Get the gap width of the boxes drawn for the progress bar. The default value is 2 pixels.

Returns:
i the pixel width of the gap between boxes in the progress bar.
See Also:
setBoxWidth, setGapWidth
 o getShowProgress
  public boolean getShowProgress()
Get the boolean that controls the display of the progress number as a percentage. The default value is true

Returns:
boolean indicating if the number should be displayed.
See Also:
setShowProgress
 o setShowProgress
  public void setShowProgress(boolean b)
Set the boolean that controls the display of the progress number as an percentage.

Parameters:
b - indicating if the progress percentage should be displayed.
See Also:
getShowProgress
 o setAlignStyle
  public void setAlignStyle(int style)
Set the style of the progress bar's alignment.

Parameters:
style - numeric value indicating the progress bar's alignment
See Also:
getAlignStyle
 o getAlignStyle
  public int getAlignStyle()
Get the current style of the progress bar's alignment

Returns:
int the style numeric value indicating progress bar's alignment
See Also:
setAlignStyle
 o setBevelStyle
  public void setBevelStyle(int style)
Set the style of the progress bar's border.

Parameters:
style - numeric value indicating the progress bar's style
See Also:
getBevelStyle
 o getBevelStyle
  public int getBevelStyle()
Get the current style of the progress bar's border

Returns:
int the style numeric value indicating progress bar's border, such as BEVEL_LOWERED
See Also:
setBevelStyle
 o setBorderIndent
  public void setBorderIndent(int indent)
Set the border indent amount.

Parameters:
indent - INDENT_ZERO, INDENT_ONE or INDENT_TWO
See Also:
getBorderIndent
 o getBorderIndent
  public int getBorderIndent()
Get the border indent amount. The default value is INDENT_ZERO.

Returns:
int INDENT_ZERO, INDENT_ONE or INDENT_TWO
See Also:
setBorderIndent
 o setBorderedColor
  public void setBorderedColor(Color color)
Set the color for the border of BEVEL_LINE style ProgressBar. This will not be used for other styles.

Parameters:
color - color that the border will be drawn in.
See Also:
getBorderedColor
 o getBorderedColor
  public Color getBorderedColor()
Get the color for the border of BEVEL_LINE style ProgressBar. This will not be used for other styles.

Returns:
Color that the border will be drawn in.
See Also:
setBorderedColor
 o updateProgress
  public void updateProgress(int p)
Set the percentage complete for the process being tracked.

Parameters:
p - percentage complete as an integer
 o setValue
  public void setValue(int p)
Set the current percentage complete.

Parameters:
p - percentage complete
See Also:
getValue
 o getValue
  public int getValue()
Get the current percentage complete.

Returns:
int - current percentage complete
See Also:
setValue
 o update
  public void update(Graphics g)
Handles redrawing of this component on the screen. This is a standard Java AWT method which gets called by the Java AWT (repaint()) to handle repainting this component on the screen. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner. Typically this method paints the background color to clear the component's drawing space, sets graphics context to be the foreground color, and then calls paint() to draw the component. It is overridden here to reduce flicker by eliminating the uneeded clearing of the background.

Parameters:
g - the graphics context
Overrides:
update in class Component
See Also:
repaint, paint
 o paint
  public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Canvas
See Also:
repaint, update
 o preferredSize
  public Dimension preferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Overrides:
preferredSize in class Component
See Also:
minimumSize
 o minimumSize
  public Dimension minimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component.

Overrides:
minimumSize in class Component
See Also:
preferredSize

All Packages  Class Hierarchy  This Package  Previous  Next  Index