de.enough.polish.blackberry.ui
Class BaseScreen

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.Screen
                  extended by net.rim.device.api.ui.container.FullScreen
                      extended by de.enough.polish.blackberry.ui.BaseScreen
All Implemented Interfaces:
net.rim.device.api.ui.AdjustmentListener

public abstract class BaseScreen
extends net.rim.device.api.ui.container.FullScreen

Provides the base screen / displayable implementation for BlackBerry devices.

Since:
J2ME Polish 2.1
Author:
robert virkus, j2mepolish@enough.de

Field Summary
 Item currentItem
           
protected  boolean isLastEventProcessed
           
 
Fields inherited from class net.rim.device.api.ui.Screen
DEFAULT_CLOSE, DEFAULT_MENU, NO_SYSTEM_MENU_ITEMS
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLL_MASK, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_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_SCROLL_MASK, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_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
protected BaseScreen()
          Constructs a new Canvas object.
protected BaseScreen(net.rim.device.api.ui.Manager manager, long style)
          Constructs a new Canvas object.
 
Method Summary
 void addCommand(Command cmd)
           
 void addPermanentNativeItem(Item item)
           
 void clearPermanentNativeItems()
           
protected  boolean focusChangeNeeded(net.rim.device.api.ui.Field field)
           
 boolean forwardEventToNativeField(Screen screen, int keyCode)
          Decides if a key command should be forwarded to the currently focused native BlackBerry field of this screen.
 int getGameAction(int keyCode)
          Gets the game action associated with the given key code of the device.
 int getKeyCode(int gameAction)
          Gets a key code that corresponds to the specified game action on the device.
 String getKeyName(int keyCode)
          Gets an informative key string for a key.
 boolean handlePointerTouchDown(int x, int y)
          Deprecated. as BlackBerry used to differentiate between click and touch only on its first Storm model
 boolean handlePointerTouchUp(int x, int y)
          Deprecated. as BlackBerry used to differentiate between click and touch only on its first Storm model
 boolean hasPointerEvents()
          Checks if the platform supports pointer press and release events.
 boolean hasPointerMotionEvents()
          Checks if the platform supports pointer motion events (pointer dragged).
 boolean hasRepeatEvents()
          Checks if the platform can generate repeat events when key is kept down.
protected  void hideNotify()
          The implementation calls hideNotify() shortly after the Canvas has been removed from the display.
 boolean isDoubleBuffered()
          Checks if the Canvas is double buffered by the implementation.
 boolean isNativeUiShownFor(Item item)
          Determines whether a native UI component is shown for the specified item.
 boolean isShown()
          Determines whether this screen is shown
protected  boolean keyDown(int keyCode, int time)
           
protected  void keyPressed(int keyCode)
          Called when a key is pressed.
protected  void keyReleased(int keyCode)
          Called when a key is released.
protected  boolean keyRepeat(int keyCode, int time)
           
protected  void keyRepeated(int keyCode)
          Called when a key is repeated (held down).
protected  boolean keyUp(int keyCode, int time)
           
protected  void makeContextMenu(net.rim.device.api.ui.ContextMenu menu)
           
protected  void makeMenu(net.rim.device.api.ui.component.Menu menu, int instance)
           
protected  boolean navigationClick(int status, int time)
           
protected  boolean navigationMovement(int dx, int dy, int status, int time)
           
protected  boolean navigationUnclick(int status, int time)
           
 void notifyDisplayableChange(Displayable currentDisplayable, Displayable nextDisplayable)
           
 void notifyFocusSet(Item item)
          Notifies this screen about the new item that is focused on BlackBerry platforms.
 void notifyFocusSet(Item item, boolean repeatSync)
          Focuses an item and it's corresponding blackberry field if available.
protected  void onDisplay()
           
protected  void onExposed()
           
 boolean onMenu(int instance)
           
protected  void onMenuDismissed(net.rim.device.api.ui.component.Menu m)
           
protected  void onObscured()
           
protected  void onUiEngineAttached(boolean attached)
           
protected  void onUndisplay()
           
