|
|||||||||
| 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.pane.PaneManagerView
public class PaneManagerView
PaneManagerView is a Manager that displays information in tabbed panes.
The information is stored in Pane objects that are contained in a PaneManagerModel.
The Pane Manager classes conform to the Model-View-Controller design pattern. PaneManagerView
implements the View. It lays out and renders the panes. PaneManagerModel
implements the Model. It maintains the Pane objects that represent
the data and tracks the current position within the model. PaneManagerController
implments the Controller. It handles all user input received by the Pane Manager. If the Controller
cannot handle a user event, PaneManagerView forwards the event to the contained Field objects.
PaneManagerView delegates layout and rendering to two other classes. PaneView handles
the content Field objects. You can get these fields from the current set of Pane
objects by using Pane.getPane(). TitleView handles the title Field
objects. You can get these fields from the current set of Pane objects by using Pane.getTitle(). TitleView
lays out the titles above the content. You can create alternate layouts by specifying a delegate
Manager by using PaneManagerView.setDelegate(Manager).
Unlike Manager, PaneManagerView does not let you add or remove Field objects.
PaneManagerView does not support PaneManagerView.add(Field), PaneManagerView.addAll(Field[]), PaneManagerView.delete(Field), PaneManagerView.deleteAll(),
PaneManagerView.deleteRange(int, int),PaneManagerView.insert(Field, int), PaneManagerView.insertAll(Field[], int), or PaneManagerView.replace(Field, Field).
To modify content, add or remove Pane objects contained in the associated PaneManagerModel.
To do this, use PaneManagerModel.addPane(Pane), PaneManagerModel.deletePane(Pane),
PaneManagerModel.insertPane(Pane, int), and PaneManagerModel.replacePane(Pane, Pane).
| Field Summary | ||
|---|---|---|
static int |
DEFAULT_ANIMATION_DURATION
Deprecated. Replaced by PaneManagerView.getDefaultAnimationDuration() |
|
static int |
DIRECTION_BACKWARDS
Specifies that the tab focus order of the tabbed panes should be the reverse of the order that Panes are stored in the Model. |
|
static int |
DIRECTION_FADE_IN
Specifies that, when switching from one Pane
to another, the target pane should fade into view over the top of the current pane. |
|
static int |
DIRECTION_FORWARDS
Specifies that the tab focus order of the tabbed panes should be the order that Panes are stored in the Model. |
|
static int |
DIRECTION_NONE
Specifies that there is no preferred direction for the Pane to end the current view. |
|
| 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 | ||
|---|---|---|
PaneManagerView(long style,
TitleView title,
PaneView pane)
Class constructor that requires a TitleView and PaneView and lets you
specify style bits. |
||
| Method Summary | ||
|---|---|---|
void |
add(Field field)
Throws an UnsupportedOperationException. |
|
void |
addAll(Field[] fields)
Throws an UnsupportedOperationException. |
|
void |
clearOverriddenTitle()
Removes the currently set overridden header. |
|
void |
delete(Field field)
This view does not support direct manipulation of its contents. |
|
void |
deleteAll()
This view does not support direct manipulation of its contents. |
|
void |
deleteRange(int start,
int count)
This view does not support direct manipulation of its contents. |
|
float |
drag(int dx,
int dy)
Moves both the title and the content pane by the specified number of pixels. |
|
int |
getAnimationDuration()
Returns the current value that specifies the duration of all animations controlled by this view. |
|
XYRect |
getContentExtent()
Returns the extent of the PaneView associated with this view. |
|
PaneManagerController |
getController()
Returns the PaneManagerController for this view. |
|
Manager |
getDelegate()
Returns the layout delegate for this view. |
|
PaneManagerModel |
getModel()
Returns the PaneManagerModel for this view. |
|
PaneView |
getPane()
Returns the associated pane for this view. |
|
TitleView |
getTitle()
Returns the TitleView for this view. |
|
XYRect |
getTitleExtent()
Returns the extent of the TitleView associated to this view. |
|
void |
insert(Field field,
int index)
This view does not support direct manipulation of its contents. |
|
void |
insertAll(Field[] fields,
int index)
This view does not support direct manipulation of its contents. |
|
boolean |
isAnimating()
Indicates if this view is currently animating the transition between panes. |
|
void |
jumpTo(int index,
int direction)
Causes this view to move from the currently selected pane to the pane at the index provided. |
|
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 event to the controlled field with focus. |
|
protected boolean |
keyDown(int keycode,
int time)
Sends key down event to the controlled field with focus. |
|
protected boolean |
keyRepeat(int keycode,
int time)
Sends key repeat event 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 a navigational action is performed. |
|
protected boolean |
navigationMovement(int dx,
int dy,
int status,
int time)
Invoked when a navigational motion occurs. |
|
void |
replace(Field oldField,
Field newField)
This view does not support direct manipulation of its contents. |
|
void |
setAnimationDuration(int duration)
Specifies animation duration. |
|
void |
setController(PaneManagerController controller)
Sets the controller for this view. |
|
void |
setDelegate(Manager delegate)
Sets an optional Manager to
handle the layout of the TitleView
and PaneView. |
|
void |
setModel(PaneManagerModel model)
Sets the model to this view, as well as to the TitleView and PaneView view associated to this view. |
|
void |
setOverriddenTitle(TitleView title)
Sets an optional TitleView to provide a customized rendering in place of the titles contained within
the associated PaneManagerModel. |
|
void |
setPane(PaneView pane)
Sets the PaneView asssociated with this view. |
|
void |
setTitle(TitleView title)
Sets the TitleView asssociated with this view. |
|
void |
snapToCurrent(int direction)
Moves the currently selected pane back to its default layout position. |
|
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 |
|---|
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onExposed, onUndisplay, 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 |
| Field Detail |
|---|
public static final int DEFAULT_ANIMATION_DURATION
PaneManagerView.getDefaultAnimationDuration()Default time (in milliseconds) to animate moving from one Pane to the
next or previous Pane.
public static final int DIRECTION_BACKWARDS
Specifies that the tab focus order of the tabbed panes should be
the reverse of the order that Panes are stored in the Model.
Reverse order tab focusing is implemented by calling PaneManagerModel.getLeftIndexOf(int)
and PaneManagerModel.previousIndex().
public static final int DIRECTION_FADE_IN
Specifies that, when switching from one Pane
to another, the target pane should fade into view over the top of the current pane.
public static final int DIRECTION_FORWARDS
Specifies that the tab focus order of the tabbed panes should be
the order that Panes are stored in the Model.
The order is based on PaneManagerModel.getLeftIndexOf(int)
and PaneManagerModel.nextIndex().
public static final int DIRECTION_NONE
Specifies that there is no preferred direction for
the Pane to end the current view. If desired it can simply be rendered
over top of the current one without any interm steps.
| Constructor Detail |
|---|
public PaneManagerView(long style,
TitleView title,
PaneView pane)
Class constructor that requires a TitleView and PaneView and lets you
specify style bits.
style - The set of style bits to apply to this view. This value is constructed by bitwise ORing style constants defined in
Field and Manager.title - The TitleView to layout and render titles.pane - The PaneView to layout and render the content.
IllegalArgumentException - if title or pane is null.| Method Detail |
|---|
public void add(Field field)
Throws an UnsupportedOperationException. The add() method is not
supported. To add content to this view, add it to the associated PaneManagerModel.
This view does not support direct manipulation of its contents. The view displays the provided contents with a paired header.
add in class Managerfield - This parameter is ignored.
UnsupportedOperationExceptionpublic void addAll(Field[] fields)
Throws an UnsupportedOperationException. The addAll() method is not
supported. To add content to this view, add it to the associated PaneManagerModel.
This view does not support direct manipulation of its contents. The view displays the provided contents with a paired header.
addAll in class Managerfields - This parameter is ignored.
UnsupportedOperationExceptionpublic void clearOverriddenTitle()
Removes the currently set overridden header.
Following rendering will once again be ran by the TitleView
that was provided in the constructor.
public void delete(Field field)
This view does not support direct manipulation of its contents. The view is intended for the displaying of provided contents with a paired header.
Content can be removed from the
PaneManagerModel associated to this view.
delete in class Managerfield - This parameter is ignored.
UnsupportedOperationExceptionpublic void deleteAll()
This view does not support direct manipulation of its contents. The view is intended for the displaying of provided contents with a paired header.
Content can be removed from the
PaneManagerModel associated to this view.
deleteAll in class ManagerUnsupportedOperationException
public void deleteRange(int start,
int count)
This view does not support direct manipulation of its contents. The view is intended for the displaying of provided contents with a paired header.
Content can be removed the
PaneManagerModel associated to this view.
deleteRange in class Managerstart - This parameter is ignored.count - This parameter is ignored.
UnsupportedOperationException
public float drag(int dx,
int dy)
Moves both the title and the content pane by the specified number of pixels.
Does nothing if the Model is null. Calls both
TitleView.drag(int, int, int, int, int) and PaneView.drag(int, int, int, int, int)
to place their contents appropriately.
Calling drag() invalidates this component.
dx - The number of pixels to move the title and content panes horizontally.dy - The number of pixels to move the title and content panes vertically.
public int getAnimationDuration()
Returns the current value that specifies the duration of all animations controlled by this view.
public XYRect getContentExtent()
Returns the extent of the PaneView associated with this view.
This is the same as calling Field.getExtent(). The returned
object is not a copy.
PaneView or an empty XYRect if the associated pane is null.public PaneManagerController getController()
Returns the PaneManagerController for this view.
PaneManagerController associated with this view
or null if no controller has been set.public Manager getDelegate()
Returns the layout delegate for this view.
Manager associated with this view
or null if none has been set.public PaneManagerModel getModel()
Returns the PaneManagerModel for this view.
PaneManagerModel associated with this view
or null if none has been set.public PaneView getPane()
Returns the associated pane for this view.
PaneView associated with this view.public TitleView getTitle()
Returns the TitleView for this view.
TitleView associated with this view.public XYRect getTitleExtent()
Returns the extent of the TitleView associated to this view.
This is the same as calling Field.getExtent(). The returned
object is not a copy.
TitleView or an empty XYRect if the associated pane is null.
public void insert(Field field,
int index)
This view does not support direct manipulation of its contents. The view is intended for the displaying of provided contents with a paired header.
Additional content can be added to the
PaneManagerModel associated to this view.
insert in class Managerfield - This parameter is ignored.index - This parameter is ignored.
UnsupportedOperationException
public void insertAll(Field[] fields,
int index)
This view does not support direct manipulation of its contents. The view is intended for the displaying of provided contents with a paired header.
Additional content can be added to the
PaneManagerModel associated to this view.
insertAll in class Managerfields - This parameter is ignored.index - This parameter is ingored.
UnsupportedOperationException
protected boolean keyChar(char ch,
int status,
int time)
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume the event, the view passes the event to its contents.
keyChar in class Managerch - The character generated.status - The modifier key status.time - The number of milliseconds since the device was turned on.
true if 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.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
keyControl in class Managerch - The character generated.status - The modifier key status.time - The number of milliseconds since the device was turned on.
true if 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.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
keyDown in class Managerkeycode - The code of the key that was pressed.time - The number of milliseconds since the device was turned on.
true if 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.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
keyRepeat in class Managerkeycode - The code of the key that was repeated.time - The number of milliseconds since the device was turned on.
true if 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.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
keyStatus in class Managerkeycode - The code of the status key.time - The number of milliseconds since the device was turned on.
true if event was consumed, false otherwise.
protected boolean keyUp(int keycode,
int time)
If no controlled field has the focus, this method does nothing and returns false.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
keyUp in class Managerkeycode - The code of the key that was released.time - The number of milliseconds since the device was turned on.
true if event was consumed, false otherwise.
protected boolean navigationClick(int status,
int time)
The system invokes this method when passing on a navigational click event.
The ALT-click combination will enter selection mode, or if in selection mode will copy.
The source of the navigation event can be determined by checking the
KeypadListener.STATUS_TRACKWHEEL and
KeypadListener.STATUS_FOUR_WAY
bits of the status parameter; exactly one of them will be set.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
navigationClick in class Managerstatus - A bitfield of values defined by
KeypadListener.time - The number of milliseconds since the device was turned on.
true if event was consumed, 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.
Prompts the PaneManagerController associated with this view to process the input event.
If the controller does not consume this event, the view passes the event to its
contents.
navigationMovement in class Managerdx - The magnitude of navigational motion: negative for a move left
and positive for a move right.dy - The magnitude of navigational motion: negative for an upwards
move, and positive for a downwards move.status - A bitfield of values defined by
KeypadListener.time - The number of milliseconds since the device was turned on.
true if event was consumed, false otherwise.public boolean isAnimating()
Indicates if this view is currently animating the transition between panes.
true if the view is currently animating the transition between panes,
false if the view is not currently animating the transition between pane.
public void jumpTo(int index,
int direction)
Causes this view to move from the currently selected pane to
the pane at the index provided. The direction is used to control the
animation of the change from the currently selected pane to the new pane.
index - The index of the pane to select.direction - The control value for the animation to take place PaneManagerView.DIRECTION_BACKWARDS,
PaneManagerView.DIRECTION_FADE_IN, PaneManagerView.DIRECTION_FORWARDS, PaneManagerView.DIRECTION_NONE
IllegalArgumentException - if the index is invalid.
public void replace(Field oldField,
Field newField)
This view does not support direct manipulation of its contents. The view is intended for the displaying of provided contents with a paired header.
Additional content can be added to the
PaneManagerModel associated to this view.
replace in class ManageroldField - This parameter is ignored.newField - This parameter is ignored.
UnsupportedOperationExceptionManager.delete(Field),
Manager.insert(Field, int),
Field.getIndex(),
Field.getManager(),
Field.setFocus()public void setAnimationDuration(int duration)
Specifies animation duration. This is applied to all animations controlled by this view.
duration - The duration (in milliseconds) of animated transitions.
IllegalArgumentException - if specified duration is less than 0 milliseconds.public void setController(PaneManagerController controller)
Sets the controller for this view. The controller handles all user input.
controller - The PaneManagerController to associate with this view.public void setDelegate(Manager delegate)
Sets an optional Manager to
handle the layout of the TitleView
and PaneView.
delegate - The Manager to use as the delegate for this
view.public void setModel(PaneManagerModel model)
Sets the model to this view, as well as to the TitleView and PaneView view associated to this view.
The model contains the set of Pane objects that this view should present.
model - The PaneManagerModel to use as the Model for this view.public void setOverriddenTitle(TitleView title)
Sets an optional TitleView to provide a customized rendering in place of the titles contained within
the associated PaneManagerModel.
This can be removed by PaneManagerView.clearOverriddenTitle().
title - The TitleView that will be an override for rendering.
Providing null is the same as calling
PaneManagerView.clearOverriddenTitle().public void setPane(PaneView pane)
Sets the PaneView asssociated with this view. Lets you update the PaneView after creation
of this view.
pane - The PaneView to use for layout and rendering of the content of panes.
IllegalArgumentException - if pane is null.public void setTitle(TitleView title)
Sets the TitleView asssociated with this view. This lets you update the TitleView after creating
this PaneManagerView.
title - The TitleView to use for layout and rendering of titles.
IllegalArgumentException - if title is null.public void snapToCurrent(int direction)
Moves the currently selected pane back to its
default layout position. This reverts any offsets applied by calling
PaneManagerView.drag(int, int).
Also resets the titles to the default position corresponding to the currently selected pane.
The transition animates in the specified direction.
If the view has been offset by calling PaneManagerView.drag(int, int) then this
method will make the pane appear to bounce.
direction - An animation control flag indicating which direction the panes should move
with respect to the model: PaneManagerView.DIRECTION_BACKWARDS, PaneManagerView.DIRECTION_FADE_IN,
PaneManagerView.DIRECTION_FORWARDS, PaneManagerView.DIRECTION_NONE
protected void sublayout(int width,
int height)
To create a manager with custom layout features, extend the Manager class and implement this method.
Invoking the sublayout method prompts your manager subclass to lay out its fields.
Manager.layout(int, int) invokes this method to perform custom layout handling.
A manager must call setPositionChild for each child during sublayout.
Note that setExtent must also be called,
but it is the field's responsibility to do this in layout.
sublayout in class Managerwidth - The width available for this manager.height - The 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 x, y 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 controller does not consume this event the view passes the event to its contents.
touchEvent in class Managermessage - The TouchEvent object containing various input parameters
including the event type and touch coordinates.
true if this method consumes the event,
false otherwise.
|
|||||||||
| 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