public class MenuMapper extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHECKBOX_MENUITEM_TYPE |
static java.lang.String |
MENU_PATH_DELIMITER |
static java.lang.String |
MENU_SEPARATOR_KEY |
static java.lang.String |
MENUITEM_TYPE |
static java.lang.String |
MNEMONIC_SYMBOL |
static java.lang.String |
NEW_JMENUITEM_KEY |
Constructor and Description |
---|
MenuMapper(TableauFrame tableauFrameInstance)
constructor
|
Modifier and Type | Method and Description |
---|---|
static javax.swing.JMenuItem |
addMenuFor(java.lang.String key,
javax.swing.Action action,
javax.swing.JComponent topLvlContainer,
java.util.Map<java.lang.String,javax.swing.JMenuItem> keplerMenuMap) |
void |
clear() |
static javax.swing.Action |
getActionFor(java.lang.String key,
java.util.Map<java.lang.String,javax.swing.Action> menuActionsMap,
TableauFrame tableauFrameInstance) |
java.util.Map<java.lang.String,javax.swing.Action> |
getPTIIMenuActionsMap() |
void |
init() |
void |
printDebugInfo()
Debugging method
|
static void |
reloadAllMenubars()
Remap all open menubars.
|
void |
reloadPtolemyMenus()
Remap the menu.
|
static void |
storePTIIMenuItems(javax.swing.JMenuItem nextMenuItem,
java.lang.StringBuffer menuPathBuff,
java.lang.String MENU_PATH_DELIMITER,
java.util.Map<java.lang.String,javax.swing.Action> actionsMap)
Recurse through all the submenu heirarchy beneath the passed JMenu
parameter, and for each "leaf node" (ie a menu item that is not a
container for other menu items), add the Action and its menu path to the
passed Map
|
public static final java.lang.String MENUITEM_TYPE
public static final java.lang.String CHECKBOX_MENUITEM_TYPE
public static final java.lang.String NEW_JMENUITEM_KEY
public static final java.lang.String MENU_PATH_DELIMITER
public static final java.lang.String MENU_SEPARATOR_KEY
public static final java.lang.String MNEMONIC_SYMBOL
public MenuMapper(TableauFrame tableauFrameInstance)
ptiiMenubar
- JMenuBar the existing ptii menubar containing the original
menustableauFrameInstance
- TableauFrame the frame from which the ptii menu bar will be
hidden, and to which the new menu bar will be addedpublic void printDebugInfo()
public void init()
public static javax.swing.Action getActionFor(java.lang.String key, java.util.Map<java.lang.String,javax.swing.Action> menuActionsMap, TableauFrame tableauFrameInstance)
public static void storePTIIMenuItems(javax.swing.JMenuItem nextMenuItem, java.lang.StringBuffer menuPathBuff, java.lang.String MENU_PATH_DELIMITER, java.util.Map<java.lang.String,javax.swing.Action> actionsMap)
nextMenuItem
- the JMenu to recurse intomenuPathBuff
- a delimited String representation of the hierarchical "path"
to this menu item. This will be used as the key in the
actionsMap. For example, the "Graph Editor" menu item beneath
the "New" item on the "File" menu would have a menuPath of
File->New->Graph Editor. Delimeter is "->" (no quotes), and
spaces are allowed within menu text strings, but not around
the delimiters; i.e: New->Graph Editor is OK, but File ->New
is not.MENU_PATH_DELIMITER
- StringactionsMap
- the Map containing key => value pairs of the form: menuPath
(as described above) => Action (the javax.swing.Action
assigned to this menu item)public java.util.Map<java.lang.String,javax.swing.Action> getPTIIMenuActionsMap()
public static javax.swing.JMenuItem addMenuFor(java.lang.String key, javax.swing.Action action, javax.swing.JComponent topLvlContainer, java.util.Map<java.lang.String,javax.swing.JMenuItem> keplerMenuMap)
public void clear()
public static void reloadAllMenubars()
public void reloadPtolemyMenus()