charvax.swing

Class JProgressBar


public class JProgressBar
extends JComponent

A component that displays an integer value within a bounded interval. A progress bar is typically used to indicate the progress of some task by displaying a percentage of completion and possibly a textual display of this percentage.

Field Summary

protected boolean
_indeterminate
protected Thread
_indeterminateThread
protected int
_maximum
protected int
_minimum
protected String
_string
protected boolean
_stringPainted
protected int
_value
protected int
_width
The length of this component on the screen.

Fields inherited from class charvax.swing.JComponent

_border

Fields inherited from class charva.awt.Component

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT, _alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible

Constructor Summary

JProgressBar()
Creates a horizontal progress bar that displays a border but no progress string.
JProgressBar(int min_, int max_)
Creates a progress bar with the specified minimum and maximum values.

Method Summary

void
debug(int level_)
void
draw()
void
finalize()
int
getHeight()
int
getMaximum()
int
getMinimum()
Dimension
getSize()
Get the screen size of the progress bar.
String
getString()
Returns the value of the progress string
int
getValue()
int
getWidth()
boolean
isFocusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
boolean
isIndeterminate()
boolean
isStringPainted()
Returns the value of the _stringPainted property
Dimension
minimumSize()
void
processKeyEvent(KeyEvent ke_)
The JProgressBar class ignores key events.
void
requestFocus()
The JProgressBar component never gets the keyboard input focus.
void
setIndeterminate(boolean newval)
void
setMaximum(int max_)
Set the progress bar's maximum value.
void
setMinimum(int min_)
Set the progress bar's minimum value.
void
setSize(Dimension size_)
Set the size of the component on the screen.
void
setString(String string_)
Sets the value of the progress string
void
setStringPainted(boolean stringPainted_)
Set the value of the _stringPainted property
void
setValue(int value_)
Set the progress bar's value.

Methods inherited from class charvax.swing.JComponent

draw, getBorder, getInsets, setBorder

Methods inherited from class charva.awt.Component

addFocusListener, addKeyListener, contains, contains, debug, draw, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getHeight, getLocation, getLocationOnScreen, getName, getParent, getSize, getWidth, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, minimumSize, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, repaint, requestFocus, requestSync, setBackground, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor

Field Details

_indeterminate

protected boolean _indeterminate

_indeterminateThread

protected Thread _indeterminateThread

_maximum

protected int _maximum

_minimum

protected int _minimum

_string

protected String _string

_stringPainted

protected boolean _stringPainted

_value

protected int _value

_width

protected int _width
The length of this component on the screen.

Constructor Details

JProgressBar

public JProgressBar()
Creates a horizontal progress bar that displays a border but no progress string.

JProgressBar

public JProgressBar(int min_,
                    int max_)
Creates a progress bar with the specified minimum and maximum values.

Method Details

debug

public void debug(int level_)
Overrides:
debug in interface Component

draw

public void draw()
Overrides:
draw in interface JComponent

finalize

public void finalize()

getHeight

public int getHeight()
Overrides:
getHeight in interface Component

getMaximum

public int getMaximum()

getMinimum

public int getMinimum()

getSize

public Dimension getSize()
Get the screen size of the progress bar.
Overrides:
getSize in interface Component

getString

public String getString()
Returns the value of the progress string

getValue

public int getValue()

getWidth

public int getWidth()
Overrides:
getWidth in interface Component

isFocusTraversable

public boolean isFocusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
Overrides:
isFocusTraversable in interface Component

isIndeterminate

public boolean isIndeterminate()

isStringPainted

public boolean isStringPainted()
Returns the value of the _stringPainted property

minimumSize

public Dimension minimumSize()
Overrides:
minimumSize in interface Component

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
The JProgressBar class ignores key events. A JProgressBar should never have input focus anyway.
Overrides:
processKeyEvent in interface Component

requestFocus

public void requestFocus()
The JProgressBar component never gets the keyboard input focus.
Overrides:
requestFocus in interface Component

setIndeterminate

public void setIndeterminate(boolean newval)

setMaximum

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

setMinimum

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

setSize

public void setSize(Dimension size_)
Set the size of the component on the screen.

setString

public void setString(String string_)
Sets the value of the progress string

setStringPainted

public void setStringPainted(boolean stringPainted_)
Set the value of the _stringPainted property

setValue

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