uk.co.silentsoftware
Class FollowMe

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by uk.co.silentsoftware.FollowMe
All Implemented Interfaces:
javax.wireless.messaging.MessageListener

public class FollowMe
extends javax.microedition.midlet.MIDlet
implements javax.wireless.messaging.MessageListener

FollowMe - main midlet class Sets up the views (GPSDataViews) and starts the GPSReader as well as processing choices from the MainView as to which view should be showing. Tight integration with MainView is an intentional design decision.


Field Summary
static int HIGHLIGHT_COLOR
          The highlight colour of the canvas views (e.g arrow colour in main view)
static int MAINMENU_VIEW
          The constant representing the main menu view
static java.lang.String PRODUCT_NAME
          The product name
static java.lang.String PRODUCT_URL
          The product URL
static java.lang.String PRODUCT_VERSION
          The product version
static int RAWDATA_VIEW
          The constant representing the raw GPS data view
static int RECEIVEDTEXT_VIEW
          The constant representing the received text message view
static int SATELLITES_VIEW
          The constant representing the satellites view
static int SENDTEXT_VIEW
          The constant representing the send a text message view
static int TARGETLISTDELETE_VIEW
          The constant representing the list of targets to delete from
static int TARGETLISTSAVE_VIEW
          The constant representing the list of targets
static int TARGETLISTSELECT_VIEW
          The constant representing the list of targets to select from
 
Constructor Summary
FollowMe()
          Default constructor - initialises all views
 
Method Summary
 void destroyApp(boolean value)
           
static void discoverGPS()
          Starts the GPS discovery process to find a GPS
static void discoverGPSOptionVisible(boolean display)
          Sets the whether to show the GPS discover option in the main menu
static int getBackgroundColor()
          Retrieve the back color
static javax.microedition.lcdui.Display getDisp()
          Returns the midlet's display
static int getForegroundColor()
          Retrieve the foreground color
static javax.wireless.messaging.MessageConnection getIncomingConnection()
          Provides access to the incoming connection - used when a text message is received
static TargetHolder getTargetHolder()
          Retrieve the targets holder
static void invertColours()
          Swap over the background and foreground colours
 void notifyIncomingMessage(javax.wireless.messaging.MessageConnection con)
           
static void pushDataToView(javax.microedition.location.Location data)
          Simple method to delegate location to a view if it is shown vis-a-vis the command pattern.
static void pushDataToView(java.lang.String data)
          Simple method to delegate raw data to a view if it is shown vis-a-vis the command pattern.
static void setTarget(javax.microedition.location.Coordinates coordinates)
          Sets the given coordinates as the target
static void showAlert(java.lang.String text)
          Common utility method to show text as an alert
static GPSDataView showView(int view)
          Method to switch views on the fly, allowing GPS data to be represented in different ways
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRODUCT_NAME

public static final java.lang.String PRODUCT_NAME
The product name

See Also:
Constant Field Values

PRODUCT_VERSION

public static final java.lang.String PRODUCT_VERSION
The product version

See Also:
Constant Field Values

PRODUCT_URL

public static final java.lang.String PRODUCT_URL
The product URL

See Also:
Constant Field Values

MAINMENU_VIEW

public static final int MAINMENU_VIEW
The constant representing the main menu view

See Also:
Constant Field Values

SATELLITES_VIEW

public static final int SATELLITES_VIEW
The constant representing the satellites view

See Also:
Constant Field Values

RAWDATA_VIEW

public static final int RAWDATA_VIEW
The constant representing the raw GPS data view

See Also:
Constant Field Values

SENDTEXT_VIEW

public static final int SENDTEXT_VIEW
The constant representing the send a text message view

See Also:
Constant Field Values

RECEIVEDTEXT_VIEW

public static final int RECEIVEDTEXT_VIEW
The constant representing the received text message view

See Also:
Constant Field Values

TARGETLISTSELECT_VIEW

public static final int TARGETLISTSELECT_VIEW
The constant representing the list of targets to select from

See Also:
Constant Field Values

TARGETLISTDELETE_VIEW

public static final int TARGETLISTDELETE_VIEW
The constant representing the list of targets to delete from

See Also:
Constant Field Values

TARGETLISTSAVE_VIEW

public static final int TARGETLISTSAVE_VIEW
The constant representing the list of targets

See Also:
Constant Field Values

HIGHLIGHT_COLOR

public static final int HIGHLIGHT_COLOR
The highlight colour of the canvas views (e.g arrow colour in main view)

See Also:
Constant Field Values
Constructor Detail

FollowMe

public FollowMe()
Default constructor - initialises all views

Method Detail

showView

public static GPSDataView showView(int view)
Method to switch views on the fly, allowing GPS data to be represented in different ways

Parameters:
view -
Returns:

pushDataToView

public static void pushDataToView(java.lang.String data)
Simple method to delegate raw data to a view if it is shown vis-a-vis the command pattern. Note data is not guaranteed to be delivered - a view may not be visible or be in the process of changing, in which case the data is discarded Note the string argument is useful for also passing debug and non location information to the view. For pure location data using the Location class is recommended instead, however this is not guaranteed to be supported by all views e.g. SatellitesView will not know how to process this.

Parameters:
data -

pushDataToView

public static void pushDataToView(javax.microedition.location.Location data)
Simple method to delegate location to a view if it is shown vis-a-vis the command pattern. Note data is not guaranteed to be delivered - a view may not be visible or be in the process of changing, in which case the data is discarded Some views may not support Location object processing e.g. SatellitesView will not know how to process an individual location

Parameters:
data -

destroyApp

public void destroyApp(boolean value)
                throws javax.microedition.midlet.MIDletStateChangeException
Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Throws:
javax.microedition.midlet.MIDletStateChangeException

notifyIncomingMessage

public void notifyIncomingMessage(javax.wireless.messaging.MessageConnection con)
Specified by:
notifyIncomingMessage in interface javax.wireless.messaging.MessageListener

discoverGPS

public static void discoverGPS()
Starts the GPS discovery process to find a GPS


getDisp

public static javax.microedition.lcdui.Display getDisp()
Returns the midlet's display

Returns:

discoverGPSOptionVisible

public static void discoverGPSOptionVisible(boolean display)
Sets the whether to show the GPS discover option in the main menu

Parameters:
display -

showAlert

public static void showAlert(java.lang.String text)
Common utility method to show text as an alert

Parameters:
text -

setTarget

public static void setTarget(javax.microedition.location.Coordinates coordinates)
Sets the given coordinates as the target

Parameters:
coordinates -

getIncomingConnection

public static javax.wireless.messaging.MessageConnection getIncomingConnection()
Provides access to the incoming connection - used when a text message is received

Returns:

getBackgroundColor

public static int getBackgroundColor()
Retrieve the back color

Returns:

getForegroundColor

public static int getForegroundColor()
Retrieve the foreground color

Returns:

getTargetHolder

public static TargetHolder getTargetHolder()
Retrieve the targets holder

Returns:

invertColours

public static void invertColours()
Swap over the background and foreground colours