jMobileCore toolkit

com.jmobilecore.ui.core
Class SoftKeyBar

java.lang.Object
  extended by com.jmobilecore.ui.core.Component
      extended by com.jmobilecore.ui.core.SoftKeyBar

public class SoftKeyBar
extends Component

The SoftKeyBar is special Component which represents bottom line of the phone screen with names of soft keys. This class contains set of methods that supports insertion/delition of soft keys and execution of associated actions when softkey is pressed

Author:
Greg Gridin

Field Summary
protected  SoftKey centerSoftKey
          The center positioned softkey
protected  SoftKey leftSoftKey
          The left positioned softkey
protected  SoftKey rightSoftKey
          The right positioned softkey
 
Fields inherited from class com.jmobilecore.ui.core.Component
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width
 
Constructor Summary
SoftKeyBar()
          Constructs a new softkey bar
 
Method Summary
 void destructor()
          Default destructor.
protected  boolean keyPressed(int keyCode)
          Responds to a key press.
 void paint(javax.microedition.lcdui.Graphics g)
          Paints the cursor for this component
 void removeSoftKey(int position)
          Removes softkey from the softkey bar
 void setSoftKey(SoftKey softKey, int position)
          Sets softkey to the softkey bar If new soft key is null then action is equivalent to removeSoftKey from specified position
 
Methods inherited from class com.jmobilecore.ui.core.Component
getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centerSoftKey

protected SoftKey centerSoftKey
The center positioned softkey


leftSoftKey

protected SoftKey leftSoftKey
The left positioned softkey


rightSoftKey

protected SoftKey rightSoftKey
The right positioned softkey

Constructor Detail

SoftKeyBar

public SoftKeyBar()
Constructs a new softkey bar

Method Detail

destructor

public void destructor()
Default destructor. Helps VM to perform garbage collection

Overrides:
destructor in class Component

keyPressed

protected boolean keyPressed(int keyCode)
Responds to a key press.

Overrides:
keyPressed in class Component
Parameters:
keyCode - The code for the key that was pressed.
Returns:
true if the key was successfully processed, false otherwise

paint

public void paint(javax.microedition.lcdui.Graphics g)
Paints the cursor for this component

Overrides:
paint in class Component
Parameters:
g - Graphics object

removeSoftKey

public void removeSoftKey(int position)
Removes softkey from the softkey bar

Parameters:
position - the position of the key, if there is no key in specified position then does nothing
See Also:
SoftKey

setSoftKey

public void setSoftKey(SoftKey softKey,
                       int position)
Sets softkey to the softkey bar If new soft key is null then action is equivalent to removeSoftKey from specified position

Parameters:
softKey - new soft key
position - the position of the key,
See Also:
SoftKey, removeSoftKey(int)

jMobileCore toolkit