bt747.j2se_view
Class J2SEAppController

java.lang.Object
  extended by bt747.model.Controller
      extended by bt747.j2se_view.J2SEController
          extended by bt747.j2se_view.J2SEAppController
All Implemented Interfaces:
ModelListener

public final class J2SEAppController
extends J2SEController


Field Summary
static javax.swing.InputVerifier FloatVerifier
          A floating point input verifier available for use in the GUI buildup.
static javax.swing.InputVerifier IntVerifier
          An integer input verifier available for use in the GUI buildup.
static java.lang.String lookAndFeelMsg
          Message build up during Look And Feel search.
static java.lang.String MAPCACHEDIRECTORYPROPERTY
           
 
Constructor Summary
J2SEAppController(J2SEAppModel model)
           
 
Method Summary
 void addView(BT747View view)
          Attach a view to the controller.
 void changeLogFormat(int logFormat)
          (User) request to change the log format.
 void changeLogFormatAndErase(int logFormat)
          (User) request to change the log format.
 void convertLog(int logType)
          Convert the log given the provided parameters using other methods.
 TracksAndWayPoints convertLogToTrackAndWayPoints()
          Convert the log into an array of trackpoints.
 void couldNotOpenFileMessage(java.lang.String fileName)
          Show error message that file could not be opened.
 void createErasePopup()
          Show the pop up.
 void doFactoryReset()
          Perform a factory reset, but first request confirmation from the user.
 void doLogConversion(int selectedFormat)
           
static void enableComponentHierarchy(java.awt.Component parent, boolean en)
          Enable(Disable) a panel and its children.
 void eraseLogWithDialogs()
          (User) request to change the log format.
 J2SEAppModel getAppModel()
           
 int getEndTimeNoOffset()
           
static javax.swing.Icon getIcon(java.lang.String iconPath)
           
 java.awt.Image getIcon128()
           
 java.awt.Image getIcon16()
           
 boolean getRequestToOverwriteFromDialog()
          Request the user if it is ok to overwrite the existing data or not.
 java.awt.Frame getRootFrame()
           
 int getStartTimeNoOffset()
           
static java.lang.String getString(java.lang.String s)
          I18N.
 int getTimeOffset()
           
static void initAppSettings()
          Initialise the application settings.
static java.util.Locale localeFromString(java.lang.String localeStr)
           
 void modelEvent(ModelEvent e)
           
static void myLookAndFeel()
          Set a good look and feel for the system.
static void notifyBT747Exception(BT747Exception e)
           
 void performOperationsAfterGPSConnect()
          This does a number of operations once the GPS is effectively connected.
 void recoveryErase()
          A 'recovery Erase' attempts to recover memory that was previously identified as 'bad'.
 void removeErasePopup()
          Remove the pop up.
 void saveSettings()
          Save all the user settings to disk.
 void scaleUIFont(int scalePercent)
           
 void selectMapCacheDirectory()
           
 void setChangeToMap(boolean changeToMap)
           
 void setEndTimeNoOffset(int endTimeNoOffset)
           
 void setFlashConfig(boolean lock, int updateRate, int baudRate, int periodGLL, int periodRMC, int periodVTG, int periodGSA, int periodGSV, int periodGGA, int periodZDA, int periodMCHN)
          Change the flashconfiguration but first request confirmation from the user.
 void setLogConversionParameters()
           
static void setRootFrame(java.awt.Frame f)
           
 void setScale()
           
 void setStartTimeNoOffset(int startTimeNoOffset)
           
 void setTimeOffset(int timeOffset)
           
 void showAbout()
          Show the about dialog box for the application.
 void showLicense()
          Show the information dialog box for the application.
 
Methods inherited from class bt747.j2se_view.J2SEController
addLogFile, downloadAndUploadAgpsData, downloadAndUploadAgpsData, setModel, tagImage
 
