net.rim.device.api.ui.component.progressindicator
Class ProgressIndicatorView

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.ScrollView
          extended by net.rim.device.api.ui.Manager
              extended by net.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorView
                  extended by net.rim.device.api.ui.component.progressindicator.ProgressIndicatorView
All Implemented Interfaces:
AdjustmentListener

public class ProgressIndicatorView
extends AbstractProgressIndicatorView

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:

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:

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.

Since:
BlackBerry API 6.0.0

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
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, AXIS_HORIZONTAL, AXIS_SEQUENTIAL, AXIS_VERTICAL, EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEADING, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_TRAILING, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, NON_SPELLCHECKABLE, READONLY, SPELLCHECKABLE, SPELLCHECKABLE_MASK, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH, VISUAL_STATE_ACTIVE, VISUAL_STATE_DISABLED, VISUAL_STATE_DISABLED_FOCUS, VISUAL_STATE_FOCUS, VISUAL_STATE_NORMAL
 
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).
static ProgressIndicatorView create(String label, int min, int max, int initial, long style)
          Creates a ProgressIndicatorView based on the label and creates a ProgressIndicatorModel and associates them.
 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.Manager
cursorClick, cursorUnclick, getAccessibleContext, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, insertAll, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationUnclick, nextFocus, onFocus, onUnfocus, paint, paintChild, setDirty, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, subpaint, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.ScrollView
getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onExposed, onUndisplay, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, waitForScrolling
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredHeight, getPreferredWidth, getScreen, getStyle, getTextFillColor, getTextStrokeColor, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isLeftToRight, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

ProgressIndicatorView

public ProgressIndicatorView(long style)
Constructs a new ProgressIndicatorView. The delegate defaults to a VerticalFieldManager.

Parameters:
style - The style bits to set for this view.
Since:
BlackBerry API 6.0.0

ProgressIndicatorView

public ProgressIndicatorView(long style,
                             Manager delegate)
Constructs a new ProgressIndicatorView. Requires a delegate to be specified. If null is provided, the delegate defaults to a VerticalFieldManager.

Parameters:
style - The style bits to set for this view.
delegate - The Manager to use as a delegate for layout and focus.
Since:
BlackBerry API 6.0.0


Method Detail

createProgressBar

public void createProgressBar(long style)
Creates a 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.

Parameters:
style - The style bits to set for this field, including the custom style bits for ProgressBarField.
Throws:
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.
Since:
BlackBerry API 6.0.0

configurationChanged

public void configurationChanged(Adjustment source)
Called when one of the Adjustment fields have been changed (other than the value field). The new configuration of the Adjustment is reflected within the view.

Specified by:
configurationChanged in interface AdjustmentListener
Overrides:
configurationChanged in class AbstractProgressIndicatorView
Parameters:
source - The Adjustment.
Since:
BlackBerry API 6.0.0

getProgressBar

public ProgressBarField getProgressBar()
Returns the field responsible for rendering the progress. Use this method to set visual aspects for the field.

Returns:
The ProgressBarField that has been created in this view, null if no field has been set.
Since:
BlackBerry API 6.0.0

reset

public void reset()
The data model has been reset to its initial state.

Overrides:
reset in class AbstractProgressIndicatorView
Since:
BlackBerry API 6.0.0

setNonProgrammaticValue

public void setNonProgrammaticValue(int value)
Invoked when the value in the data model has changed through non-programmatic means. This is normally invoked as a result of user input that directly alters the value.

The actual change is reflected through Adjustment so ProgressIndicatorView.valueChanged(net.rim.device.api.ui.Adjustment) will be called. This blocks notifying FieldChangeListeners of the change as programmatic.

Overrides:
setNonProgrammaticValue in class AbstractProgressIndicatorView
Parameters:
value - The new value of the data model.
Since:
BlackBerry API 6.0.0

valueChanged

public void valueChanged(Adjustment source)
Invoked when the value field is changed.

Specified by:
valueChanged in interface AdjustmentListener
Overrides:
valueChanged in class ScrollView
Parameters:
source - The Adjustment.
Since:
BlackBerry API 6.0.0

create

public static ProgressIndicatorView create(String label,
                                           int min,
                                           int max,
                                           int initial,
                                           long style)
Creates a ProgressIndicatorView based on the label and creates a ProgressIndicatorModel and associates them. This factory allows the lower bound, upper bound, and initial value to be set.

Parameters:
label - The label to display.
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 view.
Returns:
A ProgressIndicatorView.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal