示例#1
0
 void zoomToSelection(int x, int y) {
   IJ.setKeyUp(IJ.ALL_KEYS);
   String macro =
       "args = split(getArgument);\n"
           + "x1=parseInt(args[0]); y1=parseInt(args[1]); flags=20;\n"
           + "while (flags&20!=0) {\n"
           + "getCursorLoc(x2, y2, z, flags);\n"
           + "if (x2>=x1) x=x1; else x=x2;\n"
           + "if (y2>=y1) y=y1; else y=y2;\n"
           + "makeRectangle(x, y, abs(x2-x1), abs(y2-y1));\n"
           + "wait(10);\n"
           + "}\n"
           + "run('To Selection');\n";
   new MacroRunner(macro, x + " " + y);
 }
示例#2
0
 public void keyReleased(KeyEvent e) {
   IJ.setKeyUp(e.getKeyCode());
 }