buoy.widget

Class BProgressBar


public class BProgressBar
extends Widget

BProgressBar is a Widget that displays the status of some operation. It is a horizontal or vertical bar that gradually fills up to indicate what fraction of the operation is complete. It optionally can also display a line of text describing the current state of the operation.

You can specify minimum and maximum progress values for the bar, to reflect the number of steps in the operation being monitored. When the current progress value is equal to the minimum value, the bar is shown completely empty. When it is equal to the maximum value, the bar is shown completely full.

If you do not know how long an operation will take, the progress bar can be put into an "indeterminate" state. This causes the entire bar to animate continuously to show that work is being done.

Author:
Peter Eastman

Nested Class Summary

static class
BProgressBar.Orientation
This inner class represents an orientation (horizontal or vertical) for the split.

Field Summary

static BProgressBar.Orientation
HORIZONTAL
static BProgressBar.Orientation
VERTICAL

Constructor Summary

BProgressBar()
Create a horizontal BProgressBar which does not display text.
BProgressBar(BProgressBar.Orientation orient, int min, int max)
Create a new BProgressBar.
BProgressBar(int min, int max)
Create a horizontal BProgressBar which does not display text.

Method Summary

JProgressBar
getComponent()
int
getMaximum()
Get the progress bar's maximum progress value.
int
getMinimum()
Get the progress bar's minimum progress value.
BProgressBar.Orientation
getOrientation()
Get the progress bar's orientation, HORIZONTAL or VERTICAL.
String
getProgressText()
Get the line of text displayed on the progress bar.
boolean
getShowProgressText()
Get whether the progress bar displays a line of text describing the operation whose progress is being monitored.
int
getValue()
Get the progress bar's current progress value.
boolean
isIndeterminate()
Get whether this progress bar is in indeterminate mode.
void
setIndeterminate(boolean indeterminate)
Set whether this progress bar is in indeterminate mode.
void
setMaximum(int max)
Set the progress bar's maximum progress value.
void
setMinimum(int min)
Set the progress bar's minimum progress value.
void
setOrientation(BProgressBar.Orientation orient)
Set the progress bar's orientation, HORIZONTAL or VERTICAL.
void
setProgressText(String text)
Set the line of text displayed on the progress bar.
void
setShowProgressText(boolean show)
Set whether the progress bar displays a line of text describing the operation whose progress is being monitored.
void
setValue(int value)
Set the progress bar's current progress value.

Methods inherited from class buoy.widget.Widget

addEventLink, dispatchEvent, getBackground, getBounds, getComponent, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible

Methods inherited from class buoy.event.EventSource

addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink

Field Details

HORIZONTAL

public static final BProgressBar.Orientation HORIZONTAL

VERTICAL

public static final BProgressBar.Orientation VERTICAL

Constructor Details

BProgressBar

public BProgressBar()
Create a horizontal BProgressBar which does not display text. The minimum and maximum progress values are 0 and 100, respectively.

BProgressBar

public BProgressBar(BProgressBar.Orientation orient,
                    int min,
                    int max)
Create a new BProgressBar. The initial progress value is set to min.
Parameters:
orient - the progress bar orientation (HORIZONTAL or VERTICAL)
min - the minimum value on the progress bar
max - the maximum value on the progress bar

BProgressBar

public BProgressBar(int min,
                    int max)
Create a horizontal BProgressBar which does not display text. The initial progress value is set to min.
Parameters:
min - the minimum value on the progress bar
max - the maximum value on the progress bar

Method Details

getComponent

public JProgressBar getComponent()
Overrides:
getComponent in interface Widget

getMaximum

public int getMaximum()
Get the progress bar's maximum progress value.

getMinimum

public int getMinimum()
Get the progress bar's minimum progress value.

getOrientation

public BProgressBar.Orientation getOrientation()
Get the progress bar's orientation, HORIZONTAL or VERTICAL.

getProgressText

public String getProgressText()
Get the line of text displayed on the progress bar. This text is only shown if setShowProgessText(true) has been called.

getShowProgressText

public boolean getShowProgressText()
Get whether the progress bar displays a line of text describing the operation whose progress is being monitored.

getValue

public int getValue()
Get the progress bar's current progress value.

isIndeterminate

public boolean isIndeterminate()
Get whether this progress bar is in indeterminate mode. In indeterminate mode, the entire progress bar animates continuously to show that work is being done, but no indication is given of how much remains.

setIndeterminate

public void setIndeterminate(boolean indeterminate)
Set whether this progress bar is in indeterminate mode. In indeterminate mode, the entire progress bar animates continuously to show that work is being done, but no indication is given of how much remains.

setMaximum

public void setMaximum(int max)
Set the progress bar's maximum progress value.

setMinimum

public void setMinimum(int min)
Set the progress bar's minimum progress value.

setOrientation

public void setOrientation(BProgressBar.Orientation orient)
Set the progress bar's orientation, HORIZONTAL or VERTICAL.

setProgressText

public void setProgressText(String text)
Set the line of text displayed on the progress bar. This text is only shown if setShowProgessText(true) has been called.

setShowProgressText

public void setShowProgressText(boolean show)
Set whether the progress bar displays a line of text describing the operation whose progress is being monitored.

setValue

public void setValue(int value)
Set the progress bar's current progress value.

Written by Peter Eastman.