Class Menus

  • public class Menusextends Object
    This class installs and updates ImageJ's menus. Note that menu labels,even in submenus, must be unique. This is because ImageJ uses a singlehash table for all menu labels. If you look closely, you will see thatFile->Import->Text Image... and File->Save As->Text Image... do not usethe same label. One of the labels has an extra space.
    See Also:
    • Method Detail

      • getJarFileForMenuEntry

        public static String getJarFileForMenuEntry(String menuEntry)
      • getPlugins

        public static String[] getPlugins()
        Returns a list of the plugins in the plugins menu.
      • installUserPlugin

        public void installUserPlugin(String className,                     boolean force)
      • getMenuBar

        public static MenuBar getMenuBar()
      • getMacrosMenu

        public static Menu getMacrosMenu()
      • getMacroCount

        public int getMacroCount()
      • getPluginCount

        public int getPluginCount()
      • updateMenus

        public static void updateMenus()
        Updates the Image/Type and Window menus.
      • getPlugInsPath

        public static String getPlugInsPath()
        Returns the path to the user plugins directory or null if the plugins directory was not found.
      • getMacrosPath

        public static String getMacrosPath()
        Returns the path to the macros directory or null if the macros directory was not found.
      • getCommands

        public static Hashtable getCommands()
        Returns the hashtable that associates commands with plugins.
      • getShortcuts

        public static Hashtable getShortcuts()
        Returns the hashtable that associates shortcuts with commands. The keys in the hashtable are Integer keycodes, or keycode+200 for uppercase.
      • getMacroShortcuts

        public static Hashtable getMacroShortcuts()
        Returns the hashtable that associates keyboard shortcuts with macros. The keys in the hashtable are Integer keycodes, or keycode+200 for uppercase.
      • updateWindowMenuItem

        public static void updateWindowMenuItem(String oldLabel,                        String newLabel)
        Changes the name of an item in the Window menu.
      • addOpenRecentItem

        public static void addOpenRecentItem(String path)
        Adds a file path to the beginning of the File/Open Recent submenu.
      • getPopupMenu

        public static PopupMenu getPopupMenu()
      • getSaveAsMenu

        public static Menu getSaveAsMenu()
      • installPlugin

        public 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.
        plugin - the plugin (e.g. "Inverter_", "Inverter_("arg")")
        command - the menu item label (set to "" to uninstall)
        shortcut - the keyboard shortcut (e.g. "y", "Y", "F1")
        ij - ImageJ (the action listener)
        returns an error code(NORMAL_RETURN,COMMAND_IN_USE_ERROR, etc.)
      • uninstallPlugin

        public static int uninstallPlugin(String command)
        Deletes a command installed by installPlugin.
      • commandInUse

        public static boolean commandInUse(String command)
      • convertShortcutToCode

        public static int convertShortcutToCode(String shortcut)
      • shortcutInUse

        public static boolean shortcutInUse(String shortcut)
      • setFontSize

        public static void setFontSize(int size)
        Set the size (in points) used for the fonts in ImageJ menus. Set the size to 0 to use the Java default size.
      • getFontSize

        public static int getFontSize()
        Returns the size (in points) used for the fonts in ImageJ menus. Returns 0 if the default font size is being used or if this is a Macintosh.
      • getFont

        public static Font getFont()
      • savePreferences

        public static void savePreferences(Properties prefs)
        Called once when ImageJ quits.
      • updateImageJMenus

        public static void updateImageJMenus()

SCaVis 1.7 ©