net.rim.device.api.ui.component.pane
Class PaneView

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

public class PaneView
extends Manager

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.

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
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.Manager
add, addAll, cursorClick, cursorUnclick, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, insert, insertAll, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, nextFocus, onFocus, onUnfocus, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, touchEvent, trackwheelClick, trackwheelUnclick
 
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 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, getTextFillColor, getTextStrokeColor, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isLeftToRight, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocus, setFocusListener, setFont, 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

PaneView

public PaneView(long style)

Class constructor that accepts a long of style bit flags and sets the Field.FOCUSABLE style bit.

Parameters:
style - the style bit flags to use for this Manager
Since:
BlackBerry API 6.0.0


Method Detail

drag

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.

Parameters:
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.
Since:
BlackBerry API 6.0.0

getModel

public PaneManagerModel getModel()

Returns the PaneManagerModel associated with this view.

Returns:
the PaneManagerModel associated with this view or null if none is associated.
Since:
BlackBerry API 6.0.0

isAnimating

public boolean isAnimating()

Indicates if the view is currently animating the transition between panes.

Returns:
true if the view is currently animating the transition between panes, false otherwise.
Since:
BlackBerry API 6.0.0

jumpTo

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.

Parameters:
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 milliseconds
Since:
BlackBerry API 6.0.0

nextFocus

protected int nextFocus(int direction,
                        int axis)
Returns the index of the next field that should be given focus.

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.

Overrides:
nextFocus in class Manager
Parameters:
direction - Direction the focus is moving within the field.
axis - The axis of movement.
Returns:
Index of the next field that should receive focus, -1 if the focus should leave the manager.
Since:
BlackBerry API 6.0.0

paint

protected void paint(Graphics graphics)
Paints the visible region of this manager.

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.

Overrides:
paint in class Manager
Parameters:
graphics - Graphics object used for painting.
Since:
BlackBerry API 6.0.0

setModel

public void setModel(PaneManagerModel model)

Lets you associate a PaneManagerModel with this view.

Parameters:
model - the PaneManagerModel to associate to this view.
Throws:
IllegalArgumentException - if target is null.
Since:
BlackBerry API 6.0.0

snapToCurrent

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.

Parameters:
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 milliseconds
direction - 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.
Since:
BlackBerry API 6.0.0

sublayout

protected void sublayout(int width,
                         int maxHeight)
Implements custom layout features for this manager.

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.

Specified by:
sublayout in class Manager
Parameters:
width - Width available for this manager.
maxHeight - Height available for this manager.
Since:
BlackBerry API 6.0.0

subpaint

protected void subpaint(Graphics graphics)
Implements custom paint features for this manager. Your implementation of this method should instruct all controlled fields in your Manager to paint themselves. Optimize this method by using details of the layout to determine which fields are in the current visible region. To paint a controlled field, invoke 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.

Overrides:
subpaint in class Manager
Parameters:
graphics - Graphics object used for painting.
Since:
BlackBerry API 6.0.0





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