Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Menus Class Reference

Static Public Member Functions

static synchronized String[] getPlugins ()
 
static JMenuBar getMenuBar ()
 
static void updateMenus ()
 
static String getPlugInsPath ()
 
static Hashtable getCommands ()
 
static Hashtable getShortcuts ()
 
static JPopupMenu getPopupMenu ()
 
static int installPlugin (String plugin, char menuCode, String command, String shortcut, ImageJ ij)
 
static int uninstallPlugin (String command)
 
static boolean commandInUse (String command)
 
static int convertShortcutToCode (String shortcut)
 
static boolean shortcutInUse (String shortcut)
 
static void savePreferences (Properties prefs)
 

Static Public Attributes

static final char PLUGINS_MENU = 'p'
 
static final char IMPORT_MENU = 'i'
 
static final char SAVE_AS_MENU = 's'
 
static final char SHORTCUTS_MENU = 'h'
 
static final char ABOUT_MENU = 'a'
 
static final char FILTERS_MENU = 'f'
 
static final char TOOLS_MENU = 't'
 
static final char UTILITIES_MENU = 'u'
 
static final int WINDOW_MENU_ITEMS = 5
 
static final int NORMAL_RETURN = 0
 
static final int COMMAND_IN_USE = -1
 
static final int INVALID_SHORTCUT = -2
 
static final int SHORTCUT_IN_USE = -3
 
static final int NOT_INSTALLED = -4
 
static final int COMMAND_NOT_FOUND = -5
 

Detailed Description

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.

See Also
ImageJ

Definition at line 24 of file Menus.java.

Member Function Documentation

static Hashtable getCommands ( )
inlinestatic

Returns the hashtable that associates commands with plugins.

Definition at line 717 of file Menus.java.

static synchronized String [] getPlugins ( )
inlinestatic

Returns a list of the plugins in the plugins menu.

Definition at line 516 of file Menus.java.

static String getPlugInsPath ( )
inlinestatic

Returns the path to the user plugins directory or null if the plugins directory was not found.

Definition at line 711 of file Menus.java.

static Hashtable getShortcuts ( )
inlinestatic

Returns the hashtable that associates shortcuts with commands. The keys in the hashtable are Integer keycodes, or keycode+200 for uppercase.

Definition at line 723 of file Menus.java.

static int installPlugin ( String  plugin,
char  menuCode,
String  command,
String  shortcut,
ImageJ  ij 
)
inlinestatic

Adds a plugin based command to the end of a specified menu.

Parameters
pluginthe plugin (e.g. "Inverter_", "Inverter_("arg")")
menuCodePLUGINS_MENU, IMPORT_MENU, SAVE_AS_MENU or HOT_KEYS
commandthe menu item label (set to "" to uninstall)
shortcutthe keyboard shortcut (e.g. "y", "Y", "F1")
ijImageJ (the action listener)
Returns
returns an error code(NORMAL_RETURN,COMMAND_IN_USE_ERROR, etc.)

Definition at line 741 of file Menus.java.

static void savePreferences ( Properties  prefs)
inlinestatic

Called once when ImageJ quits.

Definition at line 872 of file Menus.java.

static int uninstallPlugin ( String  command)
inlinestatic

Deletes a command installed by installPlugin.

Definition at line 798 of file Menus.java.

static void updateMenus ( )
inlinestatic

Updates the Image/Type and Window menus.

Definition at line 647 of file Menus.java.


The documentation for this class was generated from the following file: