@SuppressWarnings("unchecked") public Hashtable<String, String> getCommands() { return Menus.getCommands(); }
void setCommands() { interp.getParens(); Hashtable commands = Menus.getCommands(); props = new Properties(); for (Enumeration en=commands.keys(); en.hasMoreElements();) { String command = (String)en.nextElement(); props.setProperty(command, (String)commands.get(command)); } }
public void listCommands() { Hashtable commands = Menus.getCommands(); Vector v = new Vector(); int index = 1; for (Enumeration en=commands.keys(); en.hasMoreElements();) { String command = (String)en.nextElement(); v.addElement(index+"\t"+command+"\t"+(String)commands.get(command)); index++; } String[] list = new String[v.size()]; v.copyInto((String[])list); showList("Commands", " \tCommand\tPlugin", list); }
protected void populateMap() { lastWord2Label = new HashMap<String, List<String>>(); for (Object label : Menus.getCommands().keySet()) { String lastWord = getLastWord((String)label); List list = lastWord2Label.get(lastWord); if (list == null) { list = new ArrayList<String>(); lastWord2Label.put(lastWord, list); } list.add(label); } }
String[] getShortcuts() { Vector v = new Vector(); Hashtable commandTable = Menus.getCommands(); for (Enumeration en=commandTable.keys(); en.hasMoreElements();) { String cmd = (String)en.nextElement(); if (cmd.startsWith("*")) v.addElement(cmd); } if (v.size()==0) return null; String[] list = new String[v.size()]; v.copyInto((String[])list); Arrays.sort(list, String.CASE_INSENSITIVE_ORDER); return list; }
/** * Runs the command associated with a menu label if there is one. * * @param menuLabel the label of the menu item to run * @param arg the arg to pass to the plugin's run() (or setup()) method */ public static void runGently(String menuLabel, final String arg) { String className = (String)Menus.getCommands().get(menuLabel); if (className != null) IJ.runPlugIn(className, null); }
String[] getShortcuts() { Vector v = new Vector(); Hashtable commandTable = Menus.getCommands(); for (Enumeration en=commandTable.keys(); en.hasMoreElements();) { String cmd = (String)en.nextElement(); if (cmd.startsWith("*")) v.addElement(cmd); } if (v.size()==0) return null; String[] list = new String[v.size()]; v.copyInto((String[])list); Arrays.sort(list, String.CASE_INSENSITIVE_ORDER); return list; }
void setCommands() { interp.getParens(); Hashtable commands = Menus.getCommands(); props = new Properties(); for (Enumeration en=commands.keys(); en.hasMoreElements();) { String command = (String)en.nextElement(); props.setProperty(command, (String)commands.get(command)); } }
public void listCommands() { Hashtable commands = Menus.getCommands(); Vector v = new Vector(); int index = 1; for (Enumeration en=commands.keys(); en.hasMoreElements();) { String command = (String)en.nextElement(); v.addElement(index+"\t"+command+"\t"+(String)commands.get(command)); index++; } String[] list = new String[v.size()]; v.copyInto((String[])list); showList("Commands", " \tCommand\tPlugin", list); }
String[] getAllCommands() { Vector v = new Vector(); Hashtable commandTable = Menus.getCommands(); Hashtable shortcuts = Menus.getShortcuts(); for (Enumeration en=commandTable.keys(); en.hasMoreElements();) { String cmd = (String)en.nextElement(); if (!cmd.startsWith("*") && !cmd.startsWith(" ") && cmd.length()<35 && !shortcuts.contains(cmd)) v.addElement(cmd); } String[] list = new String[v.size()]; v.copyInto((String[])list); Arrays.sort(list, String.CASE_INSENSITIVE_ORDER); return list; }
String[] getAllCommands() { Vector v = new Vector(); Hashtable commandTable = Menus.getCommands(); Hashtable shortcuts = Menus.getShortcuts(); for (Enumeration en=commandTable.keys(); en.hasMoreElements();) { String cmd = (String)en.nextElement(); if (!cmd.startsWith("*") && !cmd.startsWith(" ") && cmd.length()<35 && !shortcuts.contains(cmd)) v.addElement(cmd); } String[] list = new String[v.size()]; v.copyInto((String[])list); Arrays.sort(list, String.CASE_INSENSITIVE_ORDER); return list; }
/** Opens and displays the nth image in the specified tiff stack. */ public static void open(String path, int n) { if (ij==null && Menus.getCommands()==null) init(); ImagePlus imp = openImage(path, n); if (imp!=null) imp.show(); }
/** Opens and displays the nth image in the specified tiff stack. */ public static void open(String path, int n) { if (ij==null && Menus.getCommands()==null) init(); ImagePlus imp = openImage(path, n); if (imp!=null) imp.show(); }
/** Opens and displays a tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file. Displays an error message if the specified file is not in one of the supported formats, or if it is not found. With 1.41k or later, opens images specified by a URL. */ public static void open(String path) { if (ij==null && Menus.getCommands()==null) init(); Opener o = new Opener(); macroRunning = true; if (path==null || path.equals("")) o.open(); else o.open(path); macroRunning = false; }
private void listCommands() { String[] commands = getAllCommands(); Hashtable classes = Menus.getCommands(); ResultsTable rt = new ResultsTable(); for (int i=0; i<commands.length; i++) { rt.incrementCounter(); rt.addValue("Command", commands[i]); rt.addValue("Plugin", (String)classes.get(commands[i])); } rt.show("Commands"); }
synchronized void load() { commands = Menus.getCommands(); pluginsArray = Menus.getPlugins(); root=doRootFromMenus(); if (root==null || root.getChildCount()==0 ) return; // do nothing if there's no tree or a root w/o children loadProperties(); restoreVisiblePanels(); if (panels.isEmpty()) newPanel(root); }
synchronized void load() { commands = Menus.getCommands(); pluginsArray = Menus.getPlugins(); root=doRootFromMenus(); if (root==null || root.getChildCount()==0 ) return; // do nothing if there's no tree or a root w/o children loadProperties(); restoreVisiblePanels(); if (panels.isEmpty()) newPanel(root); }
private void listCommands() { String[] commands = getAllCommands(); Hashtable classes = Menus.getCommands(); ResultsTable rt = new ResultsTable(); for (int i=0; i<commands.length; i++) { rt.incrementCounter(); rt.addValue("Command", commands[i]); rt.addValue("Plugin", (String)classes.get(commands[i])); } rt.show("Commands"); }
/** Runs an ImageJ command using the specified image and options. To generate run() calls, start the recorder (Plugins/Macro/Record) and run commands from the ImageJ menu bar.*/ public static void run(ImagePlus imp, String command, String options) { if (ij==null && Menus.getCommands()==null) init(); if (imp!=null) { ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(imp); run(command, options); WindowManager.setTempCurrentImage(temp); } else run(command, options); }
/** Runs an ImageJ command using the specified image and options. To generate run() calls, start the recorder (Plugins/Macro/Record) and run commands from the ImageJ menu bar.*/ public static void run(ImagePlus imp, String command, String options) { if (ij==null && Menus.getCommands()==null) init(); if (imp!=null) { ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(imp); run(command, options); WindowManager.setTempCurrentImage(temp); } else run(command, options); }