All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.taligent.widget.ProgressBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----COM.taligent.widget.ProgressBar

public class ProgressBar
extends Canvas
implements Runnable, AdjustmentListener
A standard progress bar that supports multiple styles, colors, and orientations.


Variable Index

 o BLOCK
Progress indicated by series of solid blocks. Deprecated.
 o DEFAULT_BACKGROUND
Default background color (Color.lightGray).
 o DEFAULT_COLOR
Default color (Color.blue). Deprecated.
 o DEFAULT_DIRECTION
Default movement (RIGHT).
 o DEFAULT_FOREGROUND
Default foreground color (Color.blue).
 o DEFAULT_MAX
Default maximum value (100).
 o DEFAULT_MIN
Default minimum value (0).
 o DEFAULT_ORIENTATION
Default orientation (HORIZONTAL).
 o DEFAULT_STYLE
Default style (SOLID).
 o DOWN
Top to bottom movement. Deprecated.
 o HORIZONTAL
Horizontal orientation. Deprecated.
 o LEFT
Right to left movement. Deprecated.
 o RIGHT
Left to right movement. Deprecated.
 o SOLID
Progress indicated by solid bar of color. Deprecated.
 o STRIPED
Simple "in progress" indicated by continuous movement of stripes. Deprecated.
 o UP
Bottom to top movement. Deprecated.
 o VERTICAL
Vertical orientation. Deprecated.

Constructor Index

 o ProgressBar()
Constructs a standard horizontal, right moving, solid progress bar.
 o ProgressBar(int)
Constructs a progress bar with the given style and default min and max values.
 o ProgressBar(int, int)
Constructs a horizontal, right moving, solid progress bar with the min and max set to the specified values.

Method Index

 o add(int)
Adds a specific amount to the progress bar's value.
 o adjustmentValueChanged(AdjustmentEvent)
Value changed -- update progress bar.
 o getDelay()
Gets the current delay between movement of the STRIPED progress bar.
 o getDirection()
Returns the current direction of this progress bar.
 o getMax()
Returns the maximum value for this progress bar. Deprecated.
 o getMaximum()
Returns the maximum value for this progress bar.
 o getMin()
Returns the minimum value for this progress bar. Deprecated.
 o getMinimum()
Returns the minimum value for this progress bar.
 o getMinimumSize()
Returns the minimum size of this progress bar.
 o getName()
Returns this instance name.
 o getOrientation()
Returns the current orientation of this progress bar.
 o getPercent()
Returns true if the percent is showing.
 o getPreferredSize()
Returns the preferred size of this progress bar which is just minimum size.
 o getStyle()
Returns the current style of this progress bar.
 o getValue()
Returns the current value for this progress bar.
 o paint(Graphics)
Paints the progress bar in the current style.
 o reset()
Sets the progress bar's value to the minimum value.
 o run()
Handles the task of continuously drawing the STRIPED progress bar.
 o setBackground(Color)
Overrides setBackground so that the bar can be redrawn in the specified background color.
 o setDelay(int)
Sets the delay between movement of the STRIPED progress bar.
 o setDirection(int)
Sets the direction in which the progress bar progresses. Deprecated.
 o setDirection(ProgressBarDirection)
Sets the direction in which the progress bar progresses.
 o setForeground(Color)
Overrides setForeground so that the bar can be redrawn in the specified foreground color.
 o setMax(int)
Sets the maximum value this progress bar can have. Deprecated.
 o setMaximum(int)
Sets the maximum value this progress bar can have.
 o setMin(int)
Sets the minimum value this progress bar can have. Deprecated.
 o setMinimum(int)
Sets the minimum value this progress bar can have.
 o setName(String)
Sets the name of this instance.
 o setOrientation(int)
Sets the orientation of the progress bar. Deprecated.
 o setOrientation(ProgressBarOrientation)
Sets the orientation of the progress bar.
 o setPercent(boolean)
Shows the percent shown centered in the progress bar.
 o setStyle(int)
Sets the style of the progress bar. Deprecated.
 o setStyle(ProgressBarStyle)
Sets the style of the progress bar.
 o setValue(int)
Sets the value for this progress bar.
 o start()
Starts the progress bar moving.
 o stop()
Stops the progress bar moving.
 o toString()
Returns a string representation of this progress bar.
 o update(Graphics)
