|
|||||||||
| 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
public abstract class AbstractProgressIndicatorView
This manager presents an animating field to the user to indicate the progress of work being done by an application.
This manager accepts a delegate for handling layout and focus.
If no delegate is provided, this manager defaults to using a VerticalFieldManager.
All fields and managers added to this manager are, in fact, added to the delegate. The delegate is
the only field directly stored within this manager. All access methods for adding, deleting,
getting, inserting, and replacing are processed by the delegate as if those fields
were direct children of this manager.
This manager follows the Model-View-Controller design pattern and, as such, also
accepts the setting of an AbstractProgressIndicatorModel and an AbstractProgressIndicatorController.
The model is responsible for handling the background data structures that represent
the progress being made.
The controller is responsible for defining the customized handling of user input.
If the controller does not consume an input event, this manager allows the delegate
to handle the input. If it is not desired for the delegate to handle input, then you must override the various
input methods: AbstractProgressIndicatorView.keyChar(char, int, int), AbstractProgressIndicatorView.keyControl(char, int, int), AbstractProgressIndicatorView.keyDown(int, int), AbstractProgressIndicatorView.keyRepeat(int, int),
AbstractProgressIndicatorView.keyUp(int, int), AbstractProgressIndicatorView.navigationClick(int, int), AbstractProgressIndicatorView.navigationMovement(int, int, int, int), and AbstractProgressIndicatorView.touchEvent(net.rim.device.api.ui.TouchEvent).
| 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 | ||
|---|---|---|
AbstractProgressIndicatorView(long style)
Constructs a new AbstractProgressIndicatorView,
assigning a VerticalFieldManager as the delegate. |
||
AbstractProgressIndicatorView(long style,
Manager delegate)
Constructs a new AbstractProgressIndicatorView,
assigning the specified delegate. |
||
| Method Summary | ||
|---|---|---|
void |
add(Field field)
Adds a field to this view. |
|
void |
addAll(Field[] fields)
Adds an array of fields to this view. |
|
protected void |
cancelled()
The current representation of progress has been cancelled. |
|
void |
configurationChanged(Adjustment source)
Called when one of the Adjustment fields has been changed (other than the value field). |
|
void |
createLabel(String label)
Creates a new LabelField and sets its text. |
|
void |
createLabel(String label,
long style)
Creates a new LabelField and sets its text. |
|
void |
delete(Field field)
Removes a field from this view. |
|
void |
deleteAll()
Removes all fields from this view. |
|
void |
deleteRange(int start,
int count)
Removes a range of fields from this view. |
|
AbstractProgressIndicatorController |
getController()
Returns the ProgressIndicatorController
that has been set as the controller for this view. |
|
Manager |
getDelegate()
Returns this view's delegate manager. |
|
Field |
getField(int index)
Returns the controlled field at a specified index. |
|
int |
getFieldAtLocation(int x,
int y)
Returns the index of a field under a particular point. |
|
int |
getFieldCount()
Returns the number of fields controlled by this manager's delegate. |
|
Field |
getFieldWithFocus()
Returns the controlled field with focus. |
|
int |
getFieldWithFocusIndex()
Returns the index of the controlled field with focus. |
|
String |
getLabel()
Returns the text of the label for this view. |
|
LabelField |
getLabelField()
Returns the label for this view. |
|
AbstractProgressIndicatorModel |
getModel()
Returns the ProgressIndicatorModel that
has been set as the model for this view. |
|
void |
insert(Field field,
int index)
Inserts a field into this manager. |
|
protected boolean |
keyChar(char ch,
int status,
int time)
Handles key generation events. |
|
protected boolean |
keyControl(char ch,
int status,
int time)
Sends key generation events to the controlled field with focus. |
|
protected boolean |
keyDown(int keycode,
int time)
Sends key down events to the controlled field with focus. |
|
protected boolean |
keyRepeat(int keycode,
int time)
Sends key repeat events to the controlled field with focus. |
|
protected boolean |
keyStatus(int keycode,
int time)
Sends key status event to the controlled field with focus. |
|
protected boolean |
keyUp(int keycode,
int time)
Sends key up event to the controlled field with focus. |
|
protected boolean |
navigationClick(int status,
int time)
Invoked when the navigational action is selected. |
|
protected boolean |
navigationMovement(int dx,
int dy,
int status,
int time)
Invoked when a navigational motion occurs. |
|
protected int |
nextFocus(int direction,
int axis)
Override of Manager.nextFocus(). |
|
void |
replace(Field oldField,
Field newField)
Removes a field from this manager's delegate and replaces it with another field. |
|
protected void |
reset()
The data model has been reset to its initial state. |
|
protected void |
resumed()
The data model has resumed progress. |
|
void |
setController(AbstractProgressIndicatorController controller)
Sets the controller for this view. |
|
void |
setLabel(String label)
Sets the text of the currently assigned label. |
|
void |
setModel(AbstractProgressIndicatorModel model)
Sets the model for this view. |
|
protected void |
setNonProgrammaticValue(int value)
Invoked when the value in the data model has changed via non-programmatic means. |
|
protected void |
sublayout(int width,
int height)
Implements custom layout features for this manager. |
|
protected boolean |
touchEvent(TouchEvent message)
Handles touch input events (see TouchEvent). |
|
| Methods inherited from class net.rim.device.api.ui.ScrollView |
|---|
getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onExposed, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractProgressIndicatorView(long style)
AbstractProgressIndicatorView,
assigning a VerticalFieldManager as the delegate.
style - The field style bits. See Field.
public AbstractProgressIndicatorView(long style,
Manager delegate)
AbstractProgressIndicatorView,
assigning the specified delegate.
style - The field style bits. See Field.delegate - The Manager that is responsible for layout and focus for the view.
If null, a VerticalFieldManager is assigned.| Method Detail |
|---|
public void add(Field field)
This method prompts this view's delegate manager to add a new field.
add in class Managerfield - The Field to add.public void addAll(Field[] fields)
This method prompts the view's delegate manager to add the fields.
addAll in class Managerfields - An array of Fields to add.
IllegalStateException - if a field has already been added to the
manager.
IllegalArgumentException - if a field is being added to itself.protected void cancelled()
public void configurationChanged(Adjustment source)
Adjustment fields has been changed (other than the value field).
configurationChanged in interface AdjustmentListenerconfigurationChanged in class ScrollViewsource - The Adjustment.public void createLabel(String label)
LabelField and sets its text.
This label is created with no style
bits set.
label - The text to set for the label.
public void createLabel(String label,
long style)
LabelField and sets its text.
label - The text to set for the label.style - The style bits to set for the LabelField.public void delete(Field field)
This method prompts this view's delegate manager to remove the field.
delete in class Managerfield - The Field to remove.
IllegalArgumentException - if the field to be deleted does not
belong to this manager.public void deleteAll()
This method prompts this view's delegate manager to remove all fields.
deleteAll in class Manager
public void deleteRange(int start,
int count)
This method prompts this view's delegate manager to remove the fields.
deleteRange in class Managerstart - Index at which to begin deletion.count - Number of fields to delete.
IndexOutOfBoundsException - if start or count are invalid.public AbstractProgressIndicatorController getController()
ProgressIndicatorController
that has been set as the controller for this view.
ProgressIndicatorController that has been set for this view
or null if none has been set.public Manager getDelegate()
public Field getField(int index)
getField in class Managerindex - Index of the field to return.
IndexOutOfBoundsException - if index is not valid.
public int getFieldAtLocation(int x,
int y)
Given the coordinates of a point that is local to this manager's extent, this
method returns the index of the controlled field under that point (or -1
if no field is found under the specified point).
This method constrains its search to the extent of this manager. If you provide a coordinate outside this manager's extent, this method uses values along the edges of the extent as required.
By default, this method performs a linear search hit, testing each controlled field in turn. If you implement a manager, you can override this method to optimize its functionality.
This method prompts this view's delegate manager to perform the search through the children for it.
getFieldAtLocation in class Managerx - Distance from the left edge of manager's extent.y - Distance from the top edge of manager's extent.
-1 if no field is found.public int getFieldCount()
getFieldCount in class Managerpublic Field getFieldWithFocus()
Invoke this method to return the field controlled by this manager's delegate that has the focus. Note that the field returned might be another manager.
getFieldWithFocus in class Managernull if no field has the focus.Manager.getLeafFieldWithFocus()public int getFieldWithFocusIndex()
This method prompts this view's delegate manager to return the index of the field with focus.
getFieldWithFocusIndex in class Managerpublic String getLabel()
AbstractProgressIndicatorView.createLabel(java.lang.String).
null
if no label is set.public LabelField getLabelField()
AbstractProgressIndicatorView.createLabel(java.lang.String).
LabelField containing the label for this field,
null is none has been created.public AbstractProgressIndicatorModel getModel()
ProgressIndicatorModel that
has been set as the model for this view.
ProgressIndicatorModel that has been set for this view,
null if none has been set.
public void insert(Field field,
int index)
Invoke this method to insert a new field into this manager's delegate. You provide the field to add and the index position for the new field.
This method prompts this view's delegate manager to insert the provided field.
insert in class Managerfield - Field to insert.index - Index at which to insert the field.
IndexOutOfBoundsException - if index is less than 0 or greater
than AbstractProgressIndicatorView.getFieldCount().
IllegalStateException - if the field has already been added to the
manager.
IllegalArgumentException - if the field is being added to itself.
protected boolean keyChar(char ch,
int status,
int time)
Sends the event to the field with focus. If no controlled field has
the focus, this method does nothing and returns false.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
keyChar in class Managerch - Character generated.status - Modifier key status.time - Number of milliseconds since the device was turned on.
true if the event was consumed, false otherwise.
protected boolean keyControl(char ch,
int status,
int time)
If no controlled field has the focus, this method does nothing and
returns false.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
keyControl in class Managerch - Character generated.status - Modifier key status.time - Number of milliseconds since the device was turned on.
true if the event was consumed, false otherwise.
protected boolean keyDown(int keycode,
int time)
If no controlled field has the focus, this method does nothing and
returns false.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
keyDown in class Managerkeycode - Code of key pressed.time - Number of milliseconds since the device was turned on.
true if the event was consumed, false otherwise.
protected boolean keyRepeat(int keycode,
int time)
If no controlled field has the focus, this method does nothing and
returns false.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
keyRepeat in class Managerkeycode - Code of key repeated.time - Number of milliseconds since the device was turned on.
true if the event was consumed, false otherwise.
protected boolean keyStatus(int keycode,
int time)
If no controlled field has the focus, this method does nothing and
returns false.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
keyStatus in class Managerkeycode - Code of status key.time - Number of milliseconds since the device was turned on.
protected boolean keyUp(int keycode,
int time)
If no controlled field has the focus, this method does nothing and
returns false.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
keyUp in class Managerkeycode - Code of key released.time - Number of milliseconds since the device was turned on.
true if the event was consumed, false otherwise.
protected boolean navigationClick(int status,
int time)
The source of the navigation event can be determined by checking the
KeypadListener.STATUS_TRACKWHEEL and KeypadListener.STATUS_FOUR_WAY
bits in the status parameter; exactly one of them will be set.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
navigationClick in class Managerstatus - Bitfield of values defined by KeypadListener.time - Number of milliseconds since the device was turned on.
true if this method consumed the event, false otherwise.
protected boolean navigationMovement(int dx,
int dy,
int status,
int time)
The source of the navigation event can be determined by checking the
KeypadListener.STATUS_TRACKWHEEL and KeypadListener.STATUS_FOUR_WAY
bits in the status parameter; exactly one of them will be set.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
navigationMovement in class Managerdx - Magnitude of the navigational motion: negative for a move left
and positive for a move right.dy - Magnitude of the navigational motion: negative for an upward
move, and positive for a downward move.status - Bitfield of values defined by KeypadListener.time - Number of milliseconds since the device was turned on.
true if the event was consumed, false otherwise.
protected int nextFocus(int direction,
int axis)
Manager.nextFocus(). This method always returns -1.
This is intended in order to not attempt to move the focus
off of the delegate while focus is in the scope of this manager.
nextFocus in class Managerdirection - Direction the focus is moving within the field.axis - The axis of movement.
public void replace(Field oldField,
Field newField)
oldField must be a child of this manager's delegate and the
specified newField must not be being managed by any manager.
This method prompts this view's delegate to perform the replacing.
replace in class ManageroldField - The field to be replaced.newField - The field to replace it.
IllegalArgumentException - if any argument is null, if oldField
is not being managed by this manager (that is, oldField.getManager() != this),
or if newField is being managed by any manager including this
one (that is, newField.getManager() != null).
IllegalStateException - if oldField.getIndex() returns -1.AbstractProgressIndicatorView.delete(Field),
AbstractProgressIndicatorView.insert(Field, int),
Field.getIndex(),
Field.getManager(),
Field.setFocus()protected void reset()
protected void resumed()
public void setController(AbstractProgressIndicatorController controller)
controller - The ProgressIndicatorController to associate with this view.public void setLabel(String label)
AbstractProgressIndicatorView.createLabel(String) to have a label
created and added to the delegate of this view.
label - The text to set the label to.public void setModel(AbstractProgressIndicatorModel model)
This method will automatically add this view's listener
to the model (AbstractProgressIndicatorModel.addListener(net.rim.device.api.ui.component.progressindicator.ProgressIndicatorListener)).
If you override this method, you must either call super.setModel()
or add the listener directly.
model - The ProgressIndicatorModel to associate with this view.protected void setNonProgrammaticValue(int value)
value - The new value of the data model.
protected void sublayout(int width,
int height)
This method performs a full layout on its delegate. The delegate is responsible for the layout of all fields that have been added to the view.
sublayout in class Managerwidth - Width available for this manager.height - Height available for this manager.protected boolean touchEvent(TouchEvent message)
TouchEvent).
The coordinates reflect the location of the touch event with respect to the top-left of this manager.
The coordinates are then further mapped to the top-left corner of the field with input.
This method prompts this view's controller to process the input event. If the event is not consumed, the delegate then processes it.
touchEvent in class Managermessage - TouchEvent object containing input parameters
including the event type and touch coordinates.
true if the event is consumed, false otherwise.
IllegalArgumentException - if message is null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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