Class MessageFilterPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, AprsMessageListener, FontChangeListener

public class MessageFilterPane extends JTabbedPane implements AprsMessageListener, FontChangeListener
This class defines the filters and UI for selectively capturing the contents of Messages. Of incoming messages, only the following go to this intercept path:
  • by originating station, doing either whitelist or blacklist
  • by destination addressee (self, bulletin groups)
  • by regular expression pattern match on message body
Matching messages are logged to a specified ASCII text log file in a specified format, including:
  • CSV or TSV delimiting
  • entire message body or groups specified by regular expression
  • date/time of receipt (user-specified format and timezone)
  • sending station
  • lat/lon of sending station

The format is converted from a text string to an ordered list of objects defining the output line. The object types are:

  • String - literal text to append to the line
  • \{ - literal text of "{"
  • {0} - the entire message body (indicated by Integer zero)
  • {timeformat} - the date/time of receipt, as formatted by SimpleDateFormat
  • {C} - sending callsign
  • {A} - addressee
  • {L} - sending latitude, using standard display format
  • {l} - sending longitude, using standard display format
  • {L0#.####} - sending latitude, using zeros and # characters per DecimalFormat
  • {l0#.####} - sending longitude, using zeros and # characters per DecimalFormat
  • {1} through {9} - regular expression groups from the pattern matching regex (indicated by Integer objects)

Messages are also appended to a JTextArea which can be copy-and-pasted to the system clipboard for inclusion in other applications.

Author:
Andrew Pavlin, KA2DDO
See Also:
  • Method Details

    • showMessageFilterPane

      public static void showMessageFilterPane()
      Display the singleton MessageFilterPane (wrapped in a JFrame) in the GUI foreground.
    • aprsMessageReceived

      public void aprsMessageReceived(Message msg)
      Delivers the next message received by YAAC that is an APRS message.
      Specified by:
      aprsMessageReceived in interface AprsMessageListener
      Parameters:
      msg - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
      See Also:
    • setMatchPattern

      public void setMatchPattern(String pattern)
      Set the regular expression (regex) pattern to use for filtering APRS text messages.
      Parameters:
      pattern - String of regular expression
    • fontChanged

      public void fontChanged(String category, Font newFont)
      Report that the font choice for the specified category has changed.
      Specified by:
      fontChanged in interface FontChangeListener
      Parameters:
      category - String font family name (as defined by Font class)
      newFont - actual font instance