courselog
Class MainApplication

java.lang.Object
  extended by courselog.MainApplication

public class MainApplication
extends java.lang.Object


Field Summary
static int ACTIVECALIBRATION
          Index indicating Calibration panel is active
static int ACTIVECONVERT
          Index indicating Convert panel is active
static int ACTIVEDISTANCE
          Index indicating Distance panel is active
static int ACTIVENAVIGATE
          Index indicating Distance panel is active
static int ACTIVEOPTIONS
          Index indicating Options panel is active
static ewe.fx.Color BADCOLOR
          Color of the options button when the GPS is not connected.
static java.lang.String DEFAULTLOGFILE
          Default name of the log file
static java.lang.String DEFAULTMAPDIR
          Default name of the map directory
static ewe.fx.Color LOSTCOLOR
          Color of the options button when the GPS is connected but not locked on satellites RGB=(240,120,0).
 ewe.fx.Image myAppGlobalIcon
          Application icon to be used by all forms.
protected  CalibrateForm myCalibForm
          Calibration panel
protected  ConvertForm myConvertForm
          Convert panel
protected  DistanceForm myDistanceForm
          Distance panel
protected  int myInitialStatus
          Initial status of the application
protected  int myLastActivePanel
          Application last active panel
protected  int myLastNext
          Value of last next waypoint read from options file.
protected  int myLastSelected
          Value of last selected waypoint read from options file.
protected  java.lang.String myLastWaypoints
          Application last used waypoints file
protected  java.lang.String myLogFileName
          Log file to log moves.
protected  java.lang.String myMapDir
          Application current maps directory
protected  double myMinDistance
          Minium distance between logged moves.
protected  NavigateForm myNavigateForm
          Navigation panel
protected  int myNextActivePanel
          Application next active panel
protected  OptionsForm myOptionsForm
          Options panel
protected  SerialGPSConnection mySGC
          Application serial GPS connection
protected  ewe.io.SerialPortOptions mySPO
          Serial port options to connect with GPS
protected  PositionTracer myTr
          Application Track tracer
static ewe.fx.Color NORMALCOLOR
          Options button color when GPS is OK RGB=(192,255,192).
static java.lang.String OPTIONSFILENAME
          Fixed default name of the option file.
static java.lang.String TAGLAST
          Tag indicating last active panel in the options file.
static java.lang.String TAGLASTNEXT
          Tag indicating the last next point to aim at.
static java.lang.String TAGLASTSELECTED
          Tag indicating the last selected waypoint.
static java.lang.String TAGLASTWP
          Tag indicating the last waypoints file.
static java.lang.String TAGLOG
          Tag indicating the log file name in the options file.
static java.lang.String TAGMAPDIR
          Tag indicating the map directory in the options file.
static java.lang.String TAGMINDIST
          Tag indicating the min distance value in the options file.
static java.lang.String TAGNAVLAST
          Tag indicating last status of the navigation form.
static java.lang.String TAGSPO
          Tag indicating the GPS port options in the options file.
static java.lang.String TAGSTATUS
          Tag indicating the last status of the application in the options file.
static java.lang.String TAGUNITS
          Tag indicating the units in the options file.
static java.lang.String VERSIONMESSAGE
          Version message displayed in the options panel="Version 1.0.0".
 
Constructor Summary
MainApplication()
          Creates a new instance of MainApplication
 
Method Summary
static java.lang.String getDefaulLogFilePath()
          Build the default log file name from the application path.
static double getDefaulMinDistance()
          Default minimum distance between log points == 50.0d.
static java.lang.String getDefaultMapDirPath()
          Build the default map directory from the application path.
static int getDefaulUnits()
          Default units set km/h and m.
 CalibrateForm getMyCalibForm()
           
 ConvertForm getMyConvertForm()
           
 DistanceForm getMyDistanceForm()
           
 java.lang.String getMyMapDir()
           
 NavigateForm getMyNavigateForm()
           
 OptionsForm getMyOptionsForm()
           
 SerialGPSConnection getMySGC()
           
 ewe.io.SerialPortOptions getMySPO()
           
 void initToDefaultOptions()
           
static void main(java.lang.String[] args)
           
 boolean readOptionsFile()
          Read "OPTIONSFILENAME" file in the program directory to generate the options as they were recorded at last exit.
 void updateOptions()
          Initialise the tracer with current options.
 boolean writeOptionsFile()
          Write "OPTIONSFILENAME" file in the program directory with the current options settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myAppGlobalIcon

public ewe.fx.Image myAppGlobalIcon
Application icon to be used by all forms.


VERSIONMESSAGE

public static final java.lang.String VERSIONMESSAGE
Version message displayed in the options panel="Version 1.0.0".

See Also:
Constant Field Values

NORMALCOLOR

public static final ewe.fx.Color NORMALCOLOR
Options button color when GPS is OK RGB=(192,255,192).


LOSTCOLOR

public static final ewe.fx.Color LOSTCOLOR
Color of the options button when the GPS is connected but not locked on satellites RGB=(240,120,0).


BADCOLOR

public static final ewe.fx.Color BADCOLOR
Color of the options button when the GPS is not connected. RGB=(160,0,0).


OPTIONSFILENAME

public static final java.lang.String OPTIONSFILENAME
Fixed default name of the option file.

See Also:
Constant Field Values

mySGC

protected SerialGPSConnection mySGC
Application serial GPS connection


mySPO

