superwaba.ext.xplat.io.gps
Class GPS

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--superwaba.ext.xplat.io.gps.GPS

public class GPS
extends Control

Control that display GPS coordinates readen from the serial port.


Field Summary
static int BUF_LEN
          You may change the size of the buffer if needed
 double direction
          Stores the direction
 Time lastFix
          Stores the lastFix.
 double velocity
          Stores the velocity
 
Fields inherited from class waba.ui.Control
AFTER, appId, appObj, asContainer, asWindow, backColor, backDis, BEFORE, BOTTOM, CENTER, clearValueInt, clearValueStr, enabled, FILL, FIT, fm, fmH, focusLess, focusTraversable, font, foreColor, foreDis, height, highlightRectsCount, isHighlighting, LEFT, parent, PREFERRED, RANGE, RIGHT, SAME, TOP, uiCE, uiFlat, uiPalm, uiVista, visible, width, x, x2, y, y2
 
Constructor Summary
GPS()
           
GPS(SerialPort sp, int readInterval)
           
 
Method Summary
 double getLatitude()
          Returns the latitude.
 double[] getLocation()
          Returns the location array.
 double getLongitude()
          Returns the longitude.
 int getPreferredHeight()
          Returns the preffered height of this control.
 int getPreferredWidth()
          Returns the preffered width of this control.
 void onEvent(Event e)
          Called to process key, pen, control and other posted events.
 void onPaint(Graphics g)
          Called to draw the control.
 double toCoordinate(java.lang.String s, char dir)
           
 
Methods inherited from class waba.ui.Control
addTimer, changeHighlighted, clear, contains, createGraphics, drawHighlight, getAbsoluteRect, getBackColor, getFont, getFontMetrics, getForeColor, getNext, getParent, getParentWindow, getPos, getRect, getSize, isDisplayed, isEnabled, isVisible, onBoundsChanged, onColorsChanged, onFontChanged, onWindowPaintFinished, postEvent, removeTimer, repaint, repaintNow, requestFocus, setBackColor, setBackForeColors, setEnabled, setFocusLess, setFont, setForeColor, setRect, setRect, setRect, setVisible, translateFromOrigin, uiStyleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUF_LEN

public static final int BUF_LEN
You may change the size of the buffer if needed

lastFix

public Time lastFix
Stores the lastFix.

direction

public double direction
Stores the direction

velocity

public double velocity
Stores the velocity
Constructor Detail

GPS

public GPS()

GPS

public GPS(SerialPort sp,
           int readInterval)
Method Detail

onEvent

public void onEvent(Event e)
Description copied from class: Control
Called to process key, pen, control and other posted events.
Overrides:
onEvent in class Control
Tags copied from class: Control
Parameters:
event - the event to process
See Also:
Event, KeyEvent, PenEvent

onPaint

public void onPaint(Graphics g)
Description copied from class: Control
Called to draw the control. When this method is called, the graphics object passed has been translated into the coordinate system of the control and the area behind the control has already been painted. The background is painted by the top-level window control.
Overrides:
onPaint in class Control
Tags copied from class: Control
Parameters:
g - the graphics object for drawing
See Also:
Graphics

getPreferredWidth

public int getPreferredWidth()
Returns the preffered width of this control.
Overrides:
getPreferredWidth in class Control

getPreferredHeight

public int getPreferredHeight()
Returns the preffered height of this control.
Overrides:
getPreferredHeight in class Control

getLocation

public double[] getLocation()
Returns the location array. The latitude is stored in position 0, and the longitude in position 1.

getLatitude

public double getLatitude()
Returns the latitude.

getLongitude

public double getLongitude()
Returns the longitude.

toCoordinate

public double toCoordinate(java.lang.String s,
                           char dir)