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.
-
INDENT_ONE
- Border Indent constant INDENT_ONE.
-
INDENT_TWO
- Border Indent constant INDENT_TWO.
-
INDENT_ZERO
- Border Indent constant INDENT_ZERO.
-
ProgressBar()
- Constructs a progress bar with a centered progress %, no border and zero indentation.
-
ProgressBar(int, int, int)
- Constructs a progress bar with the style and indentation variables specified.
-
getAlignStyle()
- Get the current style of the progress bar's alignment
-
getBevelStyle()
- Get the current style of the progress bar's border
-
getBorderedColor()
- Get the color for the border of BEVEL_LINE style ProgressBar.
-
getBorderIndent()
- Get the border indent amount.
-
getBoxWidth()
- Get the width of the boxes drawn for the progress bar.
-
getDrawBoxes()
- Get the boolean that controls the drawing of the progress bar as a series of boxes.
-
getGapWidth()
- Get the gap width of the boxes drawn for the progress bar.
-
getProgressBarColor()
- Get the color that the progress bar will be drawing in.
-
getProgressBarTextColor()
- Get the color of the percentage completed text in the progress bar.
-
getShowProgress()
- Get the boolean that controls the display of the progress number as a percentage.
-
getValue()
- Get the current percentage complete.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
setAlignStyle(int)
- Set the style of the progress bar's alignment.
-
setBevelStyle(int)
- Set the style of the progress bar's border.
-
setBorderedColor(Color)
- Set the color for the border of BEVEL_LINE style ProgressBar.
-
setBorderIndent(int)
- Set the border indent amount.
-
setBoxWidth(int)
- Set the width of the boxes drawn for the progress bar.
-
setDrawBoxes(boolean)
- Set the boolean that controls the drawing of the progress bar as a series of boxes.
-
setGapWidth(int)
- Set the gap width between boxes drawn for the progress bar.
-
setProgressBarColor(Color)
- Set the color that the progress bar will be drawn in.
-
setProgressBarTextColor(Color)
- Set the color of the percentage completed text in the progress bar.
-
setShowProgress(boolean)
- Set the boolean that controls the display of the progress number as an percentage.
-
setValue(int)
- Set the current percentage complete.
-
update(Graphics)
- Handles redrawing of this component on the screen.
-
updateProgress(int)
- Set the percentage complete for the process being tracked.
INDENT_ZERO
public final static int INDENT_ZERO
- Border Indent constant INDENT_ZERO.
INDENT_ONE
public final static int INDENT_ONE
- Border Indent constant INDENT_ONE.
INDENT_TWO
public final static int INDENT_TWO
- Border Indent constant INDENT_TWO.
ProgressBar
public ProgressBar()
- Constructs a progress bar with a centered progress %, no border and zero indentation.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
setBorderIndent
public void setBorderIndent(int indent)
- Set the border indent amount.
- Parameters:
- indent - INDENT_ZERO, INDENT_ONE or INDENT_TWO
- See Also:
- getBorderIndent
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
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
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
updateProgress
public void updateProgress(int p)
- Set the percentage complete for the process being tracked.
- Parameters:
- p - percentage complete as an integer
setValue
public void setValue(int p)
- Set the current percentage complete.
- Parameters:
- p - percentage complete
- See Also:
- getValue
getValue
public int getValue()
- Get the current percentage complete.
- Returns:
- int - current percentage complete
- See Also:
- setValue
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
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
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
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