|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
uk.co.silentsoftware.ui.views.AbstractCanvasView
uk.co.silentsoftware.ui.views.MainView
public class MainView
Simple main menu - provides options to access other views and has a ticker to show current latitude/longitude since it is also a GPSDataView Note that the design has tight integration between this and the midlet because this view provides access to all of the functionality of the application. As the phone is not a compass the arrow only points in the correct direction once the user has started moving, i.e. by staying at a fixed point a satellite would not know which way the user is facing and so cannot tell North. Once the user moves a certain direction it can determine North from the directional vector.
| 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 | |
|---|---|
MainView(javax.microedition.midlet.MIDlet m)
Default constructor takes the parent midlet for close call back later and inits the commands on this canvas |
|
| Method Summary | |
|---|---|
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
Command handler for this view |
void |
discoverOptionVisible(boolean visible)
Switch to show/hide the bluetooth discover option on the menu (used when connected/disconnecting) |
void |
process(javax.microedition.location.Location loc)
Processes the current location object data and sets this canvas' ticker with the processed data Note this is not synchronized because we need the performance, and frankly it's not an issue if a couple of threads at once access this method. |
void |
process(java.lang.String data)
Processes raw GPS data Finds out if the data is the type it wants (fix) and grabs lock Splits data, retrieves NMEA formatted lat/long Converts NMEA formatted data into degreeminute(DM) lat/long suitable for maps/streetmap.co.uk etc Sets this canvas' ticker with the processed data Note this is not synchronized because we need the performance, and frankly it's not an issue if a couple of threads at once access this method. |
void |
run()
Method to update the ticker after a fixed amount of time (TICKER_TIME) with a status or bearing message. |
void |
shutdown()
Shuts down the repaint thread |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints, setCommandListener, setFullScreenMode |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MainView(javax.microedition.midlet.MIDlet m)
m - | Method Detail |
|---|
public void shutdown()
public void discoverOptionVisible(boolean visible)
visible -
public void commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
commandAction in interface javax.microedition.lcdui.CommandListenercommandAction in class AbstractCanvasViewpublic void process(java.lang.String data)
process in interface GPSDataViewpublic void process(javax.microedition.location.Location loc)
process in interface GPSDataViewloc - public void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||