|
|||||||||
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.PaneView
public class PaneView
PaneView
lays out and renders
the content of Pane
objects.
This class is updated by PaneManagerModel
as the
data set is changed. The content is retrieved via Pane.getPane()
.
Only the currently selected pane content is laid out and rendered. More than one content pane is rendered only when the user drags the panes or during the animated transition between panes.
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 | ||
---|---|---|
PaneView(long style)
Class constructor that accepts a long of style bit flags and sets the Field.FOCUSABLE style bit. |
Method Summary | ||
---|---|---|
void |
drag(int dx,
int dy,
int index,
int leftIndex,
int rightIndex)
Offsets the current content pane within its pushed region. |
|
PaneManagerModel |
getModel()
Returns the PaneManagerModel associated with this view. |
|
boolean |
isAnimating()
Indicates if the view is currently animating the transition between panes. |
|
void |
jumpTo(int index,
int leftIndex,
int rightIndex,
boolean animate,
int direction,
int duration)
Causes the view to move from the currently selected pane to the pane at the index provided. |
|
protected int |
nextFocus(int direction,
int axis)
Returns the index of the next field that should be given focus. |
|
protected void |
paint(Graphics graphics)
Paints the visible region of this manager. |
|
void |
setModel(PaneManagerModel model)
Lets you associate a PaneManagerModel with this view. |
|
void |
snapToCurrent(boolean animate,
int duration,
int direction)
Causes this view to move the currently selected pane back to its default layout position. |
|
protected void |
sublayout(int width,
int maxHeight)
Implements custom layout features for this manager. |
|
protected void |
subpaint(Graphics graphics)
Implements custom paint features for this manager. |
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 |
Constructor Detail |
---|
public PaneView(long style)
Class constructor that accepts a long
of style bit flags and sets the Field.FOCUSABLE
style bit.
style
- the style bit flags to use for this Manager
Method Detail |
---|
public void drag(int dx, int dy, int index, int leftIndex, int rightIndex)
Offsets the current content pane within its pushed region. This class ignores vertical dragging, but supports the parameter for future extensions that may want to allow for vertical offsets.
Invalid indices are ignored and treated as if no content pane appears in that location.
dx
- the horizontal offset from the default position in pixels.dy
- the vertical offset from the default position in pixels - ingore in this class.index
- the index of the pane that is to be offset.leftIndex
- the index of the pane that is to appear to the left
of the pane specified by the parameter index.rightIndex
- the index of the pane that is to appear to the right
of the pane specified by the parameter index.public PaneManagerModel getModel()
Returns the PaneManagerModel
associated with this view.
PaneManagerModel
associated with this view
or null if none is associated.public boolean isAnimating()
Indicates if the view is currently animating the transition between panes.
public void jumpTo(int index, int leftIndex, int rightIndex, boolean animate, int direction, int duration)
Causes the view to move from the currently selected pane to
the pane at the index provided. The direction
parameter controls the
animation of the change from the currently selected pane to the new pane.
index
- the index of the pane to become the currently selected pane.leftIndex
- index of the content Field
to render to the left the one we are transitioning to.rightIndex
- index of the content Field
to render to the right of the one we are transitioning to.animate
- true to animate this change, false to just render the new content pane in the final position.direction
- the control value for the animation to take place PaneManagerView.DIRECTION_BACKWARDS
,
PaneManagerView.DIRECTION_FADE_IN
, PaneManagerView.DIRECTION_FORWARDS
, PaneManagerView.DIRECTION_NONE
duration
- the amount of time to animate the transition, in millisecondsprotected int nextFocus(int direction, int axis)
This method is called by the framework during a trackball focus move operation.
The direction
parameter indicates the direction in which the focus
is moving: a value of 1 indicates that the focus is moving forward
(generally down and to the right), while a value of -1 indicates that
the focus is moving backwards (generally up and to the left).
The axis
parameter indicates which axis of movement the direction is in.
This can be one of Field.AXIS_SEQUENTIAL
, Field.AXIS_HORIZONTAL
or Field.AXIS_VERTICAL
.
nextFocus
in class Manager
direction
- Direction the focus is moving within the field.axis
- The axis of movement.
protected void paint(Graphics graphics)
Invoke this method to prompt this manager to paint itself. if you
extend this manager to create a custom layout manager, you may want to
implement the PaneView.subpaint(net.rim.device.api.ui.Graphics)
method, as this method invokes it.
This method also draws the focus indicator as required.
paint
in class Manager
graphics
- Graphics object used for painting.public void setModel(PaneManagerModel model)
Lets you associate a PaneManagerModel
with this view.
model
- the PaneManagerModel
to associate to this view.
IllegalArgumentException
- if target
is null
.public void snapToCurrent(boolean animate, int duration, int direction)
Causes this view to move the currently selected pane back to its
default layout position. This undoes any offsets applied by calling
PaneView.drag(int, int, int, int, int)
.
This transition will be animated based on the specified direction
.
If the view has been offset by calling PaneView.drag(int, int, int, int, int)
then calling this
method will result in a visual effect of the pane having performed a slight bounce.
animate
- true to animate the transition
false to just change the positions of the titles.duration
- the amount of time to animate the transition, in millisecondsdirection
- the animation control for 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 maxHeight)
If implementing 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 controlled fields appropriately.
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 Manager
width
- Width available for this manager.maxHeight
- Height available for this manager.protected void subpaint(Graphics graphics)
Manager.paintChild(net.rim.device.api.ui.Graphics, net.rim.device.api.ui.Field)
.
By default, this method paints all child fields, without regard to the clipping region.
If implementing a custom manager that has requirements for special
paint handling, you can override this method for optimization:
PaneView.paint(net.rim.device.api.ui.Graphics)
invokes this method to perform custom paint functions.
subpaint
in class Manager
graphics
- Graphics object used for painting.
|
|||||||||
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