net.rim.device.api.ui.extension.container
Class EyelidFieldManager

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.Manager
          extended by net.rim.device.api.ui.container.AbsoluteFieldManager
              extended by net.rim.device.api.ui.extension.container.EyelidFieldManager

public class EyelidFieldManager
extends AbsoluteFieldManager

A manager that allows fields to be placed in two eyelids that slide onto the screen on demand. This eye blink displays fields along the top and bottom of the screen for a short period of time (the default is 1.2 seconds) before they are pulled out in an un-blinking animation. Any user input (trackball/keyboard/touch-screen/tilt) will cause the eyelids to close for a short time period as defined by EyelidFieldManager.setEyelidDisplayTime(int).

There are top and bottom eyelids which both contain a VerticalFieldManager to which Fields can be added using the EyelidFieldManager.addTop(Field) and EyelidFieldManager.addBottom(Field) methods.

Fields can also be added to absolute positions using AbsoluteFieldManager.add(Field, int, int). Note that the fields placed in absolute positions will not be pulled from the screen when the eyelids open.

Since:
BlackBerry API 5.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
EyelidFieldManager()
          Constructs a new EyelidFieldManager.
 
Method Summary
 void add(Field field)
          Adds a field to the bottom eyelid.
 void addBottom(Field field)
          Adds a field to the bottom eyelid.
 void addTop(Field field)
          Adds a field to the top eyelid.
 VerticalFieldManager getBottomEyelid()
          Gets the bottom eyelid.
 VerticalFieldManager getTopEyelid()
          Gets the top eyelid.
protected  boolean keyChar(char key, int status, int time)
          Displays the eyelids before delegating the key event to the focused field.
protected  boolean navigationClick(int status, int time)
          Displays the eyelids before delegating the click event to the focused field.
protected  boolean navigationMovement(int dx, int dy, int status, int time)
          Displays the eyelids before delegating the move event to the focused field.
protected  void onVisibilityChange(boolean visible)
          This method is called when the field's visibility changes.
protected  void paint(Graphics graphics)
          Invoked by the framework to redraw a portion of this field.
 void setBottomBackground(Background bg)
          Sets the background on the bottom eyelid.
 void setEyelidDisplayTime(int millis)
          Sets the length of time the eyelids will remain visible.
 void setEyelidsVisible(boolean visible)
          Any user input (trackball/keyboard/touch-screen) will "blink" the fields back onto the screen for a short time period as defined by EyelidFieldManager.setEyelidDisplayTime(int) - you do NOT need to explicitly call this method, the delegation of user events by mangers to their fields is used to implicitly call this under normal operation.
 void setTopBackground(Background bg)
          Sets the background on the top eyelid.
 void showOnInput(boolean enabled)
          Sets whether or not the eyelids will appear in response to user input.
protected  void sublayout(int width, int height)
          Implements custom layout features for this manager.
protected  boolean touchEvent(TouchEvent message)
          Displays the eyelids before delegating the touch event to the focused field.
 
Methods inherited from class net.rim.device.api.ui.Manager
addAll, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, getVisibleHeight, getVisibleWidth, insert, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationUnclick, nextFocus, nextFocus, onFocus, onUndisplay, onUnfocus, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setHorizontalScroll, setHorizontalScroll, setPositionChild, setScrollListener, setScrollingInertial, setVerticalQuantization, setVerticalScroll, setVirtualExtent, subpaint, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getOriginal, getPreferredHeight, getPreferredWidth, getScreen, getStyle, getTop, getVisualState, getWidth, invalidateAll, isEditable, isFocus, isPasteable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onDisplay, onExposed, onMenuDismissed, onMenuDismissed, onObscured, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setEditable, setExtent, setFocus, setFocusListener, setFont, setMuddy, setNonSpellCheckable, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

EyelidFieldManager

public EyelidFieldManager()
Constructs a new EyelidFieldManager.

Since:
BlackBerry API 5.0.0


Method Detail

addTop

public void addTop(Field field)
Adds a field to the top eyelid. Provided a field, this method invokes Manager.add(net.rim.device.api.ui.Field) on this manager's top eyelid manager, prompting it to add the field.

Parameters:
field - The field to add.
Throws:
NullPointerException - If field is null.
IllegalStateException - If the field has already been added to a manager.
IllegalArgumentException - If the field is being added to itself.
Since:
BlackBerry API 5.0.0

addBottom

public void addBottom(Field field)
Adds a field to the bottom eyelid. Provided a field, this method invokes Manager.add(net.rim.device.api.ui.Field) on this manager's bottom eyelid manager, prompting it to add the field.

Parameters:
field - The field to add.
Throws:
NullPointerException - If field is null.
IllegalStateException - If the field has already been added to a manager.
IllegalArgumentException - If the field is being added to itself.
Since:
BlackBerry API 5.0.0

add

public void add(Field field)
Adds a field to the bottom eyelid. Provided a field, this method invokes Manager.add(net.rim.device.api.ui.Field) on this manager's bottom eyelid manager, prompting it to add the field. This is the equivalent of calling addBottom(Field).

