public int setup(String arg, ImagePlus imp) { if (arg.equals("about")) { showAbout(); return DONE; } this.m_imp = imp; IJ.resetEscape(); return DOES_8G + DOES_16+ DOES_RGB + NO_UNDO + NO_CHANGES; } // end of 'setup' method
public int setup(String arg, ImagePlus imp) { if (arg.equals("about")) { showAbout(); return DONE; } this.m_imp = imp; IJ.resetEscape(); return DOES_8G + DOES_16+ DOES_RGB + NO_UNDO + NO_CHANGES; } // end of 'setup' method
public int setup(String arg, ImagePlus imp) { if (arg.equals("about")) { showAbout(); return DONE; } this.imp = imp; IJ.resetEscape(); return DOES_16+DOES_8G+DOES_RGB+NO_UNDO; } // end of 'setup' method
public int setup(String arg, ImagePlus imp) { if (arg.equals("about")) { showAbout(); return DONE; } this.imp = imp; IJ.resetEscape(); return DOES_16+DOES_8G+DOES_RGB+NO_UNDO; } // end of 'setup' method
/** Create an Executer that runs the specified menu command in a separate thread using the specified image, or using the active image if 'imp' is null. */ public Executer(String cmd, ImagePlus imp) { if (cmd.startsWith("Repeat")) { command = previousCommand; IJ.setKeyUp(KeyEvent.VK_SHIFT); } else { command = cmd; if (!(cmd.equals("Undo")||cmd.equals("Close"))) previousCommand = cmd; } IJ.resetEscape(); thread = new Thread(this, cmd); thread.setPriority(Math.max(thread.getPriority()-2, Thread.MIN_PRIORITY)); if (imp!=null) WindowManager.setTempCurrentImage(thread, imp); thread.start(); }
/** Create an Executer that runs the specified menu command in a separate thread using the specified image, or using the active image if 'imp' is null. */ public Executer(String cmd, ImagePlus imp) { if (cmd.startsWith("Repeat")) { command = previousCommand; IJ.setKeyUp(KeyEvent.VK_SHIFT); } else { command = cmd; if (!(cmd.equals("Undo")||cmd.equals("Close"))) previousCommand = cmd; } IJ.resetEscape(); thread = new Thread(this, cmd); thread.setPriority(Math.max(thread.getPriority()-2, Thread.MIN_PRIORITY)); if (imp!=null) WindowManager.setTempCurrentImage(thread, imp); thread.start(); }
public void run() { IJ.resetEscape(); IJ.runPlugIn("ij.plugin.ClassChecker", ""); runCompiledPlugin(plugin); }
public void run() { IJ.resetEscape(); IJ.runPlugIn("ij.plugin.ClassChecker", ""); runCompiledPlugin(plugin); }
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); IJ.setKeyDown(keyCode); if (keyCode==KeyEvent.VK_ENTER) closeDialog(); else if (keyCode==KeyEvent.VK_ESCAPE) { cancelPressed = true; closeDialog(); IJ.resetEscape(); } }
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_ESCAPE) { wasCanceled = true; closeDialog(); IJ.resetEscape(); } else if (keyCode == KeyEvent.VK_ENTER) { if (e.getSource() == cancel) wasCanceled = true; closeDialog(); } }
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); IJ.setKeyDown(keyCode); if (keyCode==KeyEvent.VK_ENTER) closeDialog(); else if (keyCode==KeyEvent.VK_ESCAPE) { cancelPressed = true; closeDialog(); IJ.resetEscape(); } }
/** Interprets the specified string. */ public void run(String macro) { if (additionalFunctions!=null) { if (!(macro.endsWith("\n")|| additionalFunctions.startsWith("\n"))) macro = macro + "\n" + additionalFunctions; else macro = macro + additionalFunctions; } IJ.resetEscape(); Tokenizer tok = new Tokenizer(); Program pgm = tok.tokenize(macro); if (pgm.hasVars && pgm.hasFunctions) saveGlobals2(pgm); run(pgm); }
/** Interprets the specified string. */ public void run(String macro) { if (additionalFunctions!=null) { if (!(macro.endsWith("\n")|| additionalFunctions.startsWith("\n"))) macro = macro + "\n" + additionalFunctions; else macro = macro + additionalFunctions; } IJ.resetEscape(); Tokenizer tok = new Tokenizer(); Program pgm = tok.tokenize(macro); if (pgm.hasVars && pgm.hasFunctions) saveGlobals2(pgm); run(pgm); }
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); IJ.setKeyDown(keyCode); if (keyCode==KeyEvent.VK_ENTER && textArea1==null && okay!=null && okay.isEnabled()) { wasOKed = true; if (IJ.isMacOSX()) accessTextFields(); dispose(); } else if (keyCode==KeyEvent.VK_ESCAPE) { wasCanceled = true; dispose(); IJ.resetEscape(); } else if (keyCode==KeyEvent.VK_W && (e.getModifiers()&Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())!=0) { wasCanceled = true; dispose(); } }
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); IJ.setKeyDown(keyCode); if (keyCode==KeyEvent.VK_ENTER && textArea1==null && okay!=null && okay.isEnabled()) { wasOKed = true; if (IJ.isMacOSX()) accessTextFields(); dispose(); } else if (keyCode==KeyEvent.VK_ESCAPE) { wasCanceled = true; dispose(); IJ.resetEscape(); } else if (keyCode==KeyEvent.VK_W && (e.getModifiers()&Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())!=0) { wasCanceled = true; dispose(); } }
public int setup(String arg, ImagePlus imp) { this.imp = imp; mainThread = Thread.currentThread(); if (imp==null) {IJ.noImage(); return DONE;} if (arg.equals("final")&&imp.getRoi()==null) { imp.getProcessor().resetMinAndMax(); imp.updateAndDraw(); return DONE; } IJ.resetEscape(); Roi roi = imp.getRoi(); isLineRoi= roi!=null && roi.isLine(); nSlices = imp.getStackSize(); if (imp.getStackSize()==1) flags |= PARALLELIZE_IMAGES; else flags |= PARALLELIZE_STACKS; imp.startTiming(); return flags; }
public int setup(String arg, ImagePlus imp) { this.imp = imp; mainThread = Thread.currentThread(); if (imp==null) {IJ.noImage(); return DONE;} if (arg.equals("final")&&imp.getRoi()==null) { imp.getProcessor().resetMinAndMax(); imp.updateAndDraw(); return DONE; } IJ.resetEscape(); Roi roi = imp.getRoi(); isLineRoi= roi!=null && roi.isLine(); nSlices = imp.getStackSize(); if (imp.getStackSize()==1) flags |= PARALLELIZE_IMAGES; else flags |= PARALLELIZE_STACKS; imp.startTiming(); return flags; }
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); IJ.setKeyDown(keyCode); if (keyCode==KeyEvent.VK_ENTER) { if (cancelB.isFocusOwner()) { cancelPressed = true; closeDialog(); } else if (noB.isFocusOwner()) { closeDialog(); } else { yesPressed = true; closeDialog(); } } else if (keyCode==KeyEvent.VK_Y||keyCode==KeyEvent.VK_S) { yesPressed = true; closeDialog(); } else if (keyCode==KeyEvent.VK_N || keyCode==KeyEvent.VK_D) { closeDialog(); } else if (keyCode==KeyEvent.VK_ESCAPE||keyCode==KeyEvent.VK_C) { cancelPressed = true; closeDialog(); IJ.resetEscape(); } }
public void run(ImageProcessor ip) { if (arg.equals("demo")) { IJ.resetEscape(); while (!IJ.escapePressed()) { north(ip); imp.updateAndDraw(); ip.reset(); northeast(ip); imp.updateAndDraw(); ip.reset(); east(ip); imp.updateAndDraw(); ip.reset(); southeast(ip); imp.updateAndDraw(); ip.reset(); south(ip); imp.updateAndDraw(); ip.reset(); southwest(ip); imp.updateAndDraw(); ip.reset(); west(ip); imp.updateAndDraw(); ip.reset(); northwest(ip); imp.updateAndDraw(); ip.reset(); } } else if (arg.equals("north")) north(ip); else if (arg.equals("northeast")) northeast(ip); else if (arg.equals("east")) east(ip); else if (arg.equals("southeast")) southeast(ip); else if (arg.equals("south")) south(ip); else if (arg.equals("southwest")) southwest(ip); else if (arg.equals("west")) west(ip); else if (arg.equals("northwest")) northwest(ip); }
protected void handleException(Throwable ex) { if(ex instanceof StoppedByUserException) { IJ.resetEscape(); IJ.showStatus("Stopped by user."); IJ.showProgress(1); } else if(ex instanceof ValidatorException) { ValidatorException vex = (ValidatorException) ex; Object source = vex.getSource(); JComponent balloontipAnchor = (source != null && (source instanceof JComponent)) ? (JComponent) source : uiPanel; if(balloontipAnchor != null) { GUI.showBalloonTip(balloontipAnchor, vex.getMessage()); } else { IJ.handleException(ex); } } else { IJ.handleException(ex); } }