Methods inherited from class bt747.model.Controller
addLogFile, addWayPointStyle, cancelGetLog, closeGPS, connectGPS, doConvertLog, doConvertLog, doConvertLogToTrackPoints, doConvertLogToTracksAndWayPoints, eraseLog, getHeightReference, getInputConversionInstance, getInputConversionInstance, getLastError, getLastErrorInfo, getLogFiltersToUse, getModel, getOutFileExt, getOutFileHandler, getUserWayPoints, gpsCmd, gpsCmd, init, isEnableStoreOK, isLocationServingActive, logImmediate, openFreeTextPort, recoveryEraseLog, replyToOkToOverwrite, reqDeviceInfo, reqSettingsForStorage, resetFilters, restoreSetting1, sendBT747Exception, sendCmd, setAgpsData, setAutoFetch, setAutoLog, setBaudRate, setBluetooth, setBooleanOpt, setBTMacAddr, setChunkSize, setDatumMode, setDebug, setDebugConn, setDGPSMode, setDownloadMethod, setDownloadTimeOut, setFileNameBuilder, setFilterEndTime, setFilters, setFilterStartTime, setFixInterval, setFlashUserOption, setFloatOpt, setGpsDecode, setHoluxName, setIncremental, setIntOpt, setLogDistanceInterval, setLogFormat, setLoggingActive, setLogOverwrite, setLogRequestAhead, setLogSpeedInterval, setLogTimeInterval, setMtkDataNeeded, setNMEADefaultPeriods, setNMEAPeriods, setNMEAset, setOutputFileRelPath, setPort, setPowerSaveEnabled, setSBASEnabled, setSBASTestEnabled, setStats, setStringOpt, setUsb, setUserWayPoints, setWayPointStyles, startDefaultDownload, startDownload, startGPSPositionServing, startWPDownload, stopErase, stopGPSPositionServing, stopLogConvert, storeSetting1
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAPCACHEDIRECTORYPROPERTY

public static final java.lang.String MAPCACHEDIRECTORYPROPERTY
See Also:
Constant Field Values

lookAndFeelMsg

public static java.lang.String lookAndFeelMsg
Message build up during Look And Feel search.


IntVerifier

public static final javax.swing.InputVerifier IntVerifier
An integer input verifier available for use in the GUI buildup.


FloatVerifier

public static final javax.swing.InputVerifier FloatVerifier
A floating point input verifier available for use in the GUI buildup.

Constructor Detail

J2SEAppController

public J2SEAppController(J2SEAppModel model)
Parameters:
model - The model to associate with this controller.
Method Detail

modelEvent

public void modelEvent(ModelEvent e)
Specified by:
modelEvent in interface ModelListener
Overrides:
modelEvent in class J2SEController

notifyBT747Exception

public static final void notifyBT747Exception(BT747Exception e)

getIcon16

public final java.awt.Image getIcon16()

getIcon128

public final java.awt.Image getIcon128()

localeFromString

public static final java.util.Locale localeFromString(java.lang.String localeStr)

setLogConversionParameters

public void setLogConversionParameters()

convertLog

public final void convertLog(int logType)
Convert the log given the provided parameters using other methods.

Parameters:
logType - Indicates the type of log that should be written. For example Model.CSV_LOGTYPE .
See Also:
Model.CSV_LOGTYPE, Model.TRK_LOGTYPE, Model.KML_LOGTYPE, Model.PLT_LOGTYPE, Model.GPX_LOGTYPE, Model.NMEA_LOGTYPE, Model.GMAP_LOGTYPE, Model.OSM_UPLOAD_LOGTYPE, Model.POSTGIS_LOGTYPE, Model.GOOGLE_MAP_STATIC_URL_LOGTYPE, Model.SQL_LOGTYPE

convertLogToTrackAndWayPoints

public final TracksAndWayPoints convertLogToTrackAndWayPoints()
Convert the log into an array of trackpoints.

Returns:
Array of selected trackpoints.

getString

public static final java.lang.String getString(java.lang.String s)
I18N. Internationalization - get the localized string.

Parameters:
s - String reference for localization.
Returns:
Localized String.

getIcon

public static final javax.swing.Icon getIcon(java.lang.String iconPath)

recoveryErase

public final void recoveryErase()
A 'recovery Erase' attempts to recover memory that was previously identified as 'bad'.


changeLogFormatAndErase

public final void changeLogFormatAndErase(int logFormat)
(User) request to change the log format. Warns about requirement to erase the log too.

Parameters:
logFormat - The logFormat to set upon erase.

changeLogFormat

public final void changeLogFormat(int logFormat)
(User) request to change the log format. The log is not erased and may be incompatible with other applications.

Parameters:
logFormat - The new log format to set.

eraseLogWithDialogs