protected abstract  void paint(Graphics g)
          Renders the Canvas.
protected  void paintBackground(net.rim.device.api.ui.Graphics g)
           
protected  void pointerDragged(int x, int y)
          Called when the pointer is dragged.
protected  void pointerPressed(int x, int y)
          Called when the pointer is pressed.
protected  void pointerReleased(int x, int y)
          Called when the pointer is released.
 void removeCommand(Command cmd)
           
 void removePermanentNativeItem(Item item)
          Notifies this screen about an item with a native componen that is removed on BlackBerry platforms.
 void repaint()
          Requests a repaint for the entire Canvas.
 void repaint(int x, int y, int width, int height)
          Requests a repaint for the specified region of the Canvas.
 void serviceRepaints()
          Forces any pending repaint requests to be serviced immediately.
 void setCommandListener(CommandListener l)
           
 void setFullScreenMode(boolean mode)
          Controls whether the Canvas is in full-screen mode or in normal mode.
 void setIgnoreObscureEvent(boolean ignore)
           
 void setTitle(String title)
           
protected  void showNotify()
          The implementation calls showNotify() immediately prior to this Canvas being made visible on the display.
protected  void sizeChanged(int w, int h)
          Called when the drawable area of the Canvas has been changed.
protected  void sublayout(int width, int height)
           
protected  boolean touchEvent(net.rim.device.api.ui.TouchEvent message)
          Handles BlackBerry touch events.
protected  boolean trackwheelRoll(int amount, int status, int time)
           
 
Methods inherited from class net.rim.device.api.ui.Screen
add, addInputSettings, addKeyListener, addScreenUiEngineAttachedListener, addTrackwheelListener, clearInputSettings, close, delete, deleteRange, doPaint, ensureRegionVisible, getAccessibleContext, getApplication, getContextMenuProvider, getDefaultMenuItem, getDelegate, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getGraphics, getInputHelper, getInputSettings, getLeafFieldWithFocus, getMenu, getScreenAbove, getScreenBelow, getTitleBar, getUiEngine, getVirtualKeyboard, insert, invalidate, invalidate, invalidateAll, invalidateLayout, invokeAction, isDataValid, isDirty, isDisplayed, isFocus, isFocusable, isGlobal, isGlobalStatus, isMuddy, isSelecting, keyChar, keyCharUnhandled, keyControl, keyStatus, layoutDelegate, onClose, onFocus, onFocusNotify, onMenuDismissed, onSave, onSavePrompt, onUnfocus, openDevelopmentBackdoor, openProductionBackdoor, paint, removeFocus, removeInputSettings, removeKeyListener, removeScreenUiEngineAttachedListener, removeTrackwheelListener, replace, save, scroll, setBackdoorAltStatus, setContextMenuProvider, setDefaultClose, setDirty, setFocus, setFocus, setHorizontalQuantization, setInputHelper, setPositionDelegate, setTitleBar, setTrackballFilter, setTrackballSensitivityXOffset, setTrackballSensitivityYOffset, setVerticalQuantization, trackwheelClick, trackwheelClickUnhandled, trackwheelUnclick, updateDisplay
 
Methods inherited from class net.rim.device.api.ui.Manager
addAll, deleteAll, getHorizontalScroll, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, insertAll, invalidateFieldRange, isDownArrowShown, isUpArrowShown, isValidLayout, layout, layoutChild, moveFocus, moveFocus, nextFocus, nextFocus, paintChild, setFieldWithFocus, setFocus, setPositionChild, setScrollingInertial, setVirtualExtent, subpaint
 
Methods inherited from class net.rim.device.api.ui.ScrollView
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling
 
Methods inherited from class net.rim.device.api.ui.Field
applyTheme, assertHaveEventLock, drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusChangeNotify, 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, getState, getStyle, getTop, getVisualState, getWidth, isEditable, isEnabled, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocusListener, setFont, setMargin, setMargin, setMinimalWidth, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentItem

public Item currentItem

isLastEventProcessed