Overrides update so that the area is not cleared by default.

Variables

 o HORIZONTAL
 public static final int HORIZONTAL
Note: HORIZONTAL is deprecated. Use ProgressBarOrientation.HORIZONTAL

Horizontal orientation.

 o VERTICAL
 public static final int VERTICAL
Note: VERTICAL is deprecated. Use.ProgressBarOrientation.VERTICAL

Vertical orientation.

 o DEFAULT_ORIENTATION
 public static final ProgressBarOrientation DEFAULT_ORIENTATION
Default orientation (HORIZONTAL).

 o SOLID
 public static final int SOLID
Note: SOLID is deprecated. Use ProgressBarStyle.SOLID

Progress indicated by solid bar of color.

 o BLOCK
 public static final int BLOCK
Note: BLOCK is deprecated. Use ProgressBarStyle.BLOCK

Progress indicated by series of solid blocks.

 o STRIPED
 public static final int STRIPED
Note: STRIPED is deprecated. Use ProgressBarStyle.STRIPED

Simple "in progress" indicated by continuous movement of stripes.

 o DEFAULT_STYLE
 public static final ProgressBarStyle DEFAULT_STYLE
Default style (SOLID).

 o RIGHT
 public static final int RIGHT
Note: RIGHT is deprecated. Use ProgressBarDirection.RIGHT

Left to right movement. This only applies to HORIZONTAL bars.

 o LEFT
 public static final int LEFT
Note: LEFT is deprecated. Use ProgressBarDirection.LEFT

Right to left movement. This only applies to HORIZONTAL bars.

 o UP
 public static final int UP
Note: UP is deprecated. Use.ProgressbarDirection.UP

Bottom to top movement. This only applies to VERTICAL bars.

 o DOWN
 public static final int DOWN
Note: DOWN is deprecated. Use ProgressBarDirection.DOWN

Top to bottom movement. This only applies to VERTICAL bars.

 o DEFAULT_DIRECTION
 public static final ProgressBarDirection DEFAULT_DIRECTION
Default movement (RIGHT).

 o DEFAULT_COLOR
 public static final Color DEFAULT_COLOR
Note: DEFAULT_COLOR is deprecated. Use DEFAULT_FOREGROUND

Default color (Color.blue).

 o DEFAULT_FOREGROUND
 public static final Color DEFAULT_FOREGROUND
Default foreground color (Color.blue).

 o DEFAULT_BACKGROUND
 public static final Color DEFAULT_BACKGROUND
Default background color (Color.lightGray).

 o DEFAULT_MIN
 public static final int DEFAULT_MIN
Default minimum value (0).

 o DEFAULT_MAX
 public static final int DEFAULT_MAX
Default maximum value (100).

Constructors

 o ProgressBar
 public ProgressBar()
Constructs a standard horizontal, right moving, solid progress bar.

 o ProgressBar
 public ProgressBar(int style)
Constructs a progress bar with the given style and default min and max values.

Parameters:
style - The new style.
 o ProgressBar
 public ProgressBar(int min,
                    int max)
Constructs a horizontal, right moving, solid progress bar with the min and max set to the specified values.

Parameters:
min - The new minimum value.
max - The new maximum value.

Methods

 o run
 public void run()
Handles the task of continuously drawing the STRIPED progress bar.

 o setDelay
 public void setDelay(int delay)
Sets the delay between movement of the STRIPED progress bar.

Parameters:
delay - The new delay, in milliseconds.
 o getDelay
 public int getDelay()
Gets the current delay between movement of the STRIPED progress bar.

 o setBackground
 public void setBackground(Color color)
Overrides setBackground so that the bar can be redrawn in the specified background color.

Parameters:
color - The new background color.
Overrides:
setBackground in class Component
 o setForeground
 public void setForeground(Color color)
Overrides setForeground so that the bar can be redrawn in the specified foreground color.

Parameters:
color - The new foreground color.
Overrides:
setForeground in class Component
 o setOrientation
 public void setOrientation(int orientation)
Note: setOrientation() is deprecated. Use setOrientation(ProgressBarOrientation).

Sets the orientation of the progress bar.

 o setOrientation
 public void setOrientation(ProgressBarOrientation orientation)
Sets the orientation of the progress bar.