Overrides:
add in class Manager
Parameters:
field - The field to add.
Throws:
NullPointerException - If field is null.
IllegalStateException - If the field has already been added to a manager.
IllegalArgumentException - If the field is being added to itself.
See Also:
EyelidFieldManager.addBottom(Field)
Since:
BlackBerry API 5.0.0

sublayout

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

Overrides:
sublayout in class AbsoluteFieldManager
Parameters:
width - Width available for this manager.
height - Height available for this manager.
See Also:
Manager.sublayout(int, int)
Since:
BlackBerry API 5.0.0

setEyelidsVisible

public void setEyelidsVisible(boolean visible)
Any user input (trackball/keyboard/touch-screen) will "blink" the fields back onto the screen for a short time period as defined by EyelidFieldManager.setEyelidDisplayTime(int) - you do NOT need to explicitly call this method, the delegation of user events by mangers to their fields is used to implicitly call this under normal operation. This method is exposed (public) only to accommodate any special cases that may arise.

Since:
BlackBerry API 5.0.0

setEyelidDisplayTime

public void setEyelidDisplayTime(int millis)
Sets the length of time the eyelids will remain visible. If 0 is passed to this method, the eyelids will remain visable until such time as they are hidden by calling setEyelidsVisible(false).

Parameters:
millis - the duration in milliseconds
Throws:
IllegalArgumentException - if millis < 0.
See Also:
EyelidFieldManager.setEyelidsVisible(boolean)
Since:
BlackBerry API 5.0.0

paint

protected void paint(Graphics graphics)
Invoked by the framework to redraw a portion of this field.

Overrides:
paint in class Manager
Parameters:
graphics - Graphics context for drawing this field.
See Also:
Field.paint(Graphics)
Since:
BlackBerry API 5.0.0

keyChar

protected boolean keyChar(char key,
                          int status,
                          int time)
Displays the eyelids before delegating the key event to the focused field.

Overrides:
keyChar in class Manager
Parameters:
key - Character generated.
status - Modifier key status.
time - Number of milliseconds since the device was turned on.
Returns:
True if event was consumed; otherwise, returns false.
See Also:
Manager.keyChar(char, int, int)
Since:
BlackBerry API 5.0.0

navigationClick

protected boolean navigationClick(int status,
                                  int time)
Displays the eyelids before delegating the click event to the focused field.

Overrides:
navigationClick in class Manager
Parameters:
status - Bitfield of values defined by KeypadListener.
time - Number of milliseconds since the device was turned on.
Returns:
True if this method consumed the event; otherwise, false.
See Also:
Manager.navigationClick(int, int)
Since:
BlackBerry API 5.0.0

navigationMovement

protected boolean navigationMovement(int dx,
                                     int dy,
                                     int status,
                                     int time)
Displays the eyelids before delegating the move event to the focused field.

Overrides:
navigationMovement in class Manager
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 event was consumed; otherwise, false.
See Also:
Manager.navigationMovement(int, int, int, int)
Since:
BlackBerry API 5.0.0

touchEvent

protected boolean touchEvent(TouchEvent message)
Displays the eyelids before delegating the touch event to the focused field.

Overrides:
touchEvent in class Manager
Parameters:
message - TouchEvent object containing various input parameters including the event type and touch coordinates.
Returns:
True if event consumed; otherwise, false.
See Also:
Manager.touchEvent(TouchEvent)
Since:
BlackBerry API 5.0.0

onVisibilityChange

protected void onVisibilityChange(boolean visible)
This method is called when the field's visibility changes.

Overrides:
onVisibilityChange in class Field
Parameters:
visible - True if the field has just become visible; otherwise, false.
See Also:
Screen.onDisplay(), Screen.onExposed(), Screen.onObscured(), Screen.onUiEngineAttached(boolean)
Since:
BlackBerry API 5.0.0

setBottomBackground

public void setBottomBackground(Background bg)
Sets the background on the bottom eyelid. By default, the background is set to a black SolidTransparentBackground with a 150 alpha value. Setting the background to null will reset it back to the default background.

Parameters:
bg - the background to use for the bottom eyelid, null to use default background.
Since:
BlackBerry API 5.0.0

setTopBackground

public void setTopBackground(Background bg)
Sets the background on the top eyelid. By default, the background is set to a black SolidTransparentBackground with a 150 alpha value. Setting the background to null will reset it back to the default background.

Parameters:
bg - the background to use for the top eyelid, null to use default background.
Since:
BlackBerry API 5.0.0

showOnInput

public void showOnInput(boolean enabled)
Sets whether or not the eyelids will appear in response to user input.

Parameters:
show - if true, the eyelids will appear, if false, the eyelids will not appear.
See Also:
EyelidFieldManager.setEyelidsVisible(boolean)
Since:
BlackBerry API 5.0.0

getBottomEyelid

public VerticalFieldManager getBottomEyelid()
Gets the bottom eyelid. This is a convenience method to allow greater customization of the eyelid.

Returns:
The bottom eyelid.
Since:
BlackBerry API 5.0.0

getTopEyelid

public VerticalFieldManager getTopEyelid()
Gets the top eyelid. This is a convenience method to allow greater customization of the eyelid.

Returns:
The top eyelid.
Since:
BlackBerry API 5.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.