protected boolean isLastEventProcessed
Constructor Detail

BaseScreen

protected BaseScreen()
Constructs a new Canvas object.


BaseScreen

protected BaseScreen(net.rim.device.api.ui.Manager manager,
                     long style)
Constructs a new Canvas object.

Method Detail

isDoubleBuffered

public boolean isDoubleBuffered()
Checks if the Canvas is double buffered by the implementation.

Returns:
true if double buffered, false otherwise

hasPointerEvents

public boolean hasPointerEvents()
Checks if the platform supports pointer press and release events.

Returns:
true if the device supports pointer events

hasPointerMotionEvents

public boolean hasPointerMotionEvents()
Checks if the platform supports pointer motion events (pointer dragged). Applications may use this method to determine if the platform is capable of supporting motion events.

Returns:
true if the device supports pointer motion events

hasRepeatEvents

public boolean hasRepeatEvents()
Checks if the platform can generate repeat events when key is kept down.

Returns:
true if the device supports repeat events

getKeyCode

public int getKeyCode(int gameAction)
Gets a key code that corresponds to the specified game action on the device. The implementation is required to provide a mapping for every game action, so this method will always return a valid key code for every game action. See above for further discussion of game actions. There may be multiple keys associated with the same game action; however, this method will return only one of them. Applications should translate the key code of every key event into a game action using getGameAction(int) and then interpret the resulting game action, instead of generating a table of key codes at using this method during initialization.

The mapping between key codes and game actions will not change during the execution of the application.

Parameters:
gameAction - - the game action
Returns:
a key code corresponding to this game action
Throws:
IllegalArgumentException - - if gameAction is not a valid game action

getKeyName

public String getKeyName(int keyCode)
Gets an informative key string for a key. The string returned will resemble the text physically printed on the key. This string is suitable for displaying to the user. For example, on a device with function keys F1 through F4, calling this method on the keyCode for the F1 key will return the string "F1". A typical use for this string will be to compose help text such as "Press F1 to proceed."

This method will return a non-empty string for every valid key code.

There is no direct mapping from game actions to key names. To get the string name for a game action GAME_A, the application must call


 getKeyName(getKeyCode(GAME_A));    

Parameters:
keyCode - - the key code being requested
Returns:
a string name for the key
Throws:
IllegalArgumentException - - if keyCode is not a valid key code

getGameAction

public int getGameAction(int keyCode)
Gets the game action associated with the given key code of the device. Returns zero if no game action is associated with this key code. See above for further discussion of game actions.

The mapping between key codes and game actions will not change during the execution of the application.

Parameters:
keyCode - - the key code
Returns:
the game action corresponding to this key, or 0 if none
Throws:
IllegalArgumentException - - if keyCode is not a valid key code

setFullScreenMode

public void setFullScreenMode(boolean mode)
Controls whether the Canvas is in full-screen mode or in normal mode.

Parameters:
mode - true if the Canvas is to be in full screen mode, false otherwise
Since:
MIDP 2.0

keyPressed

protected void keyPressed(int keyCode)
Called when a key is pressed.

The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.

Parameters:
keyCode - - the key code of the key that was pressed

keyRepeated

protected void keyRepeated(int keyCode)
Called when a key is repeated (held down).

The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.

Parameters:
keyCode - - the key code of the key that was repeated
See Also:
hasRepeatEvents()

keyReleased

protected void keyReleased(int keyCode)
Called when a key is released.

The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.

Parameters:
keyCode - - the key code of the key that was released

pointerPressed

protected void pointerPressed(int x,
                              int y)
Called when the pointer is pressed.

The hasPointerEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.

Parameters:
x - - the horizontal location where the pointer was pressed (relative to the Canvas)
y - - the vertical location where the pointer was pressed (relative to the Canvas)

pointerReleased

protected void pointerReleased(int x,
                               int y)
Called when the pointer is released.

The hasPointerEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.

Parameters:
x - - the horizontal location where the pointer was released (relative to the Canvas)
y - - the vertical location where the pointer was released (relative to the Canvas)

