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

java.lang.Object
  extended by net.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorController
Direct Known Subclasses:
ActivityIndicatorController, ProgressIndicatorController

public abstract class AbstractProgressIndicatorController
extends Object

This class acts as a controller for an AbstractProgressIndicatorView based on the Model-View-Controller design pattern. This controller is responsible for the customized handling of input to the view (but note that this controller does not process trackwheel events). This controller can be associated with both an AbstractProgressIndicatorView and an AbstractProgressIndicatorModel.

This class implements the following input-handling methods, which mirror those found in Field: AbstractProgressIndicatorController.keyChar(char, int, int), AbstractProgressIndicatorController.keyControl(char, int, int), AbstractProgressIndicatorController.keyDown(int, int), AbstractProgressIndicatorController.keyRepeat(int, int), AbstractProgressIndicatorController.keyUp(int, int), AbstractProgressIndicatorController.navigationClick(int, int), AbstractProgressIndicatorController.navigationMovement(int, int, int, int), and AbstractProgressIndicatorController.touchEvent(net.rim.device.api.ui.TouchEvent).

The default behavior provided by this class is to not process or consume any input event. That is, all the above input-handling methods in this class return false. Because of this, ProgressIndicatorView allows its delegate to process them. Override these methods in order to provide customized input-handling behavior.

Since:
BlackBerry API 6.0.0

Constructor Summary
AbstractProgressIndicatorController()
          Constructs a new AbstractProgressIndicatorController.
 
Method Summary
 AbstractProgressIndicatorModel getModel()
          Returns the model associated with this controller.
 AbstractProgressIndicatorView getView()
          Returns the view associated with this controller.
 boolean keyChar(char ch, int status, int time)
          Implementation of Field.keyChar(char,int,int).
 boolean keyControl(char ch, int status, int time)
          Implementation of Field.keyControl(char,int,int).
 boolean keyDown(int keycode, int time)
          Implementation of Field.keyDown(int,int).
 boolean keyRepeat(int keycode, int time)
          Implementation of Field.keyRepeat(int,int).
 boolean keyStatus(int keycode, int time)
          Implementation of Field.keyStatus(int,int).
 boolean keyUp(int keycode, int time)
          Implementation of Field.keyUp(int,int).
 boolean navigationClick(int status, int time)
          Implementation of Field.navigationClick(int,int).
 boolean navigationMovement(int dx, int dy, int status, int time)
          Implementation of Field.navigationMovement(int,int,int,int).
 void setModel(AbstractProgressIndicatorModel model)
          Associates this controller with the provided model.
 void setView(AbstractProgressIndicatorView view)
          Associates this controller with the provided view.
 boolean touchEvent(TouchEvent message)
          Implementation of Field.touchEvent(TouchEvent).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

AbstractProgressIndicatorController

public AbstractProgressIndicatorController()
Constructs a new AbstractProgressIndicatorController.

Since:
BlackBerry API 6.0.0


Method Detail

getModel

public AbstractProgressIndicatorModel getModel()
Returns the model associated with this controller.

Returns:
The ProgressIndicatorModel that is associated with this controller, null if none has been set.
Since:
BlackBerry API 6.0.0

getView

public AbstractProgressIndicatorView getView()
Returns the view associated with this controller.

Returns:
The ProgressIndicatorView that is associated with this controller, null if none has been set.
Since:
BlackBerry API 6.0.0

keyChar

public boolean keyChar(char ch,
                       int status,
                       int time)
Implementation of Field.keyChar(char,int,int).

Parameters:
ch - Character generated.
status - Modifier key status.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

keyControl

public boolean keyControl(char ch,
                          int status,
                          int time)
Implementation of Field.keyControl(char,int,int).

Parameters:
ch - Character generated.
status - Modifier key status.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

keyDown

public boolean keyDown(int keycode,
                       int time)
Implementation of Field.keyDown(int,int).

Parameters:
keycode - Code of key pressed.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

keyRepeat

public boolean keyRepeat(int keycode,
                         int time)
Implementation of Field.keyRepeat(int,int).

Parameters:
keycode - Code of key repeated.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

keyStatus

public boolean keyStatus(int keycode,
                         int time)
Implementation of Field.keyStatus(int,int).

Parameters:
keycode - Code of status key.
time - Number of milliseconds since the device was turned on.
Returns:
True if event was consumed; otherwise, returns false.
Since:
BlackBerry API 6.0.0

keyUp

public boolean keyUp(int keycode,
                     int time)
Implementation of Field.keyUp(int,int).

Parameters:
keycode - Code of key released.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

navigationClick

public boolean navigationClick(int status,
                               int time)
Implementation of Field.navigationClick(int,int).

Parameters:
status - Bitfield of values defined by KeypadListener.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

navigationMovement

public boolean navigationMovement(int dx,
                                  int dy,
                                  int status,
                                  int time)
Implementation of Field.navigationMovement(int,int,int,int).

Parameters:
dx - Magnitude of navigational motion: negative for a move left and postive for a move right.
dy - Magnitude of navigational motion: negative for an upwards move, and positive for a downwards move.
status - Bitfield of values defined by KeypadListener.
time - Number of milliseconds since the device was turned on.
Returns:
true if the event was consumed, false otherwise.
Since:
BlackBerry API 6.0.0

setModel

public void setModel(AbstractProgressIndicatorModel model)
Associates this controller with the provided model. The provided model will override any model currently set.

Parameters:
model - The ProgressIndicatorModel to associate with this controller.
Since:
BlackBerry API 6.0.0

setView

public void setView(AbstractProgressIndicatorView view)
Associates this controller with the provided view. The provided view will override any view currently set.

Parameters:
view - The ProgressIndicatorView to associate with this controller.
Since:
BlackBerry API 6.0.0

touchEvent

public boolean touchEvent(TouchEvent message)
Implementation of Field.touchEvent(TouchEvent).

Parameters:
message - TouchEvent object containing various input parameters including the event type and touch coordinates.
Returns:
true if the event was consumed, false otherwise.
Throws:
IllegalArgumentException - if message is null.
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.