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

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.ActivityIndicatorView
All Implemented Interfaces:
AdjustmentListener

public class ActivityIndicatorView
extends AbstractProgressIndicatorView

Implementation of AbstractProgressIndicatorView that is used for representing progress where the duration is unknown. This is especially useful for tasks where there is no possible numeric representation for the work being done.

These tasks are typically represented by a spinner, an hourglass, or by other visual cues. This view allows for a custom animation to be specified in order to represent the progress underway. The custom animation takes the form of a Bitmap that contains each frame of the animation, laid out horizontally. The length of the bitmap should be the width of a frame times the number of frames. This field can be created by invoking ActivityIndicatorView.createActivityImageField(net.rim.device.api.system.Bitmap, int, long), which also adds it to this view's delegate.

Both a model ActivityIndicatorModel and a controller ActivityIndicatorController are available and represent implementations of AbstractProgressIndicatorModel and AbstractProgressIndicatorController respectively. These are representative of progress where the duration is unknown. If the associated controller does not consume an input event, this view 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
ActivityIndicatorView(long style)
          Constructs a new ActivityIndicatorView.
ActivityIndicatorView(long style, Manager delegate)
          Constructs a new ActivityIndicatorView.
 
Method Summary
 void cancelled()
          The current animation representing progress has been stopped.
 void createActivityImageField(Bitmap bitmap, int numFrames, long style)
          Creates an ActivityImageField and adds it to this view.
 ActivityImageField getAnimation()
          Returns the field that is animating progress.
 void reset()
          The data model has been reset to its initial state, that is, the animation has been reset.
 void resumed()
          The data model has been resumed, that is, the animation has been resumed.
 
Methods inherited from class net.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorView
add, addAll, configurationChanged, 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, setController, setLabel, setModel, setNonProgrammaticValue, sublayout, touchEvent
 
Methods inherited from class net.rim.device.api.ui.Manager
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, onUndisplay, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, 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, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocus, setFocusListener, 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

ActivityIndicatorView

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

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

ActivityIndicatorView

public ActivityIndicatorView(long style,
                             Manager delegate)

Constructs a new ActivityIndicatorView. 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

cancelled

public void cancelled()
The current animation representing progress has been stopped.

Overrides:
cancelled in class AbstractProgressIndicatorView
Since:
BlackBerry API 6.0.0

createActivityImageField

public void createActivityImageField(Bitmap bitmap,
                                     int numFrames,
                                     long style)
Creates an ActivityImageField and adds it to this view. The bitmap provided must be a series of frames laid out horizonatally, each with equal width. The total width of the bitmap should be the width of a frame times the number of frames.

Parameters:
bitmap - The Bitmap containing all frames of the animation laid out horizontally, each with equal width. The total width of the bitmap should be the width of a frame times numFrames.
numFrames - The number of equal-width frames contained in bitmap.
style - The style bits to set for this field.
Since:
BlackBerry API 6.0.0

getAnimation

public ActivityImageField getAnimation()
Returns the field that is animating progress.

Returns:
The ActivityImageField being used to represent progress.
Since:
BlackBerry API 6.0.0

reset

public void reset()
The data model has been reset to its initial state, that is, the animation has been reset.

Overrides:
reset in class AbstractProgressIndicatorView
Since:
BlackBerry API 6.0.0

resumed

public void resumed()
The data model has been resumed, that is, the animation has been resumed. This method is most commonly called after a cancel.

Overrides:
resumed in class AbstractProgressIndicatorView
Since:
BlackBerry API 6.0.0





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.