Class symantec.itools.awt.util.ProgressBar
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.util.ProgressBar
Object
|
+----Component
|
+----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.
- Version:
- 1.1, August 26, 1997
- Author:
- Symantec
-
INDENT_ONE
- Border Indent constant INDENT_ONE.
-
INDENT_TWO
- Border Indent constant INDENT_TWO.
-
INDENT_ZERO
- Border Indent constant INDENT_ZERO.
-
align
- The value of the Alignment Style property.
-
bDrawBoxes
- The value of the Draw Boxes property.
-
bShowProgress
- The value of the Show Progress property.
-
bevelDarkerColor
- The color to use as a hilight when BevelStyle is BEVEL_RAISED or BEVEL_LOWERED.
-
bevelLighterColor
- The color to use as a hilight when BevelStyle is BEVEL_RAISED or BEVEL_LOWERED.
-
borderColor
- The value of the Border Color property.
-
boxWidth
- The value of the Box Width property.
-
bufferImage
- The offscreen buffer to draw the button in.
-
cachedBackground
- Cached value of the background color.
-
gapWidth
- The value of the Gap Width property.
-
indent
- The value of the Border Indent property.
-
progress
- The value of the Progress Percent property.
-
progressColor
- The value of the Progress Bar Color property.
-
type
- The value of the Bevel Style property.
-
symantec.itools.awt.util.ProgressBar()
- Constructs a progress bar with a centered progress %, line border and zero indentation.
-
symantec.itools.awt.util.ProgressBar(int, int, int)
- Constructs a progress bar with the style and indentation variables specified.
-
addBoxWidthListener(PropertyChangeListener)
- Adds a listener for the BoxWidth property changes.
-
addBoxWidthListener(VetoableChangeListener)
- Adds a vetoable listener for the BoxWidth property changes.
-
addGapWidthListener(PropertyChangeListener)
- Adds a listener for the GapWidth property changes.
-
addGapWidthListener(VetoableChangeListener)
- Adds a vetoable listener for the GapWidth property changes.
-
addNotify()
- Tells this component that it has been added to a container.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
calculateHilightColors(Color)
- Used to calculate the hilight colors from the background color.
-
getAlignStyle()
- Get the current style of the progress bar's alignment
-
getBevelStyle()
- Get the current style of the progress bar's border
-
getBorderColor()
- Get the color for the border of BEVEL_LINE style ProgressBar.
-
getBorderIndent()
- Get the border indent amount.
-
getBorderedColor()
-
-
getBoxWidth()
- Get the width of the boxes drawn for the progress bar.
-
getDrawBoxes()
-
-
getGapWidth()
- Get the gap width of the boxes drawn for the progress bar.
-
getMinimumSize()
- Returns the minimum dimensions to properly display this component.
-
getPreferredSize()
- Returns the recommended dimensions to properly display this component.
-
getProgressBarColor()
- Get the color that the progress bar will be drawing in.
-
getProgressBarTextColor()
-
-
getProgressPercent()
- Get the current percentage complete.
-
getShowProgress()
-
-
getValue()
- Get the current percentage complete.
-
isBufferImageInvalid()
- Returns true if a buffer image has been set, but it is not the
size of this component.
-
isDrawBoxes()
- Get the boolean that controls the drawing of the progress bar as a series of boxes.
-
isShowProgress()
- Get the boolean that controls the display of the progress number as a percentage.
-
isValidBoxWidth(int)
- Is the given box width valid for this component.
-
isValidGapWidth(int)
- Is the given gap width valid for this component.
-
minimumSize()
-
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
-
-
removeBoxWidthListener(PropertyChangeListener)
- Removes a listener for the BoxWidth property changes.
-
removeBoxWidthListener(VetoableChangeListener)
- Removes a vetoable listener for the BoxWidth property changes.
-
removeGapWidthListener(PropertyChangeListener)
- Removes a listener for the GapWidth property changes.
-
removeGapWidthListener(VetoableChangeListener)
- Removes a vetoable listener for the GapWidth property changes.
-
removeNotify()
- Tells this component that it is being removed from a container.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
setAlignStyle(int)
- Set the style of the progress bar's alignment.
-
setBevelStyle(int)
- Set the style of the progress bar's border.
-
setBorderColor(Color)
- Set the color for the border of BEVEL_LINE style ProgressBar.
-
setBorderIndent(int)
- Set the border indent amount.
-
setBorderIndent(int, boolean)
- Set the border indent amount and optionally repaint.
-
setBorderedColor(Color)
-
-
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)
-
-
setProgressPercent(int)
- Set the percentage complete for the process being tracked.
-
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.
-
updateBufferImage()
- Maintains the bufferImage size and draws the
button in the bufferImage offscreen image.
-
updateProgress(int)
-
INDENT_ONE
public static final int INDENT_ONE
- Border Indent constant INDENT_ONE.
INDENT_TWO
public static final int INDENT_TWO
- Border Indent constant INDENT_TWO.
INDENT_ZERO
public static final int INDENT_ZERO
- Border Indent constant INDENT_ZERO.
align
protected int align
- The value of the Alignment Style property.
bDrawBoxes
protected boolean bDrawBoxes
- The value of the Draw Boxes property.
bShowProgress
protected boolean bShowProgress
- The value of the Show Progress property.
bevelDarkerColor
protected java.awt.Color bevelDarkerColor
- The color to use as a hilight when BevelStyle is BEVEL_RAISED or BEVEL_LOWERED.
bevelLighterColor
protected java.awt.Color bevelLighterColor
- The color to use as a hilight when BevelStyle is BEVEL_RAISED or BEVEL_LOWERED.
borderColor
protected java.awt.Color borderColor
- The value of the Border Color property.
boxWidth
protected int boxWidth
- The value of the Box Width property.
bufferImage
protected transient java.awt.Image bufferImage
- The offscreen buffer to draw the button in.
cachedBackground
protected java.awt.Color cachedBackground
- Cached value of the background color. Used to determine if calculated colors need to be updated.
gapWidth
protected int gapWidth
- The value of the Gap Width property.
indent
protected int indent
- The value of the Border Indent property.
progress
protected int progress
- The value of the Progress Percent property.
progressColor
protected java.awt.Color progressColor
- The value of the Progress Bar Color property.
type
protected int type
- The value of the Bevel Style property.
ProgressBar
public ProgressBar()
- Constructs a progress bar with a centered progress %, line 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 border 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
addBoxWidthListener
public synchronized void addBoxWidthListener(PropertyChangeListener listener)
- Adds a listener for the BoxWidth property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeBoxWidthListener(java.beans.PropertyChangeListener)
addBoxWidthListener
public synchronized void addBoxWidthListener(VetoableChangeListener listener)
- Adds a vetoable listener for the BoxWidth property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeBoxWidthListener(java.beans.VetoableChangeListener)
addGapWidthListener
public synchronized void addGapWidthListener(PropertyChangeListener listener)
- Adds a listener for the GapWidth property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeGapWidthListener(java.beans.PropertyChangeListener)
addGapWidthListener
public synchronized void addGapWidthListener(VetoableChangeListener listener)
- Adds a vetoable listener for the GapWidth property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeGapWidthListener(java.beans.VetoableChangeListener)
addNotify
public synchronized void addNotify()
- Tells this component that it has been added to a container.
This is a standard Java AWT method which gets called by the AWT when
this component is added to a container. Typically, it is used to
create this component's peer.
It has been overridden here to hook-up event listeners.
- Overrides:
- addNotify in class Canvas
- See Also:
- removeNotify
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to add.
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to add.
- See Also:
- removeVetoableChangeListener
calculateHilightColors
protected void calculateHilightColors(Color c)
- Used to calculate the hilight colors from the background color.
- See Also:
- paint
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
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
getBorderColor
public java.awt.Color getBorderColor()
- 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:
- setBorderColor
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
getBorderedColor
public java.awt.Color getBorderedColor()
- Note: getBorderedColor() is deprecated.
-
- See Also:
- getBorderColor
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
getDrawBoxes
public boolean getDrawBoxes()
- Note: getDrawBoxes() is deprecated.
-
- See Also:
- isDrawBoxes()
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
getMinimumSize
public java.awt.Dimension getMinimumSize()
- 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:
- getMinimumSize in class Component
- See Also:
- getPreferredSize
getPreferredSize
public java.awt.Dimension getPreferredSize()
- 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:
- getPreferredSize in class Component
- See Also:
- getMinimumSize
getProgressBarColor
public java.awt.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
getProgressBarTextColor
public java.awt.Color getProgressBarTextColor()
- Note: getProgressBarTextColor() is deprecated.
-
- See Also:
- getForeground()
getProgressPercent
public int getProgressPercent()
- Get the current percentage complete.
- Returns:
- int - current percentage complete
- See Also:
- setProgressPercent
getShowProgress
public boolean getShowProgress()
- Note: getShowProgress() is deprecated.
-
- See Also:
- isShowProgress
getValue
public int getValue()
- Get the current percentage complete.
- Returns:
- int - current percentage complete
- See Also:
- setValue
isBufferImageInvalid
protected boolean isBufferImageInvalid()
- Returns true if a buffer image has been set, but it is not the
size of this component.
isDrawBoxes
public boolean isDrawBoxes()
- 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
isShowProgress
public boolean isShowProgress()
- 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
isValidBoxWidth
protected boolean isValidBoxWidth(int i)
- Is the given box width valid for this component.
- Parameters:
- i - the given box width
- Returns:
- true if the given box width is acceptable, false if not.
isValidGapWidth
protected boolean isValidGapWidth(int i)
- Is the given gap width valid for this component.
- Parameters:
- i - the given gap width
- Returns:
- true if the given gap width is acceptable, false if not.
minimumSize
public java.awt.Dimension minimumSize()
- Note: minimumSize() is deprecated.
-
- Overrides:
- minimumSize in class Component
- See Also:
- getMinimumSize
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 java.awt.Dimension preferredSize()
- Note: preferredSize() is deprecated.
-
- Overrides:
- preferredSize in class Component
- See Also:
- getPreferredSize
removeBoxWidthListener
public synchronized void removeBoxWidthListener(PropertyChangeListener listener)
- Removes a listener for the BoxWidth property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addBoxWidthListener(java.beans.PropertyChangeListener)
removeBoxWidthListener
public synchronized void removeBoxWidthListener(VetoableChangeListener listener)
- Removes a vetoable listener for the BoxWidth property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addBoxWidthListener(java.beans.VetoableChangeListener)
removeGapWidthListener
public synchronized void removeGapWidthListener(PropertyChangeListener listener)
- Removes a listener for the GapWidth property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addGapWidthListener(java.beans.PropertyChangeListener)
removeGapWidthListener
public synchronized void removeGapWidthListener(VetoableChangeListener listener)
- Removes a vetoable listener for the GapWidth property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addGapWidthListener(java.beans.VetoableChangeListener)
removeNotify
public synchronized void removeNotify()
- Tells this component that it is being removed from a container.
This is a standard Java AWT method which gets called by the AWT when
this component is removed from a container. Typically, it is used to
destroy the peers of this component and all its subcomponents.
It has been overridden here to unhook event listeners.
- Overrides:
- removeNotify in class Component
- See Also:
- addNotify
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to remove.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to remove.
- See Also:
- addVetoableChangeListener
setAlignStyle
public void setAlignStyle(int style) throws PropertyVetoException
- Set the style of the progress bar's alignment.
- Parameters:
- style - numeric value indicating the progress bar's alignment
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getAlignStyle
setBevelStyle
public void setBevelStyle(int style) throws PropertyVetoException
- Set the style of the progress bar's border.
- Parameters:
- style - numeric value indicating the progress bar's style
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBevelStyle
setBorderColor
public void setBorderColor(Color color) throws PropertyVetoException
- 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.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBorderColor
setBorderIndent
public void setBorderIndent(int indent) throws PropertyVetoException
- Set the border indent amount.
- Parameters:
- indent - INDENT_ZERO, INDENT_ONE or INDENT_TWO
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBorderIndent, setBorderIndent(int, boolean)
setBorderIndent
protected void setBorderIndent(int indent,
boolean bRepaint) throws PropertyVetoException
- Set the border indent amount and optionally repaint.
- Parameters:
- indent - INDENT_ZERO, INDENT_ONE or INDENT_TWO
- bRepaint - if true, causes a repaint to occur.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBorderIndent, setBorderIndent(int)
setBorderedColor
public void setBorderedColor(Color color) throws PropertyVetoException
- Note: setBorderedColor() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setBorderColor
setBoxWidth
public void setBoxWidth(int i) throws PropertyVetoException
- Set the width of the boxes drawn for the progress bar.
- Parameters:
- i - the pixel width of the boxes in the progress bar.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBoxWidth
setDrawBoxes
public void setDrawBoxes(boolean b) throws PropertyVetoException
- 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.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getDrawBoxes
setGapWidth
public void setGapWidth(int i) throws PropertyVetoException
- Set the gap width between boxes drawn for the progress bar.
- Parameters:
- i - the pixel width of the boxes in the progress bar.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBoxWidth, getGapWidth
setProgressBarColor
public void setProgressBarColor(Color c) throws PropertyVetoException
- Set the color that the progress bar will be drawn in.
- Parameters:
- color - the color that the progress bar will be drawn in.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getProgressBarColor
setProgressBarTextColor
public void setProgressBarTextColor(Color c) throws PropertyVetoException
- Note: setProgressBarTextColor() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setForeground
setProgressPercent
public void setProgressPercent(int p) throws PropertyVetoException
- Set the percentage complete for the process being tracked.
- Parameters:
- p - percentage complete as an integer
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setShowProgress
public void setShowProgress(boolean b) throws PropertyVetoException
- Set the boolean that controls the display of the progress number as an percentage.
- Parameters:
- b - indicating if the progress percentage should be displayed.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getShowProgress
setValue
public void setValue(int p) throws PropertyVetoException
- Set the current percentage complete.
- Parameters:
- p - percentage complete
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getValue
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
updateBufferImage
protected void updateBufferImage()
- Maintains the bufferImage size and draws the
button in the bufferImage offscreen image.
- See Also:
- paint
updateProgress
public void updateProgress(int p) throws PropertyVetoException
- Note: updateProgress() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setProgressPercent
All Packages Class Hierarchy This Package Previous Next Index