public final void eraseLogWithDialogs()
(User) request to change the log format. Warns about requirement to erase the log too.


doFactoryReset

public final void doFactoryReset()
Perform a factory reset, but first request confirmation from the user.


setFlashConfig

public final void setFlashConfig(boolean lock,
                                 int updateRate,
                                 int baudRate,
                                 int periodGLL,
                                 int periodRMC,
                                 int periodVTG,
                                 int periodGSA,
                                 int periodGSV,
                                 int periodGGA,
                                 int periodZDA,
                                 int periodMCHN)
Change the flashconfiguration but first request confirmation from the user. The MTK device stores a number of settings in its internal flash which is different from the log memory. These settings are restored after loss of power for example. Controller.setFlashUserOption(boolean, int, int, int, int, int, int, int, int, int, int)

Parameters:
lock - When true, subsequent changes in these settings will be impossible.
updateRate - The 'fix period' of the GPS in ms. When this is 200, then the Fix is 5Hz.
baudRate - The speed of the serial communication of the MTK chipset. Be carefull - this may be the internal speed - not the external speed!
periodGLL - The period of emission of the GLL sentence (relative to the fix).
periodRMC - The period of emission of the RMC sentence (relative to the fix).
periodVTG - The period of emission of the VTG sentence (relative to the fix).
periodGSA - The period of emission of the GSA sentence (relative to the fix).
periodGSV - The period of emission of the GSV sentence (relative to the fix).
periodGGA - The period of emission of the GGA sentence (relative to the fix).
periodZDA - The period of emission of the ZDA sentence (relative to the fix).
periodMCHN - The period of emission of the MCHN sentence (relative to the fix).

addView

public final void addView(BT747View view)
Attach a view to the controller.

Parameters:
view - The view that must be attached.

performOperationsAfterGPSConnect

public final void performOperationsAfterGPSConnect()
Description copied from class: Controller
This does a number of operations once the GPS is effectively connected. Can be extended by the application. It gets certain informations required by the application. It stores the settings related to the port (since the connection was successful) and starts of the Model to do port queries.

Overrides:
performOperationsAfterGPSConnect in class Controller

initAppSettings

public static final void initAppSettings()
Initialise the application settings. Must be called before Model is instantiated. And preferably just after JavaLibBridge setup because it kind of should be part of the JavaLib implementation.


saveSettings

public final void saveSettings()
Description copied from class: Controller
Save all the user settings to disk.

Overrides:
saveSettings in class Controller

setRootFrame

public static void setRootFrame(java.awt.Frame f)

getRootFrame

public java.awt.Frame getRootFrame()

createErasePopup

public void createErasePopup()
Show the pop up.


removeErasePopup

public final void removeErasePopup()
Remove the pop up.


showAbout

public final void showAbout()
Show the about dialog box for the application.


showLicense

public final void showLicense()
Show the information dialog box for the application.


couldNotOpenFileMessage

public void couldNotOpenFileMessage(java.lang.String fileName)
Show error message that file could not be opened.

Parameters:
fileName - The file that could not be opened.

getRequestToOverwriteFromDialog

public final boolean getRequestToOverwriteFromDialog()
Request the user if it is ok to overwrite the existing data or not.

Returns:
true if data can be overwritten.

myLookAndFeel

public static void myLookAndFeel()
Set a good look and feel for the system.


setScale

public final void setScale()

selectMapCacheDirectory

public final void selectMapCacheDirectory()

enableComponentHierarchy

public static final void enableComponentHierarchy(java.awt.Component parent,
                                                  boolean en)
Enable(Disable) a panel and its children.

Parameters:
parent -
en -

doLogConversion

public void doLogConversion(int selectedFormat)

scaleUIFont

public final void scaleUIFont(int scalePercent)

getAppModel

public final J2SEAppModel getAppModel()

getStartTimeNoOffset

public final int getStartTimeNoOffset()

setStartTimeNoOffset

public final void setStartTimeNoOffset(int startTimeNoOffset)

getEndTimeNoOffset

public final int getEndTimeNoOffset()

setEndTimeNoOffset

public final void setEndTimeNoOffset(int endTimeNoOffset)

getTimeOffset

public final int getTimeOffset()

setTimeOffset

public final void setTimeOffset(int timeOffset)

setChangeToMap

public final void setChangeToMap(boolean changeToMap)