(String cmd)
| 25 | public class Commands implements PlugIn { |
| 26 | |
| 27 | public void run(String cmd) { |
| 28 | if (cmd.equals("new")) { |
| 29 | if (IJ.altKeyDown()) |
| 30 | IJ.runPlugIn("ij.plugin.HyperStackMaker", ""); |
| 31 | else |
| 32 | new NewImage(); |
| 33 | } else if (cmd.equals("open")) { |
| 34 | if (Prefs.useJFileChooser && !IJ.macroRunning()) |
| 35 | new Opener().openMultiple(); |
| 36 | else |
| 37 | new Opener().open(); |
| 38 | } else if (cmd.equals("close")) |
| 39 | close(); |
| 40 | else if (cmd.equals("close-all")) |
| 41 | closeAll(); |
| 42 | else if (cmd.equals("save")) |
| 43 | save(); |
| 44 | else if (cmd.equals("revert")) |
| 45 | revert(); |
| 46 | else if (cmd.equals("undo")) |
| 47 | undo(); |
| 48 | else if (cmd.equals("ij")) { |
| 49 | ImageJ ij = IJ.getInstance(); |
| 50 | if (ij!=null) ij.toFront(); |
| 51 | } else if (cmd.equals("tab")) |
| 52 | WindowManager.putBehind(); |
| 53 | else if (cmd.equals("quit")) { |
| 54 | ImageJ ij = IJ.getInstance(); |
| 55 | if (ij!=null) ij.quit(); |
| 56 | } else if (cmd.equals("startup")) |
| 57 | openStartupMacros(); |
| 58 | } |
| 59 | |
| 60 | void revert() { |
| 61 | ImagePlus imp = WindowManager.getCurrentImage(); |
nothing calls this directly
no test coverage detected