Parameters:
orientation - The new orientation.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getOrientation, HORIZONTAL, VERTICAL
 o getOrientation
 public ProgressBarOrientation getOrientation()
Returns the current orientation of this progress bar.

See Also:
setOrientation, HORIZONTAL, VERTICAL
 o setStyle
 public void setStyle(int style)
Note: setStyle() is deprecated. Use setStyle(ProgressBarStyle).

Sets the style of the progress bar.

 o setStyle
 public void setStyle(ProgressBarStyle style)
Sets the style of the progress bar.

Parameters:
style - The new style.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getStyle, SOLID, BLOCK, STRIPED
 o getStyle
 public ProgressBarStyle getStyle()
Returns the current style of this progress bar.

See Also:
setStyle, SOLID, BLOCK, STRIPED
 o setDirection
 public void setDirection(int direction)
Note: setDirection() is deprecated. Use setDirection(ProgressBarDirection).

Sets the direction in which the progress bar progresses.

 o setDirection
 public void setDirection(ProgressBarDirection direction)
Sets the direction in which the progress bar progresses. HORIZONTAL progress bars can move RIGHT or LEFT while VERTICAL bars can move UP or DOWN.

Parameters:
direction - The new direction.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getDirection, RIGHT, LEFT, UP, DOWN
 o getDirection
 public ProgressBarDirection getDirection()
Returns the current direction of this progress bar.

See Also:
setDirection, RIGHT, LEFT, UP, DOWN
 o setPercent
 public void setPercent(boolean show)
Shows the percent shown centered in the progress bar.

Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getPercent
 o getPercent
 public boolean getPercent()
Returns true if the percent is showing.

See Also:
setPercent
 o add
 public synchronized void add(int amount)
Adds a specific amount to the progress bar's value.

Parameters:
amount - The amount to add.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
setValue, getValue
 o setMin
 public void setMin(int min)
Note: setMin() is deprecated. Use setMinimum()

Sets the minimum value this progress bar can have.

 o setMinimum
 public void setMinimum(int min)
Sets the minimum value this progress bar can have.

Parameters:
min - The new minimum value.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getMinimum, setMaximum
 o getMin
 public int getMin()
Note: getMin() is deprecated. Use getMinimum()

Returns the minimum value for this progress bar.

 o getMinimum
 public int getMinimum()
Returns the minimum value for this progress bar.

See Also:
setMinimum
 o setMax
 public void setMax(int max)
Note: setMax() is deprecated. Use setMaximum()

Sets the maximum value this progress bar can have.

 o setMaximum
 public void setMaximum(int max)
Sets the maximum value this progress bar can have.

Parameters:
max - The new maximum value.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getMaximum, setMinimum
 o getMax
 public int getMax()
Note: getMax() is deprecated. Use getMaximum()

Returns the maximum value for this progress bar.

 o getMaximum
 public int getMaximum()
Returns the maximum value for this progress bar.

See Also:
setMaximum
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent evt)
Value changed -- update progress bar.

 o setValue
 public void setValue(int value)
Sets the value for this progress bar. The value cannot be set below the minimum value or higher than the maximum value.

Parameters:
value - The new value.
Returns:
Returns this so that multiple method calls can be chained together.
See Also:
getValue, add, reset
 o getValue
 public int getValue()
Returns the current value for this progress bar.

See Also:
setValue
 o reset
 public void reset()
Sets the progress bar's value to the minimum value.

Returns:
Returns this so that multiple method calls can be chained together.
See Also:
setValue, setMin, getMin
 o start
 public void start()
Starts the progress bar moving. This method only applies to the STRIPED style.

 o stop
 public void stop()
Stops the progress bar moving. This method only applies to the STRIPED style.

 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size of this progress bar which is just minimum size.

Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size of this progress bar.

Overrides:
getMinimumSize in class Component
 o update
 public void update(Graphics g)
Overrides update so that the area is not cleared by default.

Parameters:
g - The graphics context.
Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
Paints the progress bar in the current style. This method should not be called directly.

Parameters:
g - The graphics context.
Overrides:
paint in class Canvas
 o setName
 public void setName(String name)
Sets the name of this instance.

Parameters:
name - The new name.
Overrides:
setName in class Component
 o getName
 public String getName()
Returns this instance name.

Overrides:
getName in class Component
 o toString
 public String toString()
Returns a string representation of this progress bar.

Overrides:
toString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index