Package GPS

Class UpdateClockDialog

All Implemented Interfaces:
ClockUpdateObserver, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class UpdateClockDialog extends PamDialog implements ActionListener, ClockUpdateObserver
Dialog to update the PC clock from GPRMC data.

can be used in manual mode or automatic mode. In automatic mode, it automatically updates the clock and then closes itself a few seconds later. In manual mode, the user must press the Set button and then press the close button.

Author:
Doug Gillespie
See Also:
  • Method Details

    • showDialog

      public static GPSParameters showDialog(Frame parentFrame, GPSControl gpsControl, GPSParameters gpsParameters, boolean autoUpdate)
      Show the UpdateClock dialog
      Parameters:
      parentFrame - parent Frame
      gpsControl - GPS Controller
      gpsParameters - nmea control parameters
      autoUpdate - auto or manual update mode
      Returns:
      updated NMEA Parameters, or null if the cancel button was pressed
    • getParams

      public boolean getParams()
      Description copied from class: PamDialog
      called when the Ok button is pressed. This must return true in order that the dialog may close. It should also copy all parameters into an object that will be returned by showDialog.
      Specified by:
      getParams in class PamDialog
    • cancelButtonPressed

      public void cancelButtonPressed()
      Description copied from class: PamDialog
      called when the cancel button is pressed before the dialog closes. Generally you should set the parameters returned by the dialog to null or some default value, or in some other way indicate that Cancel was pressed.
      Specified by:
      cancelButtonPressed in class PamDialog
    • setVisible

      public void setVisible(boolean b)
      Overrides:
      setVisible in class PamDialog
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • getClockSets

      public static int getClockSets()
    • clockUpdated

      public void clockUpdated(boolean success, long timeMillis, String message)
      Description copied from interface: ClockUpdateObserver
      Message sent when the clock has been updated.
      Specified by:
      clockUpdated in interface ClockUpdateObserver
      Parameters:
      success - true of false
      timeMillis - the time that was set
      message - any other message.
    • newTime

      public void newTime(long timeMillis)
      Description copied from interface: ClockUpdateObserver
      A new time has been unpacked in the GPS data.
      Specified by:
      newTime in interface ClockUpdateObserver
      Parameters:
      timeMillis -
    • restoreDefaultSettings

      public void restoreDefaultSettings()
      Description copied from class: PamDialog
      standard function which should us used to copy default parameters into the dialog controls.
      Specified by:
      restoreDefaultSettings in class PamDialog