pointerDragged

protected void pointerDragged(int x,
                              int y)
Called when the pointer is dragged.

The hasPointerMotionEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.

Parameters:
x - - the horizontal location where the pointer was dragged (relative to the Canvas)
y - - the vertical location where the pointer was dragged (relative to the Canvas)

handlePointerTouchDown

public boolean handlePointerTouchDown(int x,
                                      int y)
Deprecated. as BlackBerry used to differentiate between click and touch only on its first Storm model

Handles a touch down/press event. This is similar to a pointerPressed event, however it is only available on devices with screens that differentiate between press and touch events (read: BlackBerry Storm).

Parameters:
x - the absolute horizontal pixel position of the touch event
y - the absolute vertical pixel position of the touch event
Returns:
true when the event was handled

handlePointerTouchUp

public boolean handlePointerTouchUp(int x,
                                    int y)
Deprecated. as BlackBerry used to differentiate between click and touch only on its first Storm model

Handles a touch up/release event. This is similar to a pointerReleased event, however it is only available on devices with screens that differentiate between press and touch events (read: BlackBerry Storm).

Parameters:
x - the absolute horizontal pixel position of the touch event
y - the absolute vertical pixel position of the touch event
Returns:
true when the event was handled

repaint

public final void repaint(int x,
                          int y,
                          int width,
                          int height)
Requests a repaint for the specified region of the Canvas. Calling this method may result in subsequent call to paint(), where the passed Graphics object's clip region will include at least the specified region.

If the canvas is not visible, or if width and height are zero or less, or if the rectangle does not specify a visible region of the display, this call has no effect.

The call to paint() occurs asynchronously of the call to repaint(). That is, repaint() will not block waiting for paint() to finish. The paint() method will either be called after the caller of repaint() returns to the implementation (if the caller is a callback) or on another thread entirely.

To synchronize with its paint() routine, applications can use either Display.callSerially() or serviceRepaints(), or they can code explicit synchronization into their paint() routine.

The origin of the coordinate system is above and to the left of the pixel in the upper left corner of the displayable area of the Canvas. The X-coordinate is positive right and the Y-coordinate is positive downwards.

Parameters:
x - - the x coordinate of the rectangle to be repainted
y - - the y coordinate of the rectangle to be repainted
width - - the width of the rectangle to be repainted
height - - the height of the rectangle to be repainted
See Also:
Display.callSerially(Runnable), serviceRepaints()

repaint

public final void repaint()
Requests a repaint for the entire Canvas. The effect is identical to

repaint(0, 0, getWidth(), getHeight());


serviceRepaints

public final void serviceRepaints()
Forces any pending repaint requests to be serviced immediately. This method blocks until the pending requests have been serviced. If there are no pending repaints, or if this canvas is not visible on the display, this call does nothing and returns immediately.

Warning: This method blocks until the call to the application's paint() method returns. The application has no control over which thread calls paint(); it may vary from implementation to implementation. If the caller of serviceRepaints() holds a lock that the paint() method acquires, this may result in deadlock. Therefore, callers of serviceRepaints() must not hold any locks that might be acquired within the paint() method. The Display.callSerially() method provides a facility where an application can be called back after painting has completed, avoiding the danger of deadlock.

See Also:
Display.callSerially(Runnable)

showNotify

protected void showNotify()
The implementation calls showNotify() immediately prior to this Canvas being made visible on the display. Canvas subclasses may override this method to perform tasks before being shown, such as setting up animations, starting timers, etc.


hideNotify

protected void hideNotify()
The implementation calls hideNotify() shortly after the Canvas has been removed from the display. Canvas subclasses may override this method in order to pause animations, revoke timers, etc. The default implementation of this method in class Canvas is empty.


paint

protected abstract void paint(Graphics g)
Renders the Canvas. The application must implement this method in order to paint any graphics.

The Graphics object's clip region defines the area of the screen that is considered to be invalid. A correctly-written paint() routine must paint every pixel within this region. This is necessary because the implementation is not required to clear the region prior to calling paint() on it. Thus, failing to paint every pixel may result in a portion of the previous screen image remaining visible.

