Package org.ka2ddo.yaac.pluginapi
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 Summary
Modifier and TypeFieldDescriptionprotected AX25Frame
Packet at the clicked-on row in the table, or null if not relevant.protected List<StationState>
ArrayList of stations and objects located at the clicked point on the map, or single-element ArrayList of the station in the table.protected int
Screen pixel X coordinate where mouse was located when popup menu was requested.protected int
Screen pixel Y coordinate where mouse was located when popup menu was requested.protected com.bbn.openmap.proj.Projection
current Projection of the map window.protected GuiContentType
Widget that asked for the popup menu.Fields inherited from class org.ka2ddo.yaac.pluginapi.AbstractMenuAction
ACCELERATOR_KEY, ACTION_COMMAND_KEY, BUTTON_GROUP_NAME, DISPLAYED_MNEMONIC_INDEX_KEY, enabled, LARGE_ICON_KEY, LOCALIZED_MENU_HIERARCHY, LONG_DESCRIPTION, MENU_PRIORITY, MNEMONIC_KEY, NAME, NOT_VOICE_COMMAND, PRE_LOCALIZE_MENU_TAG_NAME, PRE_LOCALIZED_MENU_HIERARCHY, properties, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON, UI_TYPE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractPopupMenuAction
(String nameTag, String[] menuPositionNames) Construct an AbstractPopupMenuAction with the specified ResourceBundle lookup tag for the name, and hierarchical position in the JMenus.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.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.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.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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.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.Methods inherited from class org.ka2ddo.yaac.pluginapi.AbstractMenuAction
actionPerformed, firePropertyChange, getPropertyListener, getValue, init, isEnabled, parseMnemonics, putValue, setEnabled, setPropertyListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ka2ddo.yaac.pluginapi.AddToPopupMapMenuIfc
testIfIncluded
-
Field Details
-
mouseX
protected transient int mouseXScreen pixel X coordinate where mouse was located when popup menu was requested. -
mouseY
protected transient int mouseYScreen pixel Y coordinate where mouse was located when popup menu was requested. -
proj
protected transient com.bbn.openmap.proj.Projection projcurrent Projection of the map window. -
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
Packet at the clicked-on row in the table, or null if not relevant. -
widgetContentType
Widget that asked for the popup menu.
-
-
Constructor Details
-
AbstractPopupMenuAction
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 ResourceBundlesmenuPositionNames
- 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 ResourceBundlesmenuPositionNames
- array of Strings identifying the localized name strings of the parent JMenus to contain the generated JRadioButtonMenuItembuttonGroupName
- String name of ButtonGroup this JRadioButtonMenuItem
-
AbstractPopupMenuAction
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 ResourceBundlesmenuPositionNames
- array of Strings identifying the localized name strings of the parent JMenus to contain the generated JMenuItempriority
- 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 ResourceBundlesmenuPositionNames
- array of Strings identifying the localized name strings of the parent JMenus to contain the generated JRadioButtonMenuItempriority
- int relative priority of this menu item relative to other menu items on its lowest JMenubuttonGroupName
- 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 ResourceBundlesmenuPositionNames
- array of Strings identifying the localized name strings of the parent JMenus to contain the generated JMenuItempriority
- int relative priority of this menu item relative to otherinitialState
- 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-invokedmy
- int screen pixel Y coordinate where popup menu was invoked, or table model row number for table view, or -1 for other non-map-invokedproj
- 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 rowframe
- 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 rowframe
- AX25Frame of selected packet in a table view (or null if not relevant)widgetContentType
- GuiContentType of the widget launching a popup menu
-