waba.ui
Class Keypad

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Keypad

public class Keypad
extends Control

This class is used to handle letters and numbers input on keypadOnly devices.

Since:
SuperWaba 5.5

Field Summary
static int CLOSE_TIMEOUT
          Amount of time until the control closes.
static java.lang.String[] defaultKeyset
          The default char set.
static int mode
          The current mode.
static int MODE_LOWER
          Used with the mode member.
static int MODE_NUMBER
          Used with the mode member.
static int MODE_UPPER
          Used with the mode member.
static java.lang.String[] numberKeyset
          Only numbers: 0 ... 9
static int X_ALIGN
          The x position of the control on screen.
static int Y_ALIGN
          The y position of the control on screen.
static int Y_ALIGN_ALT
          The y alternate position of the control on screen.
 
Fields inherited from class waba.ui.Control
AFTER, appId, appObj, asContainer, asWindow, backColor, backDis, BEFORE, BOTTOM, CENTER, clearValueInt, clearValueStr, enabled, FILL, FIT, fm, fmH, focusLess, focusTraversable, font, foreColor, foreDis, height, highlightRectsCount, isHighlighting, LEFT, parent, PREFERRED, RANGE, RIGHT, SAME, TOP, uiCE, uiFlat, uiPalm, uiVista, visible, width, x, x2, y, y2
 
Method Summary
static Keypad getInstance()
           
 void handleKey(int key)
          Called by the system to handle the pressed key
 void onEvent(Event e)
          On a timeout of the close timer, closes this control
 void onPaint(Graphics g)
          Paints this control
 void setKeys(java.lang.String[] newKeyset)
          Call this, passing a new set, to change the keys associated with each pad number.
 void setNumberKeys(java.lang.String nk)
          Call this to change the default # to a set of chars to be selected.
 
Methods inherited from class waba.ui.Control
addTimer, changeHighlighted, clear, contains, createGraphics, drawHighlight, getAbsoluteRect, getBackColor, getFont, getFontMetrics, getForeColor, getNext, getParent, getParentWindow, getPos, getPreferredHeight, getPreferredWidth, getRect, getSize, isDisplayed, isEnabled, isVisible, onBoundsChanged, onColorsChanged, onFontChanged, onWindowPaintFinished, postEvent, removeTimer, repaint, repaintNow, requestFocus, setBackColor, setBackForeColors, setEnabled, setFocusLess, setFont, setForeColor, setRect, setRect, setRect, setVisible, translateFromOrigin, uiStyleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberKeyset

public static java.lang.String[] numberKeyset
Only numbers: 0 ... 9

defaultKeyset

public static java.lang.String[] defaultKeyset
The default char set. All letters must be in lowercase

CLOSE_TIMEOUT

public static int CLOSE_TIMEOUT
Amount of time until the control closes.

X_ALIGN

public static int X_ALIGN
The x position of the control on screen. It is CENTER by default. Use only LEFT,CENTER,RIGHT constants.

Y_ALIGN

public static int Y_ALIGN
The y position of the control on screen. It is BOTTOM-3 by default. Use only TOP,CENTER,BOTTOM constants.

Y_ALIGN_ALT

public static int Y_ALIGN_ALT
The y alternate position of the control on screen. It is TOP+3 by default. Use only TOP,CENTER,BOTTOM constants.

MODE_LOWER

public static final int MODE_LOWER
Used with the mode member.

MODE_UPPER

public static final int MODE_UPPER
Used with the mode member.

MODE_NUMBER

public static final int MODE_NUMBER
Used with the mode member.

mode

public static int mode
The current mode. Use the MODE_xxx constants
Method Detail

getInstance

public static Keypad getInstance()

setKeys

public void setKeys(java.lang.String[] newKeyset)
Call this, passing a new set, to change the keys associated with each pad number. Or pass null to restore the default key set.

setNumberKeys

public void setNumberKeys(java.lang.String nk)
Call this to change the default # to a set of chars to be selected. Remember to set it to null afterward to restore the original behaviour!

handleKey

public void handleKey(int key)
Called by the system to handle the pressed key

onPaint

public void onPaint(Graphics g)
Paints this control
Overrides:
onPaint in class Control
Tags copied from class: Control
Parameters:
g - the graphics object for drawing
See Also:
Graphics

onEvent

public void onEvent(Event e)
On a timeout of the close timer, closes this control
Overrides:
onEvent in class Control
Tags copied from class: Control
Parameters:
event - the event to process
See Also:
Event, KeyEvent, PenEvent