Class MainGui

java.lang.Object
org.ka2ddo.yaac.gui.MainGui
All Implemented Interfaces:
ConnectionRequestListener, GuiIfc

public class MainGui extends Object implements GuiIfc, ConnectionRequestListener
This class defines the service functions for the Java AWT/Swing GUI of YAAC.
Author:
Andrew Pavlin, KA2DDO
  • Constructor Details

    • MainGui

      public MainGui(File baseDir, FirstWindow firstWindow)
      Create the main GUI manager of YAAC, which will subsequently create the default map view window and provide the service functions for launching all other display modes and windows.
      Parameters:
      baseDir - File referencing the installation directory for the YAAC software
      firstWindow - FirstWindow enum value indicating which display should come up first
  • Method Details

    • showSplashScreen

      public static Object showSplashScreen()
      Display the splash screen while YAAC is starting up. Note that this is called only by Java Reflection.
      Returns:
      the GUI object of the splash window
    • buildPopupMenu

      public static JPopupMenu buildPopupMenu(int mx, int my, com.bbn.openmap.proj.Projection p, List<StationState> matchList, GuiContentType widgetContentType)
      Create a popup menu contextually suitable for the point on the map that was clicked. Each registered AbstractPopupMenuAction can decide for itself whether it should be included on the popup menu.
      Parameters:
      mx - screen X coordinate where popup menu was requested
      my - screen Y coordinate where popup menu was requested
      p - the current Projection for the map
      matchList - an ArrayList of StationStates describing stations and objects at the point on the map that was clicked
      widgetContentType - GuiContentType of the widget that wants to launch a popup menu
      Returns:
      a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
    • buildPopupMenu

      public static JPopupMenu buildPopupMenu(int mx, int my, List<StationState> matchList, GuiContentType widgetContentType)
      Create a popup menu contextually suitable for the point on the map that was clicked. Each registered AbstractPopupMenuAction can decide for itself whether it should be included on the popup menu.
      Parameters:
      mx - screen X coordinate where popup menu was requested
      my - screen Y coordinate where popup menu was requested
      matchList - an ArrayList of StationStates describing stations and objects at the point on the map that was clicked
      widgetContentType - GuiContentType of the widget that wants to launch a popup menu @return a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
      Returns:
      a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
    • buildPopupMenu

      public static JPopupMenu buildPopupMenu(int mx, int my, com.bbn.openmap.proj.Projection p, List<StationState> matchList, AX25Frame frame, GuiContentType widgetContentType)
      Create a popup menu contextually suitable for the point on the map that was clicked. Each registered AbstractPopupMenuAction can decide for itself whether it should be included on the popup menu.
      Parameters:
      mx - screen X coordinate where popup menu was requested
      my - screen Y coordinate where popup menu was requested
      p - the current Projection for the map
      matchList - an ArrayList of StationStates describing stations and objects at the point on the map that was clicked
      frame - AX25Frame in the selected table row, or null if not relevant
      widgetContentType - GuiContentType of the widget that wants to launch a popup menu @return a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
      Returns:
      a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
    • buildPopupMenu

      public static JPopupMenu buildPopupMenu(int mx, int my, com.bbn.openmap.proj.Projection p, List<StationState> matchList, AX25Frame frame, GuiContentType widgetContentType, ArrayList<AbstractPopupMenuAction> actionList)
      Create a popup menu contextually suitable for the point on the map that was clicked. Each registered AbstractPopupMenuAction can decide for itself whether it should be included on the popup menu.
      Parameters:
      mx - screen X coordinate where popup menu was requested
      my - screen Y coordinate where popup menu was requested
      p - the current Projection for the map
      matchList - an ArrayList of StationStates describing stations and objects at the point on the map that was clicked
      frame - AX25Frame in the selected table row, or null if not relevant
      widgetContentType - GuiContentType of the widget that wants to launch a popup menu @return a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
      actionList - ArrayList of AbstractPopupMenuAction objects to consider for menu
      Returns:
      a JPopupMenu of the chosen AbstractPopupMenuActions if any were enabled for this point, or null if no menu items should be enabled here
    • setMainFrameTitle

      public void setMainFrameTitle()
      Specify the title displayed in the map window's title bar.
      Specified by:
      setMainFrameTitle in interface GuiIfc
    • disposeOfSplash

      public static void disposeOfSplash(Object oSplash)
      Get rid of the splash screen.
      Parameters:
      oSplash - Object wrapped around the splash screen
    • initMainWindowMenuBar

      public void initMainWindowMenuBar()
      Phase 2 of initializing the GUI (stuff that needs the GUI property of the main YAAC object to be already initialized).
      Specified by:
      initMainWindowMenuBar in interface GuiIfc
    • buildMenus

      public static void buildMenus(ArrayList<AbstractMenuAction> actionList, JMenuBar menuBar, Window menuContainingWindow)
      Build the contents of a JFrame's JMenuBar.
      Parameters:
      actionList - ArrayList of AbstractMenuActions to be sorted and built into the menu bar
      menuBar - JMenuBar to be populated
      menuContainingWindow - the Window that contains the menu bar
    • iterateOverAllMaps

      public void iterateOverAllMaps(GuiIfc.MapFunctor functor)
      Apply the functor to every currently open map window.
      Specified by:
      iterateOverAllMaps in interface GuiIfc
      Parameters:
      functor - MapFunctor to be iteratively called
    • iterateOverAllMaps

      public void iterateOverAllMaps(GuiIfc.FullMapFunctor functor)
      Apply the functor to every currently open map window.
      Specified by:
      iterateOverAllMaps in interface GuiIfc
      Parameters:
      functor - FullMapFunctor to be iteratively called
    • registerMapWindow

      public void registerMapWindow(GeoMapIfc geoMapIfc)
      Register a newly opened map widget for updates.
      Parameters:
      geoMapIfc - GeoMapIfc implementor to register
    • unregisterMapWindow

      public void unregisterMapWindow(GeoMapIfc geoMapIfc)
      Unregister a closed map widget from updates.
      Parameters:
      geoMapIfc - GeoMapIfc implementor to register
    • getDefaultMap

      public GeographicalMap getDefaultMap()
      Get the default (main) map window.
      Returns:
      default map window
    • getMainMap

      public GeoMapIfc getMainMap()
      Get the primary or default map display.
      Specified by:
      getMainMap in interface GuiIfc
      Returns:
      display object implementing the MapGeoIfc interface
    • displayAttentionAlert

      public void displayAttentionAlert(StationState ss)
      Display an AttentionAlert (flashing arrows) on the map for a particular station or object.
      Specified by:
      displayAttentionAlert in interface GuiIfc
      Parameters:
      ss - StationState of the station or object to highlight
    • displayAttentionAlert

      public void displayAttentionAlert(double latitude, double longitude, AX25Message.Precedence precedence)
      Display an AttentionAlert (flashing arrows) on the map for a particular station or object.
      Specified by:
      displayAttentionAlert in interface GuiIfc
      Parameters:
      latitude - double fractional degrees North
      longitude - double fraction degrees East
      precedence - Precedence of the event to be reported
    • isDontShowAsOld

      public static boolean isDontShowAsOld()
      Report whether rendering code should display old messages differently.
      Returns:
      boolean true if old messages shouldn't be displayed as old
    • setDontShowAsOld

      public static void setDontShowAsOld(boolean dontShowAsOld)
      Specify whether rendering code should display old messages differently.
      Parameters:
      dontShowAsOld - boolean true if old messages shouldn't be displayed as old
    • getMessageModel

      public MessageModel getMessageModel()
      Get the data structure used to cache incoming APRS Messages.
      Returns:
      the MessageModel
    • getMessageCount

      public int getMessageCount()
      Get the number of APRS Messages collected by the application.
      Specified by:
      getMessageCount in interface GuiIfc
      Returns:
      message count
    • getKenwoodMessageListTableModel

      public KenwoodMessageListTableModel getKenwoodMessageListTableModel()
      Get the singleton KenwoodMessageListTableModel.
      Returns:
      KenwoodMessageListTableModel
    • invokeConfigWizard

      public void invokeConfigWizard()
      Start the configuration wizard at its first window.
      Specified by:
      invokeConfigWizard in interface GuiIfc
    • showConfigurationDialog

      public void showConfigurationDialog()
      Start the regular configuration dialog.
      Specified by:
      showConfigurationDialog in interface GuiIfc
    • isNightMode

      public boolean isNightMode()
      Report if the displays are in night mode.
      Specified by:
      isNightMode in interface GuiIfc
      Returns:
      boolean true if in night mode
    • setNightMode

      public void setNightMode(boolean isNight)
      Specify that the displays should be in night mode (black backgrounds with white text/lines, for not ruining the night vision of the operator).
      Specified by:
      setNightMode in interface GuiIfc
      Parameters:
      isNight - boolean true if should be in night mode
    • getIconImage

      public Image getIconImage()
      Get a reference to the Image used as the title bar icon of the main frame.
      Returns:
      Image of the program icon
    • createProgressReporter

      public StatusListener createProgressReporter(String title, boolean modal)
      Open whatever the local operating system uses for a progress dialog and return an interface to send progress information to the dialog.
      Specified by:
      createProgressReporter in interface GuiIfc
      Parameters:
      title - already-localized title String for the dialog
      modal - whether the dialog should be application-modal or modeless
      Returns:
      StatusListener to use for sending progress reports to the dialog
    • initializeWindowMenu

      public void initializeWindowMenu(Object item, Object view)
      Create the entries on the dynamic Window menu on the menu bar corresponding to every window except the one containing the menu bar.
      Specified by:
      initializeWindowMenu in interface GuiIfc
      Parameters:
      item - JMenuItem corresponding to the Window menu
      view - RootPaneContainer containing the menu bar
    • showGenericErrorDialog

      public void showGenericErrorDialog(String titleTag, String msg)
      Show a generic error message dialog, with the specified title and message text.
      Specified by:
      showGenericErrorDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
    • showGenericErrorDialogAlreadyLocalized

      public void showGenericErrorDialogAlreadyLocalized(String title, String msg)
      Show a generic error message dialog, with the specified title and message text.
      Specified by:
      showGenericErrorDialogAlreadyLocalized in interface GuiIfc
      Parameters:
      title - String dialog title (already localized)
      msg - already-localized and variable-substituted error message text String
    • showGenericInfoDialog

      public void showGenericInfoDialog(String titleTag, String msg)
      Show a generic informational message dialog, with the specified title and message text.
      Specified by:
      showGenericInfoDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
    • showGenericQuestionDialog

      public int showGenericQuestionDialog(String titleTag, String msg)
      Show a generic yes/no question dialog, with the specified title and message text.
      Specified by:
      showGenericQuestionDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
      Returns:
      0 for Yes, 1 for No, -1 for dialog closed without an explicit answer
    • showGenericQuestionDialogWithHelp

      public int showGenericQuestionDialogWithHelp(String titleTag, String msg)
      Show a generic yes/no question dialog, with the specified title and message text.
      Specified by:
      showGenericQuestionDialogWithHelp in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
      Returns:
      0 for Yes, 1 for No, 2 for Help, -1 for dialog closed without an explicit answer
    • showGenericConfirmDialog

      public int showGenericConfirmDialog(String titleTag, String msg)
      Show a generic retry/skip/cancel dialog, with the specified title and message text.
      Specified by:
      showGenericConfirmDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
      Returns:
      0 for Retry, 1 for Skip, 2 for Cancel, -1 for dialog closed without an explicit answer
    • showGenericInputDialog

      public String showGenericInputDialog(String titleTag, String msg)
      Show a generic text input dialog, with the specified title and message text.
      Specified by:
      showGenericInputDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted prompt message text String
      Returns:
      String text entered by user, or null to indicate dialog was closed without text entry
    • showCallsignInputDialog

      public String showCallsignInputDialog(String titleTag, String msg)
      Show a text input dialog, with the specified title and message text, that will only take a callsign-SSID value for input.
      Specified by:
      showCallsignInputDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted prompt message text String
      Returns:
      String text entered by user, or null to indicate dialog was closed without text entry
    • showCallsignInputDialog

      public String showCallsignInputDialog(String titleTag, String msg, String oldValue)
      Show a text input dialog, with the specified title and message text, that will only take a callsign-SSID value for input.
      Specified by:
      showCallsignInputDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted prompt message text String
      oldValue - String previous value, or null to leave blank
      Returns:
      String text entered by user, or null to indicate dialog was closed without text entry
    • showGenericPasswordDialog

      public String showGenericPasswordDialog(String titleTag, String msg)
      Show a generic text input dialog, with the specified title and message text, where the entered text is masked (as should be done when entering a password).
      Specified by:
      showGenericPasswordDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted prompt message text String
      Returns:
      String text entered by user, or null to indicate dialog was closed without text entry
    • showGenericStringChoiceDialog

      public String showGenericStringChoiceDialog(String titleTag, String msg, String[] choices)
      Show a generic choice-box dialog pre-populated with the specified strings, with the specified title and message text.
      Specified by:
      showGenericStringChoiceDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
      choices - String array of choices to populate the dropdown, or null for a text field
      Returns:
      String text entered by user or selected from choices, or null to indicate dialog was closed without text entry/selection
    • showGenericStringChoiceDialog

      public String showGenericStringChoiceDialog(String titleTag, String msg, String[] choices, String initialChoice)
      Show a generic choice-box dialog pre-populated with the specified strings, with the specified title and message text.
      Specified by:
      showGenericStringChoiceDialog in interface GuiIfc
      Parameters:
      titleTag - String tag to look up locale-specific dialog title
      msg - already-localized and variable-substituted error message text String
      choices - String array of choices to populate the dropdown, or null for a text field
      initialChoice - String to initialize the selection to, or null for no default
      Returns:
      String text entered by user or selected from choices, or null to indicate dialog was closed without text entry/selection
    • getImageIcon

      public static ImageIcon getImageIcon(Provider p)
      Load a Provider's image into a usable ImageIcon object.
      Parameters:
      p - Provider to specify the image relative path (null implies the CoreProvider of YAAC)
      Returns:
      ImageIcon of the Provider's specified image, or null if the Provider does not specify an icon image
    • showAboutDialog

      public void showAboutDialog()
      Display the About dialog for the YAAC application.
      Specified by:
      showAboutDialog in interface GuiIfc
    • showReleaseNotes

      public void showReleaseNotes()
      Display the release notes history for the YAAC application. Note this fetches the release notes over the Internet, so the notes may show changes in the future of the currently running build (if it hasn't been upgraded to the latest released build yet).
      Specified by:
      showReleaseNotes in interface GuiIfc
    • getSaveableTableInView

      public SaveableTable<?> getSaveableTableInView(Object c)
      Get the SaveableTable (if any) in the specified view.
      Specified by:
      getSaveableTableInView in interface GuiIfc
      Parameters:
      c - top-level window or view to be tested
      Returns:
      SaveableTable object in the view, or null if there isn't a SaveableTable in the view
    • buildStationComboBox

      public JComboBox buildStationComboBox(boolean addStandardAliases, boolean excludeObjects, boolean addTacticalAliases)
      Create a choice widget populated with all the known station callsigns heard by YAAC, sorted in alphanumeric order.
      Parameters:
      addStandardAliases - boolean true if standard service aliases should be prefixed to the list of station callsigns
      excludeObjects - boolean true if entries that only appear as Objects or Items should be excluded
      addTacticalAliases - boolean true if non-blank tactical aliases should be included in the list
      Returns:
      editable JComboBox whose model is loaded with the currently known callsigns
    • selectStation

      public Object selectStation(String titleBarTag, boolean stationsOnly, boolean inclTacticalAliases)
      Select one station (or object, if allowed) from the currently known list, or allow the user to manually type in a station callsign-SSID, and return the user selected value.
      Specified by:
      selectStation in interface GuiIfc
      Parameters:
      titleBarTag - String tag for localized title to display in popup dialog
      stationsOnly - boolean true if entries appearing only as Objects/Items should be excluded from the pick list
      inclTacticalAliases - boolean true if tactical aliases of stations and objects should be included in the selection list
      Returns:
      String if user manually entered, StationState or String if selected from the pick list, or null if user cancelled the operation
    • selectOneOf

      public int selectOneOf(String title, String[] choices)
      Create a popup dialog to ask the user which of several choices should be used.
      Specified by:
      selectOneOf in interface GuiIfc
      Parameters:
      title - String title to display in dialog box title
      choices - array of String choices to choose from
      Returns:
      index of selected choice, or -1 if the dialog was cancelled without selecting a choice
    • selectOneOf

      public static int selectOneOf(Window window, String title, String[] choices)
      Create a popup dialog to ask the user which of several choices should be used.
      Parameters:
      window - Window to parent the displayed dialog
      title - String title to display in dialog box title
      choices - array of String choices to choose from
      Returns:
      index of selected choice, or -1 if the dialog was cancelled without selecting a choice
    • makeGBC

      public static GridBagConstraints makeGBC(int x, int y)
      Convenience method to help build GridBagConstraints for any handlers created by the Provider that are laid out with GridBagLayout, creating a cell position for a 1x1 cell with left-aligned contents, weighted equally.
      Parameters:
      x - int value to use for gridx
      y - int value to use for gridy
      Returns:
      GridBagConstraints
    • makeGBC

      public static GridBagConstraints makeGBC(int x, int y, int w)
      Convenience method to help build GridBagConstraints for any handlers created by the Provider that are laid out with GridBagLayout, creating a cell position for a 1x1 cell with left-aligned contents, weighted equally.
      Parameters:
      x - int value to use for gridx
      y - int value to use for gridy
      w - int value to use for gridwidth
      Returns:
      GridBagConstraints
    • makeGBC

      public static GridBagConstraints makeGBC(int x, int y, int w, boolean fill)
      Convenience method to help build GridBagConstraints for any handlers created by the Provider that are laid out with GridBagLayout, creating a cell position for a 1x1 cell with left-aligned contents, weighted equally.
      Parameters:
      x - int value to use for gridx
      y - int value to use for gridy
      w - int value to use for gridwidth
      fill - boolean true if constraints should specify filling the cell, false otherwise
      Returns:
      GridBagConstraints
    • makeGBC

      public static GridBagConstraints makeGBC(int x, int y, int w, int h)
      Convenience method to help build GridBagConstraints for any handlers created by the Provider that are laid out with GridBagLayout, creating a cell position for a 1x1 cell with left-aligned contents, weighted equally.
      Parameters:
      x - int value to use for gridx
      y - int value to use for gridy
      w - int value to use for gridwidth
      h - int value to use for gridheight
      Returns:
      GridBagConstraints
    • loadAprsPackets

      public void loadAprsPackets()
      Query the user for a file from which to load saved APRS messages.
      Specified by:
      loadAprsPackets in interface GuiIfc
    • saveAprsPackets

      public void saveAprsPackets()
      Query the user for a file in which to save the current visible set of APRS messages.
      Specified by:
      saveAprsPackets in interface GuiIfc
    • displayOsmMirrorSiteList

      public void displayOsmMirrorSiteList()
      Display a popup with buttons to launch the user's web browser pointed at any of the major download sites for raw OpenStreetMap data.
      Specified by:
      displayOsmMirrorSiteList in interface GuiIfc
    • displayOsmImportDialog

      public GuiIfc.OsmImportParams displayOsmImportDialog(File osmFileDir)
      Ask the user how and where from to import an OpenStreetMap compressed data file.
      Specified by:
      displayOsmImportDialog in interface GuiIfc
      Parameters:
      osmFileDir - File pointing at the directory to initially look for importable OSM data files
      Returns:
      null if user cancelled the request, or an OsmImportParams object containing the import parameters
    • displayOsmTileDownloadDialog

      public GuiIfc.TileDownloadParams displayOsmTileDownloadDialog(ChangeSet localChangeSet, ChangeSet serverChangeSet)
      Display a dialog asking the user which pre-compiled OSM tiles to download.
      Specified by:
      displayOsmTileDownloadDialog in interface GuiIfc
      Parameters:
      localChangeSet - the OSM ChangeSet of the last data downloaded or imported here (or null if OSM data was never installed)
      serverChangeSet - the OSM ChangeSet currently available on the YAAC website
      Returns:
      null if the user cancelled the request, or a TileDownloadParams structure containing the needed parameters for the download
    • displayTopoTileDownloadDialog

      public GuiIfc.TileDownloadParams displayTopoTileDownloadDialog(File tileDir)
      Display a dialog asking the user which SRTM tiles to download.
      Specified by:
      displayTopoTileDownloadDialog in interface GuiIfc
      Parameters:
      tileDir - File pointing at the directory where tiles are kept
      Returns:
      null if the user cancelled the request, or a TileDownloadParams structure containing the needed parameters for the download
    • selectFileForWrite

      public File selectFileForWrite(File dir, String fileExtensionTag, String fileExtension)
      Open a file selection dialog for saving a file.
      Specified by:
      selectFileForWrite in interface GuiIfc
      Parameters:
      dir - File for the initial directory
      fileExtensionTag - String tag for looking up localized string of file type description
      fileExtension - String file type
      Returns:
      selected File to save the content to, or null if cancelled
    • selectFile

      public String selectFile(boolean isDirectory, String promptTag, String fileSelectTag)
      Select a file using an O/S-provided file chooser.
      Specified by:
      selectFile in interface GuiIfc
      Parameters:
      isDirectory - boolean true if user should select a directory, false to select a file
      promptTag - String key to ResourceBundle localized dialog title
      fileSelectTag - String key to ResourceBundle localized select button label
      Returns:
      String of selected file path, or null if not selected
    • importConfigFromFile

      public void importConfigFromFile()
      Import a configuration from a saved XML file (File->Configure->Export to File) with appropriate interferences for callsign, directory, and serial port changing.
      Specified by:
      importConfigFromFile in interface GuiIfc
    • analyzeConfiguration

      public void analyzeConfiguration()
      Analyze the current configuration to report what the station as a whole will do. Intended to catch unreasonable configurations that don't do what the user wants it to do.
      Specified by:
      analyzeConfiguration in interface GuiIfc
    • showRawPacketFrame

      public void showRawPacketFrame()
      Display the singleton raw packet window.
      Specified by:
      showRawPacketFrame in interface GuiIfc
    • showMessageFrame

      public void showMessageFrame()
      Open the MessageFrame (window displaying text message traffic in a table) and move it to the foreground. This may be called from any thread (not just the GUI dispatch thread).
      Specified by:
      showMessageFrame in interface GuiIfc
    • showMessageFilterPane

      public void showMessageFilterPane()
      Display the window used for receiving and logging filtered text messages. Intended to support proposed field event logging as described in http://aprs.org/aprsevent.html
      Specified by:
      showMessageFilterPane in interface GuiIfc
    • showBulletinBoard

      public void showBulletinBoard()
      Display the window used to display bulletin messages, and compose locally originated bulletins for transmission.
      Specified by:
      showBulletinBoard in interface GuiIfc
    • showOutstandingMessages

      public void showOutstandingMessages()
      Display the window showing all messages (except beacons and status messages) pending for transmission from the local station.
      Specified by:
      showOutstandingMessages in interface GuiIfc
    • showBandwidthMonitor

      public void showBandwidthMonitor()
      Display a bandwidth monitor for each open I/O port in YAAC.
      Specified by:
      showBandwidthMonitor in interface GuiIfc
    • showGpsStatusDialog

      public void showGpsStatusDialog()
      Display a monitor of the current status of all GPS receivers connected to YAAC.
      Specified by:
      showGpsStatusDialog in interface GuiIfc
    • showWeatherDialog

      public void showWeatherDialog()
      Display a monitor of the current conditions reported by the local weather station attached to YAAC.
      Specified by:
      showWeatherDialog in interface GuiIfc
    • showLocalObjects

      public void showLocalObjects()
      Display a table of all Objects/Items being transmitted by this station.
      Specified by:
      showLocalObjects in interface GuiIfc
    • showHeardList

      public void showHeardList()
      Display a report of number of packets received from each station (or about each APRS Object/Item) over 15 minute intervals in the YAAC history.
      Specified by:
      showHeardList in interface GuiIfc
    • showRadioView

      public void showRadioView(Message msg, String identifier)
      Show the dialog that looks like the Kenwood D710 control head APRS display.
      Specified by:
      showRadioView in interface GuiIfc
      Parameters:
      msg - a historical APRS Message to display, or null to display current real-time data
      identifier - the originating station callsign associated with the historical message (ignored if null msg)
    • isShowOnlyRFOnRadioView

      public boolean isShowOnlyRFOnRadioView()
      Report if Radio View window should only display packets received from RF.
      Returns:
      boolean true if only RF packets will be displayed on Radio View
    • setShowOnlyRFOnRadioView

      public void setShowOnlyRFOnRadioView(boolean onlyRFOnRadioView)
      Specify if Radio View window should only display packets received from RF.
      Parameters:
      onlyRFOnRadioView - boolean true if only RF packets will be displayed on Radio View
    • isShowRadioViewOnStartup

      public boolean isShowRadioViewOnStartup()
      Report if Radio View window should be automatically opened upon startup.
      Returns:
      boolean true if Radio View should be automatically opened
    • setShowRadioViewOnStartup

      public void setShowRadioViewOnStartup(boolean showRadioViewOnStartup)
      Specify if Radio View window should be automatically opened upon startup.
      Parameters:
      showRadioViewOnStartup - boolean true if Radio View should be automatically opened
    • isHideRealCallsignWhenHasTactical

      public boolean isHideRealCallsignWhenHasTactical()
      Report if callsign combobox lists should exclude callsigns of stations with aliases (tactical names).
      Returns:
      boolean true if combo lists should exclude callsigns of included tactical names
    • setHideRealCallsignWhenHasTactical

      public void setHideRealCallsignWhenHasTactical(boolean hideRealCallsignWhenHasTactical)
      Specify if callsign combobox lists should exclude callsigns of stations with aliases (tactical names).
      Parameters:
      hideRealCallsignWhenHasTactical - boolean true if combo lists should exclude callsigns of included tactical names
    • showMap

      public void showMap()
      Make visible and foreground the map window.
      Specified by:
      showMap in interface GuiIfc
    • displayStationSpecificMap

      public void displayStationSpecificMap(StationState station)
      Open a map window centered on the station or object specified.
      Specified by:
      displayStationSpecificMap in interface GuiIfc
      Parameters:
      station - StationState to center on
    • showStationList

      public void showStationList()
      Show the window listing all the stations and objects heard by this station.
      Specified by:
      showStationList in interface GuiIfc
    • showEditFilterDialog

      public void showEditFilterDialog(Filter mainFilter, String dialogTitleTag)
      Generate and display the filter dialog.
      Specified by:
      showEditFilterDialog in interface GuiIfc
      Parameters:
      mainFilter - the top Filter in the Filter hierarchy
      dialogTitleTag - bundle tag for title to display on dialog
    • showEditBlacklistDialog

      public void showEditBlacklistDialog()
      Generate and display the blacklist editor.
      Specified by:
      showEditBlacklistDialog in interface GuiIfc
    • loadObjectsFromFile

      public void loadObjectsFromFile()
      Load APRS Object definitions from a user-specified file, using the .pos file format originated by UI-View.
      Specified by:
      loadObjectsFromFile in interface GuiIfc
    • saveObjectsToFile

      public void saveObjectsToFile()
      Save the currently known APRS Objects to a file.
      Specified by:
      saveObjectsToFile in interface GuiIfc
    • loadTacticalNames

      public void loadTacticalNames()
      Load alias names and symbol codes for station callsigns and object names.
      Specified by:
      loadTacticalNames in interface GuiIfc
    • saveTacticalNames

      public void saveTacticalNames()
      Save alias names and symbol codes for station callsigns and object names.
      Specified by:
      saveTacticalNames in interface GuiIfc
    • showHistory

      public void showHistory(StationState ss)
      Display the message history for a specified station or object.
      Specified by:
      showHistory in interface GuiIfc
      Parameters:
      ss - StationState of the desired station or object
    • showTelemetryReport

      public void showTelemetryReport()
      Display all the current telemetry data heard by this station.
      Specified by:
      showTelemetryReport in interface GuiIfc
    • showHealthMonitorReport

      public void showHealthMonitorReport()
      Show the current station health reports for all remote stations being monitored.
      Specified by:
      showHealthMonitorReport in interface GuiIfc
    • showTXIGatedStations

      public void showTXIGatedStations()
      Show a table view of the stations currently being Tx I-gated by this station.
      Specified by:
      showTXIGatedStations in interface GuiIfc
    • ensureKeystoreIsOpen

      public boolean ensureKeystoreIsOpen(boolean dontBlock)
      Test if keystore has been opened with the correct password. If it hasn't, prompt the user for the password so the keystore can be opened,
      Specified by:
      ensureKeystoreIsOpen in interface GuiIfc
      Parameters:
      dontBlock - boolean true if this method should return immediately without blocking
      Returns:
      boolean true if the keystore is now open
    • showKeys

      public void showKeys()
      Show a table view of the keys used to authenticate and verify the integrity of signed messages.
      Specified by:
      showKeys in interface GuiIfc
    • showDXReports

      public void showDXReports()
      Show a table view of all DX reports received by this station.
      Specified by:
      showDXReports in interface GuiIfc
    • showConnectionReport

      public void showConnectionReport()
      Display outstanding connected (I-frame) AX.25 sessions.
      Specified by:
      showConnectionReport in interface GuiIfc
    • setTableColumnsWidths

      public static int setTableColumnsWidths(ColumnSizingTableModel tm, JTable table)
      Use the ColumnSizingTableModel to adjust the size of the table columns.
      Parameters:
      tm - ColumnSizingTableModel to extract widths from
      table - JTable whose column sizes should be adjusted
      Returns:
      total number of horizontal pixels allotted to sized columns
    • displayLocateLandmarkDialog

      public void displayLocateLandmarkDialog()
      Display the Locate Landmark dialog, and handle user input to it.
      Specified by:
      displayLocateLandmarkDialog in interface GuiIfc
    • composeWinlinkMessage

      public void composeWinlinkMessage()
      Display a form to allow transmitting a multi-line email message to someone via the APRS-WinLink gateways.
      Specified by:
      composeWinlinkMessage in interface GuiIfc
    • connectToStation

      public void connectToStation()
      Set up a dumb-terminal connection to an old-style packet BBS.
      Specified by:
      connectToStation in interface GuiIfc
    • confirmSendBroadcastQuery

      public void confirmSendBroadcastQuery(String confirmTag, String query)
      Broadcast a specified global query message after confirming the user really wants to send it.
      Specified by:
      confirmSendBroadcastQuery in interface GuiIfc
      Parameters:
      confirmTag - tag for resource file message for the confirmation query
      query - the actual APRS message to send (must be valid according to the APRS protocol specification)
    • approveTacticalSender

      public void approveTacticalSender(String originatingCallsign, String tacticalMsgText)
      Queue up a request to ask the user whether this TACTICAL message should be accepted and processed. This is expected to be called from a background thread, so the implementor is required to move it to the GUI dispatch thread.
      Specified by:
      approveTacticalSender in interface GuiIfc
      Parameters:
      originatingCallsign - callsign String of message originator
      tacticalMsgText - String of text message body (the TACTICAL directive)
    • sendQRU

      public void sendQRU()
      Broadcast a specified QRU query message after confirming the user really wants to send it. and asking which QRU category to ask for.
      Specified by:
      sendQRU in interface GuiIfc
    • invokeObjectEditor

      public void invokeObjectEditor(String dialogTitleTag, Message or, int mouseX, int mouseY, ObjectReportTransmitter tx)
      Display the Object editing dialog, possibly initialized with the contents of an existing ObjectReport.
      Specified by:
      invokeObjectEditor in interface GuiIfc
      Parameters:
      dialogTitleTag - String tag for localized title to display on dialog title bar
      or - APRS Message to initialize the editor, or null for creating an object from scratch
      mouseX - window X coordinate of mouse click (to generate initial coordinates), or -1 to not init position from map
      mouseY - window Y coordinate of mouse click (to generate initial coordinates), or -1 to not init position from map
      tx - ObjectReportTransmitter to give any created or updated objects to
    • invokeObjectEditor

      public void invokeObjectEditor(String dialogTitleTag, Message or, int mouseX, int mouseY, ObjectReportTransmitter tx, Scope scope)
      Display the Object editing dialog, possibly initialized with the contents of an existing ObjectReport.
      Specified by:
      invokeObjectEditor in interface GuiIfc
      Parameters:
      dialogTitleTag - String tag for localized title to display on dialog title bar
      or - APRS Message to initialize the editor, or null for creating an object from scratch
      mouseX - window X coordinate of mouse click (to generate initial coordinates), or -1 to not init position from map
      mouseY - window Y coordinate of mouse click (to generate initial coordinates), or -1 to not init position from map
      tx - ObjectReportTransmitter to give any created or updated objects to
      scope - Scope for new ObjectReport (ignored for existing ObjectReports), or null for default
    • editStationNotes

      public void editStationNotes(StationState station, int mouseX, int mouseY)
      Display and edit notes attached to a specific station or object.
      Specified by:
      editStationNotes in interface GuiIfc
      Parameters:
      station - StationState whose notes should be edited
      mouseX - window X coordinate of mouse click (to generate initial coordinates), or -1 to not init position from map
      mouseY - window Y coordinate of mouse click (to generate initial coordinates), or -1 to not init position from map
    • setStationTimeout

      public void setStationTimeout(StationState station)
      Edit the timeout value for the specified station.
      Specified by:
      setStationTimeout in interface GuiIfc
      Parameters:
      station - StationState whose inactivity time limit is to be modified
    • showTrackedStationsList

      public void showTrackedStationsList()
      Display a dialog for viewing and modifying the list of specifically tracked stations.
      Specified by:
      showTrackedStationsList in interface GuiIfc
    • showIOFailureDialog

      public void showIOFailureDialog(PortConfig config, String reason, PortFailureReportListener listener)
      Display an asynchronous non-blocking dialog on the screen to report an I/O error. This method should only be called from background threads (such as port I/O handling threads), and not from the AWT dispatch thread.
      Specified by:
      showIOFailureDialog in interface GuiIfc
      Parameters:
      config - PortConfig object describing the port with the problem, or null if not about a specific port
      reason - String describing why the port is down
      listener - I/O subsystem that wants to be informed if the user dismisses the dialog
    • closeCurrentWindow

      public void closeCurrentWindow()
      Close the window that currently has the keyboard focus (if it is part of the YAAC application).
      Specified by:
      closeCurrentWindow in interface GuiIfc
    • pickAStation

      public StationState pickAStation(List<StationState> matchList, String titleTag)
      Select one of several stations.
      Specified by:
      pickAStation in interface GuiIfc
      Parameters:
      matchList - ArrayList of StationState objects to pick from
      titleTag - String name of resource tag for title of prompting dialog
      Returns:
      selected StationState, or null if the user cancelled
    • pickObject

      public Object pickObject(String titleTag, List<Object> matchList)
      Select one of several objects. The toString() method of each object in the specified list must return the name that should be displayed in the list for the object.
      Specified by:
      pickObject in interface GuiIfc
      Parameters:
      titleTag - String name of resource tag for title of prompting dialog
      matchList - java.util.List of objects to pick from
      Returns:
      selected StationState, or null if the user cancelled
    • getCurrentlyFocusedWindow

      public static Window getCurrentlyFocusedWindow()
      Determine which YAAC window currently has the keyboard focus. Note this overrides the normal Java AWT/Swing behavior in one case: when a new Window is being created and its menu bar is being built, this returns the window under construction, under the assumption that JCheckboxMenuItems will try to call this method for the Window under construction and would normally get the Window that requested the construction (which would be the wrong context for a menu callback).
      Returns:
      currently focused Window
    • getCurrentlyFocusedView

      public Object getCurrentlyFocusedView()
      Get the UI platform top-level widget that currently holds the focus.
      Specified by:
      getCurrentlyFocusedView in interface GuiIfc
      Returns:
      top-level GUI object
    • getCurrentTopLevelView

      public Object getCurrentTopLevelView()
      Get the UI platform top-level widget that currently holds the focus, skipping child dialogs.
      Specified by:
      getCurrentTopLevelView in interface GuiIfc
      Returns:
      top-level GUI object
    • getRawPacketTableModel

      public RawPacketTableModel getRawPacketTableModel()
      Get the raw packet table model managed by this GUI.
      Returns:
      RawPacketTableModel instance
    • scheduleToGuiThread

      public void scheduleToGuiThread(Runnable r)
      Schedule a short-running operation that should only occur on the GUI dispatch thread (however the implementing GUI chooses to do it).
      Specified by:
      scheduleToGuiThread in interface GuiIfc
      Parameters:
      r - Runnable to be scheduled as soon as possible on the GUI thread
    • isViewPrintable

      public boolean isViewPrintable(Object o, int depthLeft)
      Test if specified GUI view is printable.
      Specified by:
      isViewPrintable in interface GuiIfc
      Parameters:
      o - Object of view container
      depthLeft - number of levels of recursion allowed for the search
      Returns:
      boolean true if view is printable
      See Also:
    • findPrintableView

      public static PrintableView findPrintableView(Component c, int depthLeft)
      Search the specified widget and its child widgets for a visible PrintableView.
      Parameters:
      c - Component to check
      depthLeft - int number of child generations that can still be searched
      Returns:
      found visible PrintableView, or null if nothing visible in the hierarchy can be printed
    • printWindow

      public void printWindow()
      Print the window that currently has the focus.
      Specified by:
      printWindow in interface GuiIfc
      See Also:
    • setMemoryGCPanelVisible

      public void setMemoryGCPanelVisible(boolean visible)
      Change the visibility of the memory usage status monitor.
      Specified by:
      setMemoryGCPanelVisible in interface GuiIfc
      Parameters:
      visible - boolean true if memory status monitor should be visible
    • isMemoryGCPanelVisible

      public boolean isMemoryGCPanelVisible()
      Report the current visibility of the MemoryGCPanel.
      Specified by:
      isMemoryGCPanelVisible in interface GuiIfc
      Returns:
      boolean true if panel is visible
    • displayHeardByDialog

      public Object[] displayHeardByDialog(StationState[] stationsToPickFrom)
      Display a dialog asking for the parameters for a Heard-By (?APRSH) query.
      Specified by:
      displayHeardByDialog in interface GuiIfc
      Parameters:
      stationsToPickFrom - array of StationState objects specifying the list of stations to choose from, or null to get all currently known stations
      Returns:
      null if the query was cancelled, or a two-element array specifying the station to query and the station that the queried station might have heard
    • displayMessagingDialog

      public GuiIfc.MessagingParams displayMessagingDialog(ArrayList ssList)
      Display a dialog asking the user for the parameters needed to send a text message to another station.
      Specified by:
      displayMessagingDialog in interface GuiIfc
      Parameters:
      ssList - list of stations to populate the list with, or null for entire list of known stations
      Returns:
      null if the user cancelled the request, or a MessagingParams structure containing the parameters
    • startChatSession

      public void startChatSession(String callsign)
      Open a Chat session window pointed at the specified remote station.
      Specified by:
      startChatSession in interface GuiIfc
      Parameters:
      callsign - String senderCallsign of the remote station
    • displayHelp

      public void displayHelp(String startingHelpId, Object parentWindow)
      Launch the JavaHelp browser, starting with the help corresponding to the specified help ID
      Specified by:
      displayHelp in interface GuiIfc
      Parameters:
      startingHelpId - String help ID corresponding to an entry in a *.jhm file; null indicates the top of the TOC view, empty string indicates the top of the Index view
      parentWindow - window to parent an incarnation of the HelpBroker
    • clearAccruedHelpSets

      public static void clearAccruedHelpSets()
      Clean up cached HelpSet data. Used by PluginStoreTableModel when adding a new plugin that provides help.
    • checkForUpdates

      public void checkForUpdates(boolean interactive)
      Check whether a newer release of YAAC is available, displaying status.
      Specified by:
      checkForUpdates in interface GuiIfc
      Parameters:
      interactive - boolean true if no-upgrade-needed status should be reported (out-of-date status is always reported)
    • showPluginStore

      public void showPluginStore()
      Display a dialog for selecting new officially supported plugins to install.
      Specified by:
      showPluginStore in interface GuiIfc
    • clearAllSpecificTrackStripes

      public void clearAllSpecificTrackStripes()
      Clear the plotting of all specific station/object track stripes.
      Specified by:
      clearAllSpecificTrackStripes in interface GuiIfc
    • addSpecificTrackStripe

      public void addSpecificTrackStripe(String identifier)
      Add the identifier of a single station or object whose track stripe is to be plotted.
      Specified by:
      addSpecificTrackStripe in interface GuiIfc
      Parameters:
      identifier - String station or object identifier
    • removeSpecificTrackStripe

      public boolean removeSpecificTrackStripe(String identifier)
      Remove the identifier of a single station or object whose track stripe is no longer to be plotted.
      Specified by:
      removeSpecificTrackStripe in interface GuiIfc
      Parameters:
      identifier - String station or object identifier
      Returns:
      boolean true if identifier was removed
    • isSpecificallyTracked

      public boolean isSpecificallyTracked(String identifier)
      Test if a given identifier is on the tracking list.
      Specified by:
      isSpecificallyTracked in interface GuiIfc
      Parameters:
      identifier - String station or object identifier
      Returns:
      boolean true if this identifier is marked for track stripe display
    • isSpecificallyTracking

      public boolean isSpecificallyTracking()
      Test if any identifiers are on the tracking list.
      Specified by:
      isSpecificallyTracking in interface GuiIfc
      Returns:
      boolean true if any stations are specifically tagged for tracking
    • isMousePressed

      public static boolean isMousePressed()
      Check current state of mouse. This is to handle cases where a mouse drag is started prematurely because the mouse press invoked the removal of a popup menu over the containing window before the mouse release was reported.
      Returns:
      boolean true if last state of mouse was pressed
    • acceptInbound

      public boolean acceptInbound(ConnState state, AX25Callsign originator, Connector port)
      Decide whether to accept the specified inbound AX.25 connected-mode session request. Note that the state is not fully connected at the point of this call (so the called code can choose to reject it), so the called code should register a ConnectionEstablishmentListener on the ConnState to be informed when the connection is fully established if the called code chooses to accept the connection request. Note this code is called from the background AX25Stack thread, so should respond quickly and not invoke any GUI functions directly.
      Specified by:
      acceptInbound in interface ConnectionRequestListener
      Parameters:
      state - ConnState object describing the session being built
      originator - AX25Callsign of the originating station
      port - Connector through which the request was received
      Returns:
      boolean true if request should be accepted, false if not
      See Also:
    • getSpeechCustomGrammarForCurrentView

      public SpeechMapGeneratorIfc getSpeechCustomGrammarForCurrentView()
      Ask the current window whether it has any overriding grammar for speech command. If it does, an object that will generate a map of speakable command strings (with certain macros) to the corresponding handlers should be returned. If the window does not have any overrides, the speech command plugin will continue to use the default grammar.

      For example, one command string for the message sender dialog could be:

      to <callsign> via <alias>
      Specified by:
      getSpeechCustomGrammarForCurrentView in interface GuiIfc
      Returns:
      SpeechMapGeneratorIfc implementation, or null if no customization