|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.ui.wombat.Component jcontrol.ui.wombat.AbstractFocusComponent jcontrol.ui.wombat.KeyPad
public class KeyPad
Instances of this class represent a key pad, known from telephones etc. Every time a key is pressed, either by touch or by keyboard, an action event of type ITEM_SELECTED is thrown. The command string of the event will contain the character of the key being pressed. This key can even be returned by the getLastKey() method.
(c) Copyright 2005-2007 DOMOLOGIC GmbH
Field Summary |
---|
Fields inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
BORDER_WIDTH, listener |
Fields inherited from interface jcontrol.ui.wombat.IFocusable |
---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
Constructor Summary | |
---|---|
KeyPad(int x,
int y,
int width,
int height)
Creates a KeyPad with the given bounds. |
Method Summary | |
---|---|
String |
getLastKey()
Returns the recently pressed character as a string or null. |
KeyEvent |
onKeyEvent(KeyEvent e)
This method is called when a keyboard action has been performed. |
int |
onTouchEvent(TouchEvent e)
If a TouchEvent accurs, this method is called. |
void |
paint(XGraphics g)
Draws the KeyPad. |
Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
clearCorners, drawBevelRect, drawButton, drawDottedRect, drawFocusRect, getActionListener, onActionEvent, requestFocus, setActionListener, setEnabled, setVisible |
Methods inherited from class jcontrol.ui.wombat.Component |
---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, redrawInternalAndParent, repaint, repaintAll, safeExec, setBackgroundColor, setBackgroundColorInternal, setBounds, setDirty, setFont, setForegroundColor, setForegroundColorInternal, setParametersInternal, setRedraw, setTransparentColor, unsafeExec, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Constructor Detail |
---|
public KeyPad(int x, int y, int width, int height)
x
- The x-coordinatey
- The y-coordinatewidth
- The width of the KeyPad.height
- The height of the KeyPad.Method Detail |
---|
public String getLastKey()
public int onTouchEvent(TouchEvent e)
onTouchEvent
in interface TouchListener
onTouchEvent
in class AbstractFocusComponent
e
- the TouchEvent.
RESULT_ACCEPTED
if the TouchEvent has been consumed by the TouchListener,RESULT_EXECUTED
if the TouchEvent has been consumed by the TouchListener and some important action has been performed, e.g. an action event has been invoked,RESULT_NONE
if the TouchEvent should be passed on to the next TouchListener.public KeyEvent onKeyEvent(KeyEvent e)
AbstractFocusComponent
onKeyEvent
in interface KeyListener
onKeyEvent
in class AbstractFocusComponent
e
- the event that contains information about the key.
null
if the KeyEvent has been consumed by the KeyListener,public void paint(XGraphics g)
paint
in class Component
g
- the application's graphics object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |