|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.component.progressindicator.ProgressBarField
public class ProgressBarField
Represents the progress of a task that can be expressed with respect to a set of values. The progress is rendered as a horizontal bar that fills as the value approaches a predefined maximum value. This field takes a minimum value, a maximum value, and an initial value for the progress. The bar is filled as a representation of the percentage of the work accomplished.
The following styles are available to specify how the progress is displayed:
ProgressBarField.NO_TEXT
to not present
text to represent the amount of work done
ProgressBarField.PERCENT
to
represent the amount of work done as a percentage
ProgressBarField.CURRENT_WITH_MAX
to show the current value and the maximum value
NO_TEXT
overrides both of the other styles.
PERCENT
overrides CURRENT_WITH_MAX
.
The default is to simply display the current value.
You can control the alignment of the text with the following styles:
ProgressBarField.PROGRESS_TEXT_HCENTER
, which horizontally centers the text
(the default behavior)
ProgressBarField.PROGRESS_TEXT_LEADING
, which
left aligns the text over the progress bar
ProgressBarField.PROGRESS_TEXT_TRAILING
,
which right aligns the text over the progress bar
Field Summary | ||
---|---|---|
static int |
CURRENT_WITH_MAX
Display progress as current / max . |
|
static int |
NO_TEXT
Do not display progress value with text. |
|
static int |
PERCENT
Display progress as a percentage. |
|
static int |
PROGRESS_TEXT_HCENTER
Center the progress text on the field. |
|
static int |
PROGRESS_TEXT_LEADING
Align the progress text to the left of the field. |
|
static int |
PROGRESS_TEXT_TRAILING
Align the progress text to the right of the field. |
Constructor Summary | ||
---|---|---|
ProgressBarField(int min,
int max,
int initial,
long style)
Constructs a new ProgressBarField instance. |
Method Summary | ||
---|---|---|
void |
changeConfiguration(int min,
int max,
int current)
Changes the current configuration of this field. |
|
protected void |
drawFocus(Graphics graphics,
boolean on)
Draws the focus indicator for this field. |
|
protected void |
layout(int width,
int height)
Lays out this field's contents. |
|
protected void |
paint(Graphics graphics)
Redraws this field. |
|
void |
updateValue(int val)
Updates the current value of this field. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PROGRESS_TEXT_HCENTER
DrawStyle.HCENTER
.
This is the default alignment.
public static final int PROGRESS_TEXT_LEADING
DrawStyle.LEFT
.
By default, the progress text is centered in the field.
public static final int PROGRESS_TEXT_TRAILING
DrawStyle.RIGHT
.
By default, the progress text is centered in the field.
public static final int NO_TEXT
By default, the current value is displayed as text.
public static final int PERCENT
By default, the current value is displayed as text.
public static final int CURRENT_WITH_MAX
current
/ max
.
Constructor Detail |
---|
public ProgressBarField(int min, int max, int initial, long style)
ProgressBarField
instance.
min
- The minimum value for the progress.max
- The maximum value for the progress.initial
- The initial value for the progress.style
- The style bits to set for this field. You can use inherited styles, as
well as styles defined for this field:
ProgressBarField.NO_TEXT
, ProgressBarField.PERCENT
,
ProgressBarField.CURRENT_WITH_MAX
, ProgressBarField.PROGRESS_TEXT_HCENTER
,
ProgressBarField.PROGRESS_TEXT_LEADING
, and ProgressBarField.PROGRESS_TEXT_TRAILING
.Method Detail |
---|
public void changeConfiguration(int min, int max, int current)
min
- The new minimum value for the progress.max
- The new maximum value for the progress.current
- The new current value for the progress.protected void drawFocus(Graphics graphics, boolean on)
drawFocus
in class Field
graphics
- Graphics
context for drawing the focus.on
- true
if the focus should be set, otherwise, false
.protected void layout(int width, int height)
layout
in class Field
width
- Amount of available horizontal space.height
- Amount of available vertical space.protected void paint(Graphics graphics)
paint
in class Field
graphics
- Graphics
context for drawing in this field.public void updateValue(int val)
val
- The new value for this field.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.