Applications must not assume that they know the underlying source of the paint() call and use this assumption to paint only a subset of the pixels within the clip region. The reason is that this particular paint() call may have resulted from multiple repaint() requests, some of which may have been generated from outside the application. An application that paints only what it thinks is necessary to be painted may display incorrectly if the screen contents had been invalidated by, for example, an incoming telephone call.

Operations on this graphics object after the paint() call returns are undefined. Thus, the application must not cache this Graphics object for later use or use by another thread. It must only be used within the scope of this method.

The implementation may postpone visible effects of graphics operations until the end of the paint method.

The contents of the Canvas are never saved if it is hidden and then is made visible again. Thus, shortly after showNotify() is called, paint() will always be called with a Graphics object whose clip region specifies the entire displayable area of the Canvas. Applications must not rely on any contents being preserved from a previous occasion when the Canvas was current. This call to paint() will not necessarily occur before any other key or pointer methods are called on the Canvas. Applications whose repaint recomputation is expensive may create an offscreen Image, paint into it, and then draw this image on the Canvas when paint() is called.

The application code must never call paint(); it is called only by the implementation.

The Graphics object passed to the paint() method has the following properties:

Parameters:
g - - the Graphics object to be used for rendering the Canvas

sizeChanged

protected void sizeChanged(int w,
                           int h)
Called when the drawable area of the Canvas has been changed. This method has augmented semantics compared to Displayable.sizeChanged.

In addition to the causes listed in Displayable.sizeChanged, a size change can occur on a Canvas because of a change between normal and full-screen modes.

If the size of a Canvas changes while it is actually visible on the display, it may trigger an automatic repaint request. If this occurs, the call to sizeChanged will occur prior to the call to paint. If the Canvas has become smaller, the implementation may choose not to trigger a repaint request if the remaining contents of the Canvas have been preserved. Similarly, if the Canvas has become larger, the implementation may choose to trigger a repaint only for the new region. In both cases, the preserved contents must remain stationary with respect to the origin of the Canvas. If the size change is significant to the contents of the Canvas, the application must explicitly issue a repaint request for the changed areas. Note that the application's repaint request should not cause multiple repaints, since it can be coalesced with repaint requests that are already pending.

If the size of a Canvas changes while it is not visible, the implementation may choose to delay calls to sizeChanged until immediately prior to the call to showNotify. In that case, there will be only one call to sizeChanged, regardless of the number of size changes.

An application that is sensitive to size changes can update instance variables in its implementation of sizeChanged. These updated values will be available to the code in the showNotify, hideNotify, and paint methods.

Parameters:
w - - the new width in pixels of the drawable area of the Canvas
h - - the new height in pixels of the drawable area of the Canvas
Since:
MIDP 2.0
See Also:
in class Displayable

paintBackground

protected void paintBackground(net.rim.device.api.ui.Graphics g)
Overrides:
paintBackground in class net.rim.device.api.ui.Screen

onExposed

protected void onExposed()
Overrides:
onExposed in class net.rim.device.api.ui.Screen

onObscured

protected void onObscured()
Overrides:
onObscured in class net.rim.device.api.ui.Screen

onUiEngineAttached

protected void onUiEngineAttached(boolean attached)
Overrides:
onUiEngineAttached in class net.rim.device.api.ui.Screen

onDisplay

protected void onDisplay()
Overrides:
onDisplay in class net.rim.device.api.ui.Screen

onUndisplay

protected void onUndisplay()
Overrides:
onUndisplay in class net.rim.device.api.ui.Screen

sublayout

protected void sublayout(int width,
                         int height)
Overrides:
sublayout in class net.rim.device.api.ui.container.FullScreen

onMenu

public boolean onMenu(int instance)
Overrides:
onMenu in class net.rim.device.api.ui.Screen

onMenuDismissed

protected void onMenuDismissed(net.rim.device.api.ui.component.Menu m)
Overrides:
onMenuDismissed in class net.rim.device.api.ui.Screen

