Class Chat

All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible, AprsMessageListener

public class Chat extends JPanel implements AprsMessageListener, WindowListener, Runnable
This class defines a chat window for doing SMS-type chatting with a single other station over APRS using Message packets. The window contains two regions:
  • a scrollpane of text recording the history of the conversation
  • a text field for the local user to compose the next text to send
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Method Details

    • startChatSession

      public static void startChatSession(String callsign)
      Open a Chat session window pointed at the specified remote station.
      Parameters:
      callsign - String callsign of the remote station
    • 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:
    • run

      public void run()
      Do not call. Used to execute chat message reception on the AWT dispatch thread.
      Specified by:
      run in interface Runnable
    • windowOpened

      public void windowOpened(WindowEvent e)
      Invoked the first time a window is made visible.
      Specified by:
      windowOpened in interface WindowListener
    • windowClosing

      public void windowClosing(WindowEvent e)
      Invoked when the user attempts to close the window from the window's system menu.
      Specified by:
      windowClosing in interface WindowListener
    • windowClosed

      public void windowClosed(WindowEvent e)
      Invoked when a window has been closed as the result of calling dispose on the window.
      Specified by:
      windowClosed in interface WindowListener
    • windowIconified

      public void windowIconified(WindowEvent e)
      Invoked when a window is changed from a normal to a minimized state. For many platforms, a minimized window is displayed as the icon specified in the window's iconImage property.
      Specified by:
      windowIconified in interface WindowListener
      See Also:
    • windowDeiconified

      public void windowDeiconified(WindowEvent e)
      Invoked when a window is changed from a minimized to a normal state.
      Specified by:
      windowDeiconified in interface WindowListener
    • windowActivated

      public void windowActivated(WindowEvent e)
      Invoked when the Window is set to be the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.
      Specified by:
      windowActivated in interface WindowListener
    • windowDeactivated

      public void windowDeactivated(WindowEvent e)
      Invoked when a Window is no longer the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.
      Specified by:
      windowDeactivated in interface WindowListener
    • getChatForCallsign

      public static Chat getChatForCallsign(String otherStationCallsign)
      Find an open Chat window for the specified callsign.
      Parameters:
      otherStationCallsign - String callsign of other station
      Returns:
      open Chat window, or null if Chat isn't running for that station yet