org.placelab.midp.stumbler
Class RMSRecordCanvas

java.lang.Object
  extended byjavax.microedition.lcdui.Displayable
      extended byjavax.microedition.lcdui.Canvas
          extended byorg.placelab.midp.stumbler.RMSRecordCanvas
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener, UIComponent

public class RMSRecordCanvas
extends javax.microedition.lcdui.Canvas
implements javax.microedition.lcdui.CommandListener, UIComponent

Unpacks each entry in a stumble log file and shows it on screen.


Field Summary
 
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
RMSRecordCanvas(java.lang.String recordName, javax.microedition.lcdui.Display display, UIComponent backUI)
          Initialize the canvas with these files.
 
Method Summary
 java.util.Vector breakStringToLines(java.lang.String s, javax.microedition.lcdui.Font f, int width)
          Take a string and a current font and break it into lines that will fit in the specified width.
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
           
 void init_rmslist()
          Initialize the Vector of records by reading in the entire record store into memory
protected  void keyReleased(int keyCode)
           
protected  void keyRepeated(int keyCode)
           
 void paint(javax.microedition.lcdui.Graphics g)
           
 void showUI(UIComponent from)
          used by one component to activate another component
 int write(javax.microedition.lcdui.Graphics g, int y, java.lang.String s)
          Write the string on the graphics object
 
Methods inherited from class javax.microedition.lcdui.Canvas
getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyPressed, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getTicker, getTitle, isShown, removeCommand, setCommandListener, setTicker, setTitle, sizeChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMSRecordCanvas

public RMSRecordCanvas(java.lang.String recordName,
                       javax.microedition.lcdui.Display display,
                       UIComponent backUI)
Initialize the canvas with these files. The canvas will read out of the record store and show the values on screen one by one

Parameters:
recordName - the record store name to open
display - display that has control to show this canvas
backUI - the back button leads to this UI
Method Detail

showUI

public void showUI(UIComponent from)
Description copied from interface: UIComponent
used by one component to activate another component

Specified by:
showUI in interface UIComponent

init_rmslist

public void init_rmslist()
Initialize the Vector of records by reading in the entire record store into memory


keyReleased

protected void keyReleased(int keyCode)

keyRepeated

protected void keyRepeated(int keyCode)

write

public int write(javax.microedition.lcdui.Graphics g,
                 int y,
                 java.lang.String s)
Write the string on the graphics object

Parameters:
g - graphics object
y - y offset to write the string
s - string to write
Returns:
y offset after writing the string

breakStringToLines

public java.util.Vector breakStringToLines(java.lang.String s,
                                           javax.microedition.lcdui.Font f,
                                           int width)
Take a string and a current font and break it into lines that will fit in the specified width.

Parameters:
s - string to chunk up
f - font to use
width - width to use for breaking the string into lines
Returns:
Vector of string objects

paint

public void paint(javax.microedition.lcdui.Graphics g)

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable d)
Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener