|
|||||||||
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.ScrollView
net.rim.device.api.ui.Manager
net.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorView
net.rim.device.api.ui.component.progressindicator.ProgressIndicatorView
public class ProgressIndicatorView
Implementation of AbstractProgressIndicatorView
that is used for
representing progress where there is a numeric representation for the work being done.
The progress is represented by a bar that fills as the amount of work done
approaches the maximum. This bar reflects the current percentage of the
amount of work that is done. The actual value can also be represented through
using style bits when creating the
ProgressBarField
by using ProgressIndicatorView.createProgressBar(long)
.
The following styles are available:
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 both the current value and the maximum value
NO_TEXT
overrides both 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
Both a model (ProgressIndicatorModel
) and a controller (ProgressIndicatorController
)
are available and represent implementations of AbstractProgressIndicatorModel
and AbstractProgressIndicatorController
respectively. These represent progress where the work being accomplished has a
measureable value that can be represented using the model. If the associated controller does
not consume an input event, this view then allows the delegate to process the input.
Field Summary |
---|
Fields inherited from class net.rim.device.api.ui.Manager |
---|
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, HORIZONTAL_SCROLL_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK, VERTICAL_SCROLL_MASK |
Constructor Summary | ||
---|---|---|
ProgressIndicatorView(long style)
Constructs a new ProgressIndicatorView . |
||
ProgressIndicatorView(long style,
Manager delegate)
Constructs a new ProgressIndicatorView . |
Method Summary | ||
---|---|---|
void |
configurationChanged(Adjustment source)
Called when one of the Adjustment fields have been changed (other than the value field). |
|
void |
createProgressBar(long style)
Creates a ProgressBarField and
associates it with this view. |
|
ProgressBarField |
getProgressBar()
Returns the field responsible for rendering the progress. |
|
void |
reset()
The data model has been reset to its initial state. |
|
void |
setNonProgrammaticValue(int value)
Invoked when the value in the data model has changed through non-programmatic means. |
|
void |
valueChanged(Adjustment source)
Invoked when the value field is changed. |
Methods inherited from class net.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorView |
---|
add, addAll, cancelled, createLabel, createLabel, delete, deleteAll, deleteRange, getController, getDelegate, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getLabel, getLabelField, getModel, insert, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, navigationClick, navigationMovement, nextFocus, replace, resumed, setController, setLabel, setModel, sublayout, touchEvent |
Methods inherited from class net.rim.device.api.ui.ScrollView |
---|
getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onUndisplay, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, waitForScrolling |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProgressIndicatorView(long style)
ProgressIndicatorView
. The delegate
defaults to a VerticalFieldManager
.
style
- The style bits to set for this view.public ProgressIndicatorView(long style, Manager delegate)
ProgressIndicatorView
. Requires a delegate
to be specified. If null
is provided, the delegate defaults to
a VerticalFieldManager
.
style
- The style bits to set for this view.delegate
- The Manager
to use as a delegate for layout and focus.Method Detail |
---|
public void createProgressBar(long style)
ProgressBarField
and
associates it with this view. If a field is already associated with this view,
this method replaces the association for updating through the model,
but does not explicitly remove it from the view's delegate.
If there is no associated model or if the model is not a
ProgressIndicatorModel
or a subclass, the
ProgressBarField
will default to a minimum of 0, a maximum of 100,
and an initial value of 50, with the default style.
style
- The style bits to set for this field, including the
custom style bits for ProgressBarField
.
IllegalArgumentException
- if the
ProgressIndicatorModel
that is associated with this view
was created using the default constructor, because the
initial
, max
, and min
values for
the ProgressIndicatorModel
are set to zero.public void configurationChanged(Adjustment source)
Adjustment
fields have been changed (other than the value field).
The new configuration of the Adjustment
is reflected within the view.
configurationChanged
in interface AdjustmentListener
configurationChanged
in class AbstractProgressIndicatorView
source
- The Adjustment
.public ProgressBarField getProgressBar()
ProgressBarField
that has been created in this view,
null
if no field has been set.public void reset()
reset
in class AbstractProgressIndicatorView
public void setNonProgrammaticValue(int value)
The actual change is reflected through Adjustment
so ProgressIndicatorView.valueChanged(net.rim.device.api.ui.Adjustment)
will be called. This blocks
notifying FieldChangeListener
s of the change as
programmatic.
setNonProgrammaticValue
in class AbstractProgressIndicatorView
value
- The new value of the data model.public void valueChanged(Adjustment source)
valueChanged
in interface AdjustmentListener
valueChanged
in class ScrollView
source
- The Adjustment
.
|
|||||||||
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.