|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectij.Menus
public class Menus
This class installs and updates ImageJ's menus. Note that menu labels, even in submenus, must be unique. This is because ImageJ uses a single hash table for all menu labels. If you look closely, you will see that File->Import->Text Image... and File->Save As->Text Image... do not use the same label. One of the labels has an extra space.
ImageJ| Field Summary | |
|---|---|
static char |
ABOUT_MENU
|
static int |
COMMAND_IN_USE
|
static int |
COMMAND_NOT_FOUND
|
static char |
FILTERS_MENU
|
static char |
IMPORT_MENU
|
static int |
INVALID_SHORTCUT
|
static int |
MAX_OPEN_RECENT_ITEMS
|
static int |
NORMAL_RETURN
|
static int |
NOT_INSTALLED
|
static char |
PLUGINS_MENU
|
static char |
SAVE_AS_MENU
|
static int |
SHORTCUT_IN_USE
|
static char |
SHORTCUTS_MENU
|
static char |
TOOLS_MENU
|
static char |
UTILITIES_MENU
|
static int |
WINDOW_MENU_ITEMS
|
| Method Summary | |
|---|---|
static void |
addOpenRecentItem(String path)
Adds a file path to the beginning of the File/Open Recent submenu. |
static boolean |
commandInUse(String command)
|
static int |
convertShortcutToCode(String shortcut)
|
static Hashtable |
getCommands()
Returns the hashtable that associates commands with plugins. |
static Font |
getFont()
|
static int |
getFontSize()
Returns the size (in points) used for the fonts in ImageJ menus. |
static Menu |
getImageJMenu(String menuPath)
Returns the specified ImageJ menu (e.g., "File>New") or null if it is not found. |
static String |
getJarFileForMenuEntry(String menuEntry)
|
int |
getMacroCount()
|
static Hashtable |
getMacroShortcuts()
Returns the hashtable that associates keyboard shortcuts with macros. |
static Menu |
getMacrosMenu()
|
static String |
getMacrosPath()
Returns the path to the macros directory or null if the macros directory was not found. |
static MenuBar |
getMenuBar()
|
static Menu |
getOpenRecentMenu()
|
int |
getPluginCount()
|
static String[] |
getPlugins()
Returns a list of the plugins in the plugins menu. |
static String |
getPlugInsPath()
Returns the path to the user plugins directory or null if the plugins directory was not found. |
static PopupMenu |
getPopupMenu()
|
static Menu |
getSaveAsMenu()
|
static Hashtable |
getShortcuts()
Returns the hashtable that associates shortcuts with commands. |
static int |
installPlugin(String plugin,
char menuCode,
String command,
String shortcut,
ImageJ ij)
Adds a plugin based command to the end of a specified menu. |
void |
installUserPlugin(String className,
boolean force)
|
static void |
savePreferences(Properties prefs)
Called once when ImageJ quits. |
static void |
setFontSize(int size)
Set the size (in points) used for the fonts in ImageJ menus. |
static boolean |
shortcutInUse(String shortcut)
|
static int |
uninstallPlugin(String command)
Deletes a command installed by installPlugin. |
static void |
updateImageJMenus()
|
static void |
updateMenus()
Updates the Image/Type and Window menus. |
static void |
updateWindowMenuItem(String oldLabel,
String newLabel)
Changes the name of an item in the Window menu. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char PLUGINS_MENU
public static final char IMPORT_MENU
public static final char SAVE_AS_MENU
public static final char SHORTCUTS_MENU
public static final char ABOUT_MENU
public static final char FILTERS_MENU
public static final char TOOLS_MENU
public static final char UTILITIES_MENU
public static final int WINDOW_MENU_ITEMS
public static final int NORMAL_RETURN
public static final int COMMAND_IN_USE
public static final int INVALID_SHORTCUT
public static final int SHORTCUT_IN_USE
public static final int NOT_INSTALLED
public static final int COMMAND_NOT_FOUND
public static final int MAX_OPEN_RECENT_ITEMS
| Method Detail |
|---|
public static String getJarFileForMenuEntry(String menuEntry)
public static Menu getImageJMenu(String menuPath)
public static String[] getPlugins()
public void installUserPlugin(String className,
boolean force)
public static MenuBar getMenuBar()
public static Menu getMacrosMenu()
public static Menu getOpenRecentMenu()
public int getMacroCount()
public int getPluginCount()
public static void updateMenus()
public static String getPlugInsPath()
public static String getMacrosPath()
public static Hashtable getCommands()
public static Hashtable getShortcuts()
public static Hashtable getMacroShortcuts()
public static void updateWindowMenuItem(String oldLabel,
String newLabel)
public static void addOpenRecentItem(String path)
public static PopupMenu getPopupMenu()
public static Menu getSaveAsMenu()
public static int installPlugin(String plugin,
char menuCode,
String command,
String shortcut,
ImageJ ij)
plugin - the plugin (e.g. "Inverter_", "Inverter_("arg")")menuCode - PLUGINS_MENU, IMPORT_MENU, SAVE_AS_MENU or HOT_KEYScommand - the menu item label (set to "" to uninstall)shortcut - the keyboard shortcut (e.g. "y", "Y", "F1")ij - ImageJ (the action listener)
public static int uninstallPlugin(String command)
public static boolean commandInUse(String command)
public static int convertShortcutToCode(String shortcut)
public static boolean shortcutInUse(String shortcut)
public static void setFontSize(int size)
public static int getFontSize()
public static Font getFont()
public static void savePreferences(Properties prefs)
public static void updateImageJMenus()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||