protected ewe.io.SerialPortOptions mySPO
Serial port options to connect with GPS


TAGSPO

public static final java.lang.String TAGSPO
Tag indicating the GPS port options in the options file.

See Also:
Constant Field Values

TAGUNITS

public static final java.lang.String TAGUNITS
Tag indicating the units in the options file.

See Also:
Constant Field Values

myLogFileName

protected java.lang.String myLogFileName
Log file to log moves.


myInitialStatus

protected int myInitialStatus
Initial status of the application


DEFAULTLOGFILE

public static final java.lang.String DEFAULTLOGFILE
Default name of the log file

See Also:
Constant Field Values

TAGLOG

public static final java.lang.String TAGLOG
Tag indicating the log file name in the options file.

See Also:
Constant Field Values

myMinDistance

protected double myMinDistance
Minium distance between logged moves.


TAGMINDIST

public static final java.lang.String TAGMINDIST
Tag indicating the min distance value in the options file.

See Also:
Constant Field Values

myMapDir

protected java.lang.String myMapDir
Application current maps directory


DEFAULTMAPDIR

public static final java.lang.String DEFAULTMAPDIR
Default name of the map directory

See Also:
Constant Field Values

TAGMAPDIR

public static final java.lang.String TAGMAPDIR
Tag indicating the map directory in the options file.

See Also:
Constant Field Values

myLastWaypoints

protected java.lang.String myLastWaypoints
Application last used waypoints file


TAGLASTWP

public static final java.lang.String TAGLASTWP
Tag indicating the last waypoints file.

See Also:
Constant Field Values

myLastNext

protected int myLastNext
Value of last next waypoint read from options file.


TAGLASTSELECTED

public static final java.lang.String TAGLASTSELECTED
Tag indicating the last selected waypoint.

See Also:
Constant Field Values

myLastSelected

protected int myLastSelected
Value of last selected waypoint read from options file.


TAGLASTNEXT

public static final java.lang.String TAGLASTNEXT
Tag indicating the last next point to aim at.

See Also:
Constant Field Values

TAGLAST

public static final java.lang.String TAGLAST
Tag indicating last active panel in the options file.

See Also:
Constant Field Values

TAGSTATUS

public static final java.lang.String TAGSTATUS
Tag indicating the last status of the application in the options file.

See Also:
Constant Field Values

TAGNAVLAST

public static final java.lang.String TAGNAVLAST
Tag indicating last status of the navigation form.

See Also:
Constant Field Values

myTr

protected PositionTracer myTr
Application Track tracer


myNextActivePanel

protected int myNextActivePanel
Application next active panel


myLastActivePanel

protected int myLastActivePanel
Application last active panel


myCalibForm

protected CalibrateForm myCalibForm
Calibration panel


ACTIVECALIBRATION

public static final int ACTIVECALIBRATION
Index indicating Calibration panel is active

See Also:
Constant Field Values

myOptionsForm

protected OptionsForm myOptionsForm
Options panel


ACTIVEOPTIONS

public static final int ACTIVEOPTIONS
Index indicating Options panel is active

See Also:
Constant Field Values

myConvertForm

protected ConvertForm myConvertForm
Convert panel


ACTIVECONVERT

public static final int ACTIVECONVERT
Index indicating Convert panel is active

See Also:
Constant Field Values

myDistanceForm

protected DistanceForm myDistanceForm
Distance panel


ACTIVEDISTANCE

public static final int ACTIVEDISTANCE
Index indicating Distance panel is active

See Also:
Constant Field Values

myNavigateForm

protected NavigateForm myNavigateForm
Navigation panel


ACTIVENAVIGATE

public static final int ACTIVENAVIGATE
Index indicating Distance panel is active

See Also:
Constant Field Values
Constructor Detail

MainApplication

public MainApplication()
Creates a new instance of MainApplication

Method Detail

main

public static void main(java.lang.String[] args)

getMyMapDir

public java.lang.String getMyMapDir()

getMySGC

public SerialGPSConnection getMySGC()

getMySPO

public ewe.io.SerialPortOptions getMySPO()

getMyCalibForm

public CalibrateForm getMyCalibForm()

getMyConvertForm

public ConvertForm getMyConvertForm()

getMyDistanceForm

public DistanceForm getMyDistanceForm()

getMyOptionsForm

public OptionsForm getMyOptionsForm()

getMyNavigateForm

public NavigateForm getMyNavigateForm()

getDefaultMapDirPath

public static java.lang.String getDefaultMapDirPath()
Build the default map directory from the application path.


getDefaulLogFilePath

public static java.lang.String getDefaulLogFilePath()
Build the default log file name from the application path.


getDefaulMinDistance

public static double getDefaulMinDistance()
Default minimum distance between log points == 50.0d.


getDefaulUnits

public static int getDefaulUnits()
Default units set km/h and m.


initToDefaultOptions

public void initToDefaultOptions()

writeOptionsFile

public boolean writeOptionsFile()
Write "OPTIONSFILENAME" file in the program directory with the current options settings. The options should be initialised, at least by initToDefaultOptions().

Returns:
true if the file could be correctly written, false otherwise.

readOptionsFile

public boolean readOptionsFile()
Read "OPTIONSFILENAME" file in the program directory to generate the options as they were recorded at last exit.

Returns:
true if the file could be correctly read, false otherwise.

updateOptions

public void updateOptions()
Initialise the tracer with current options.