trackwheelRoll

protected boolean trackwheelRoll(int amount,
                                 int status,
                                 int time)
Overrides:
trackwheelRoll in class net.rim.device.api.ui.Screen

keyDown

protected boolean keyDown(int keyCode,
                          int time)
Overrides:
keyDown in class net.rim.device.api.ui.Screen

forwardEventToNativeField

public boolean forwardEventToNativeField(Screen screen,
                                         int keyCode)
Decides if a key command should be forwarded to the currently focused native BlackBerry field of this screen.

Parameters:
screen - this canvas as a J2ME Polish Screen
keyCode - the blackberry key code
Returns:
true when the event should be forwarded

keyUp

protected boolean keyUp(int keyCode,
                        int time)
Overrides:
keyUp in class net.rim.device.api.ui.Screen

keyRepeat

protected boolean keyRepeat(int keyCode,
                            int time)
Overrides:
keyRepeat in class net.rim.device.api.ui.Screen

touchEvent

protected boolean touchEvent(net.rim.device.api.ui.TouchEvent message)
Handles BlackBerry touch events.

Overrides:
touchEvent in class net.rim.device.api.ui.Screen
Parameters:
message - the touch event
Returns:
true when the event was handled

isShown

public boolean isShown()
Determines whether this screen is shown

Returns:
true when this screen is currently being shown.

notifyFocusSet

public void notifyFocusSet(Item item)
Notifies this screen about the new item that is focused on BlackBerry platforms. This is only called for BlackBerry platforms - check for the preprocesing symbol polish.blackberry.

Parameters:
item - the item that has been focused

notifyFocusSet

public void notifyFocusSet(Item item,
                           boolean repeatSync)
Focuses an item and it's corresponding blackberry field if available. If not native blackberry field is asscociated with the item, the internal dummy item will be focused.

Parameters:
item - the item that is focused
repeatSync - true when the access should be tried synchronized again when the first trial fails

isNativeUiShownFor

public boolean isNativeUiShownFor(Item item)
Determines whether a native UI component is shown for the specified item. This is currently only implemented for BlackBerry platforms - check for the preprocesing symbol polish.blackberry.

Parameters:
item - the item that has been focused

removePermanentNativeItem

public void removePermanentNativeItem(Item item)
Notifies this screen about an item with a native componen that is removed on BlackBerry platforms. This is only called for BlackBerry platforms - check for the preprocesing symbol polish.blackberry.

Parameters:
item - the item with a native component which was displayed all the time.

addPermanentNativeItem

public void addPermanentNativeItem(Item item)

clearPermanentNativeItems

public void clearPermanentNativeItems()

navigationClick

protected boolean navigationClick(int status,
                                  int time)
Overrides:
navigationClick in class net.rim.device.api.ui.Screen

navigationUnclick

protected boolean navigationUnclick(int status,
                                    int time)
Overrides:
navigationUnclick in class net.rim.device.api.ui.Screen

focusChangeNeeded

protected boolean focusChangeNeeded(net.rim.device.api.ui.Field field)

navigationMovement

protected boolean navigationMovement(int dx,
                                     int dy,
                                     int status,
                                     int time)
Overrides:
navigationMovement in class net.rim.device.api.ui.Screen

notifyDisplayableChange

public void notifyDisplayableChange(Displayable currentDisplayable,
                                    Displayable nextDisplayable)

addCommand

public void addCommand(Command cmd)

removeCommand

public void removeCommand(Command cmd)

makeMenu

protected void makeMenu(net.rim.device.api.ui.component.Menu menu,
                        int instance)
Overrides:
makeMenu in class net.rim.device.api.ui.Screen

makeContextMenu

protected void makeContextMenu(net.rim.device.api.ui.ContextMenu menu)
Overrides:
makeContextMenu in class net.rim.device.api.ui.Field

setTitle

public void setTitle(String title)

setCommandListener

public void setCommandListener(CommandListener l)

setIgnoreObscureEvent

public void setIgnoreObscureEvent(boolean ignore)