jMobileCore toolkit

com.jmobilecore.ui.core
Class ListScreen

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by com.jmobilecore.ui.core.PlatformCanvas
              extended by com.jmobilecore.ui.core.ScreenCanvas
                  extended by com.jmobilecore.ui.core.ListScreen

public class ListScreen
extends ScreenCanvas

A ListScreen is object inherited from ScreenCanvas which allows select item from the list of items. Each item in the list must belong to the ListComponent class. It can be an instance of ListComponent or subclasses.

Author:
Greg Gridin

Field Summary
 
Fields inherited from class com.jmobilecore.ui.core.ScreenCanvas
adjustFocus, bodyOffset, CANVAS_SCROLL_STEP, components, focusedIndex, offScreen, paintAreaHeight, screenTitle, SCROLL_DOWN, SCROLL_UP, softKeyBar, softKeyBarHeight, titleHeight
 
Fields inherited from class com.jmobilecore.ui.core.PlatformCanvas
DOUBLE_BUFFER, HEIGHT, KEY_CLEAR, KEY_DOWN, KEY_ENTER, KEY_FIRE, KEY_LEFT, KEY_PHONE_OFF, KEY_PHONE_ON, KEY_RIGHT, KEY_SOFT_LEFT, KEY_SOFT_RIGHT, KEY_UNDEFINED, KEY_UP, KEY_VOLUME_DOWN, KEY_VOLUME_UP, PLATFORM, PLATFORM_BARTEO, PLATFORM_LG, PLATFORM_MOTOROLA, PLATFORM_MOTOROLA_V, PLATFORM_NOKIA, PLATFORM_NOKIA_30, PLATFORM_SAMSUNG, PLATFORM_SIEMENS, PLATFORM_SONYERICSSON, PLATFORM_SUN_WTK, WIDTH
 
Fields inherited from class javax.microedition.lcdui.Canvas
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP
 
Constructor Summary
ListScreen(Label title)
          Constructs a new list with the specified title.
ListScreen(Label title, SoftKeyBar softKeyBar)
          Creates a new ListScreen instance with specified container for soft keys
ListScreen(Label title, SoftKey leftAction, SoftKey rightAction)
          Constructs a new list with the specified title and softkeys.
 
Method Summary
 ListComponent getFocusedComponent()
          Gets the selected item on this list form.
 int getFocusedIndex()
          Gets the selected item on this list form.
 void keyPressed(int keyCode)
          Processes a press of a key.
 
Methods inherited from class com.jmobilecore.ui.core.ScreenCanvas
add, add, changeFocus, destructor, drawTriangle, getComponentsHeight, getFirstFocusable, getLastFocusable, getNextFocusable, getPreviousFocusable, getScrollDirections, paint, paintBody, paintBodyBackground, paintScroller, recalcAdjustment, refocus, remove, remove, removeAll, scrollDown, scrollTop, scrollUp
 
Methods inherited from class javax.microedition.lcdui.Canvas
getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, showNotify
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, isShown, removeCommand, setCommandListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListScreen

public ListScreen(Label title)
Constructs a new list with the specified title. Soft keys can be added later

Parameters:
title - the list's title (on screen's top)

ListScreen

public ListScreen(Label title,
                  SoftKeyBar softKeyBar)
Creates a new ListScreen instance with specified container for soft keys

Parameters:
title - Title for current screen
softKeyBar - Container for soft keys for current screen

ListScreen

public ListScreen(Label title,
                  SoftKey leftAction,
                  SoftKey rightAction)
Constructs a new list with the specified title and softkeys.

Parameters:
title - the list's title (on screen's top)
leftAction -
rightAction -
Method Detail

getFocusedComponent

public ListComponent getFocusedComponent()
Gets the selected item on this list form.

Returns:
the selected item on the list form, or null if no item is selected

getFocusedIndex

public int getFocusedIndex()
Gets the selected item on this list form.

Returns:
the selected item on the list form, or null if no item is selected

keyPressed

public void keyPressed(int keyCode)
Processes a press of a key.

Overrides:
keyPressed in class ScreenCanvas
Parameters:
keyCode - the pressed key

jMobileCore toolkit