Class AbstractPopupMenuAction

java.lang.Object
org.ka2ddo.yaac.pluginapi.AbstractMenuAction
org.ka2ddo.yaac.pluginapi.AbstractPopupMenuAction
All Implemented Interfaces:
Serializable, AddToPopupMapMenuIfc

public abstract class AbstractPopupMenuAction extends AbstractMenuAction implements AddToPopupMapMenuIfc
This class defines the general contract for a popup menu action, using the same rules as for a menu bar action. Additional methods are defined so that the menu entry can be selectively added to the popup menu depending on the context being popped up, i.e., does it make sense to have this menu entry for the right-clicked context invoking the popup menu? Note that popup menus can be invoked both on the YAAC map window (contained in the GeographicalMap window and drawn by its subsidiary StationRenderer and OSMLayer map layers), and in tabular views such as the RawPacketPane and StationListViewer.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Details

    • mouseX

      protected transient int mouseX
      Screen pixel X coordinate where mouse was located when popup menu was requested.
    • mouseY

      protected transient int mouseY
      Screen pixel Y coordinate where mouse was located when popup menu was requested.
    • proj

      protected transient com.bbn.openmap.proj.Projection proj
      current Projection of the map window.
    • matchList

      protected transient List<StationState> matchList
      ArrayList of stations and objects located at the clicked point on the map, or single-element ArrayList of the station in the table.
    • frame

      protected transient AX25Frame frame
      Packet at the clicked-on row in the table, or null if not relevant.
    • widgetContentType

      protected transient GuiContentType widgetContentType
      Widget that asked for the popup menu.
  • Constructor Details

    • AbstractPopupMenuAction

      protected AbstractPopupMenuAction(String nameTag, String[] menuPositionNames)
      Construct an AbstractPopupMenuAction with the specified ResourceBundle lookup tag for the name, and hierarchical position in the JMenus.
      Parameters:
      nameTag - lookup String for the above name in ResourceBundles
      menuPositionNames - array of Strings identifying the localized name strings
    • AbstractPopupMenuAction

      protected AbstractPopupMenuAction(String nameTag, String[] menuPositionNames, String buttonGroupName)
      Construct an AbstractPopupMenuAction with the specified ResourceBundle lookup tag for the name, and hierarchical position in the JMenus.
      Parameters:
      nameTag - lookup String for the above name in ResourceBundles
      menuPositionNames - array of Strings identifying the localized name strings of the parent JMenus to contain the generated JRadioButtonMenuItem
      buttonGroupName - String name of ButtonGroup this JRadioButtonMenuItem
    • AbstractPopupMenuAction

      protected AbstractPopupMenuAction(String nameTag, String[] menuPositionNames, int priority)
      Construct an AbstractPopupMenuAction with the specified ResourceBundle lookup tag for the name, and hierarchical position in the JMenus.
      Parameters:
      nameTag - lookup String for the above name in ResourceBundles
      menuPositionNames - array of Strings identifying the localized name strings of the parent JMenus to contain the generated JMenuItem
      priority - int relative priority of this menu item relative to other
    • AbstractPopupMenuAction

      protected AbstractPopupMenuAction(String nameTag, String[] menuPositionNames, int priority, String buttonGroupName)
      Construct an AbstractPopupMenuAction with the specified ResourceBundle lookup tag for the name, and hierarchical position in the JMenus.
      Parameters:
      nameTag - lookup String for the above name in ResourceBundles
      menuPositionNames - array of Strings identifying the localized name strings of the parent JMenus to contain the generated JRadioButtonMenuItem
      priority - int relative priority of this menu item relative to other menu items on its lowest JMenu
      buttonGroupName - String name of ButtonGroup this JRadioButtonMenuItem
    • AbstractPopupMenuAction

      protected AbstractPopupMenuAction(String nameTag, String[] menuPositionNames, int priority, boolean initialState)
      Construct an AbstractPopupMenuAction with the specified ResourceBundle lookup tag for the name, and hierarchical position in the JMenus.
      Parameters:
      nameTag - lookup String for the above name in ResourceBundles
      menuPositionNames - array of Strings identifying the localized name strings of the parent JMenus to contain the generated JMenuItem
      priority - int relative priority of this menu item relative to other
      initialState - initial state of JCheckBoxMenuItem to be created
  • Method Details

    • setContext

      public void setContext(int mx, int my, com.bbn.openmap.proj.Projection proj, List<StationState> matchList, AX25Frame frame, GuiContentType widgetContentType)
      Called by popup menu creation code to establish context information for the menu item's actionPerformed() method.
      Parameters:
      mx - int screen pixel X coordinate where popup menu was invoked, or -1 for not map-invoked
      my - int screen pixel Y coordinate where popup menu was invoked, or table model row number for table view, or -1 for other non-map-invoked
      proj - current Projection of the map window (null if the right-click was not on the map)
      matchList - ArrayList of stations and objects located at the clicked point on the map or in the selected table row
      frame - AX25Frame of selected packet in a table view (or null if not relevant)
      widgetContentType - GuiContentType of the widget launching a popup menu
    • setContext

      public void setContext(List<StationState> matchList, AX25Frame frame, GuiContentType widgetContentType)
      Called by popup menu creation code to establish context information for the menu item's actionPerformed() method.
      Parameters:
      matchList - ArrayList of stations and objects located at the clicked point on the map or in the selected table row
      frame - AX25Frame of selected packet in a table view (or null if not relevant)
      widgetContentType - GuiContentType of the widget launching a popup menu