/** Aborts the macro that was running when this one started. */ static void abortPrevious() { if (previousInstance!=null) { previousInstance.abortMacro(); IJ.beep(); previousInstance = null; } }
/** Aborts the macro that was running when this one started. */ static void abortPrevious() { if (previousInstance!=null) { previousInstance.abortMacro(); IJ.beep(); previousInstance = null; } }
private void setSlice(ImagePlus imp, int n) { if (imp.isLocked()) { IJ.beep(); IJ.showStatus("Image is locked"); } else imp.setSlice(n); }
final void runToInsertionPoint() { Interpreter interp = Interpreter.getInstance(); if (interp==null) IJ.beep(); else { runToLine = getCurrentLine(); setDebugMode(RUN_TO_CARET); } }
/** Displays the ddaC sample image and returns a reference to it */ protected static ImagePlus displaySample() { final ImagePlus imp = ShollUtils.sampleImage(); if (imp == null) { IJ.showStatus("Error: Could not open ddaC.tif!"); IJ.beep(); } else { imp.show(); } return imp; }
private void setSlice(ImagePlus imp, int n) { if (imp.isLocked()) { IJ.beep(); IJ.showStatus("Image is locked"); } else imp.setSlice(n); }
final void runToInsertionPoint() { Interpreter interp = Interpreter.getInstance(); if (interp==null) IJ.beep(); else { runToLine = getCurrentLine(); setDebugMode(RUN_TO_CARET); } }
/** Locks the image so other threads can test to see if it is in use. Returns true if the image was successfully locked. Beeps, displays a message in the status bar, and returns false if the image is already locked. */ public synchronized boolean lock() { if (locked) { IJ.beep(); IJ.showStatus("\"" + title + "\" is locked"); if (IJ.macroRunning()) IJ.wait(500); return false; } else { locked = true; return true; } }
void abortPluginOrMacro(ImagePlus imp) { if (imp!=null) { ImageWindow win = imp.getWindow(); if (win!=null) { win.running = false; win.running2 = false; } } Macro.abort(); Interpreter.abort(); if (Interpreter.getInstance()!=null) IJ.beep(); }
private boolean checkImage(){ imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()!=24) { IJ.beep(); IJ.showStatus("No RGB image"); return false; } ip = setup(imp); if (ip==null) return false; return true; }
void abortPluginOrMacro(ImagePlus imp) { if (imp!=null) { ImageWindow win = imp.getWindow(); if (win!=null) { win.running = false; win.running2 = false; } } Macro.abort(); Interpreter.abort(); if (Interpreter.getInstance()!=null) IJ.beep(); }
public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if (key==KeyEvent.VK_ESCAPE) { IJ.beep(); dispose(); } else if (IJ.shiftKeyDown()) { int width=imp.getWidth(), height=imp.getHeight(); switch (key) { case KeyEvent.VK_LEFT: crossLoc.x--; if (crossLoc.x<0) crossLoc.x=0; break; case KeyEvent.VK_RIGHT: crossLoc.x++; if (crossLoc.x>=width) crossLoc.x=width-1; break; case KeyEvent.VK_UP: crossLoc.y--; if (crossLoc.y<0) crossLoc.y=0; break; case KeyEvent.VK_DOWN: crossLoc.y++; if (crossLoc.y>=height) crossLoc.y=height-1; break; default: return; } update(); } }
private boolean checkImage() { if (IJ.debugMode) IJ.log("ColorThresholder.checkImage"); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()!=24) { IJ.beep(); IJ.showStatus("No RGB image"); return false; } imp.deleteRoi(); boolean ok = setup(imp); return ok; }
public void windowActivated(WindowEvent e) { if (IJ.debugMode) IJ.log("ColorThresholder.windowActivated "); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()!=24) { IJ.beep(); IJ.showStatus("No RGB image"); } else { setup(imp); //reset(imp); filteredB.setEnabled(true); } }
private boolean checkImage() { if (IJ.debugMode) IJ.log("ColorThresholder.checkImage"); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()!=24) { IJ.beep(); IJ.showStatus("No RGB image"); return false; } imp.deleteRoi(); boolean ok = setup(imp); return ok; }
public void windowActivated(WindowEvent e) { if (IJ.debugMode) IJ.log("ColorThresholder.windowActivated "); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()!=24) { IJ.beep(); IJ.showStatus("No RGB image"); } else { setup(imp); //reset(imp); filteredB.setEnabled(true); } }
private void unlock() { ImagePlus imp = IJ.getImage(); boolean wasUnlocked = imp.lockSilently(); if (wasUnlocked) IJ.showStatus("\""+imp.getTitle()+"\" is not locked"); else { IJ.showStatus("\""+imp.getTitle()+"\" is now unlocked"); IJ.beep(); } imp.unlock(); }
private void unlock() { ImagePlus imp = IJ.getImage(); boolean wasUnlocked = imp.lockSilently(); if (wasUnlocked) IJ.showStatus("\""+imp.getTitle()+"\" is not locked"); else { IJ.showStatus("\""+imp.getTitle()+"\" is now unlocked"); IJ.beep(); } imp.unlock(); }
public static void setKeyUp(int key) { if (debugMode) IJ.log("setKeyUp: "+key); switch (key) { case KeyEvent.VK_CONTROL: controlDown=false; break; case KeyEvent.VK_META: if (isMacintosh()) controlDown=false; break; case KeyEvent.VK_ALT: altDown=false; updateStatus(); break; case KeyEvent.VK_SHIFT: shiftDown=false; if (debugMode) beep(); break; case KeyEvent.VK_SPACE: spaceDown=false; ImageWindow win = WindowManager.getCurrentWindow(); if (win!=null) win.getCanvas().setCursor(-1,-1,-1,-1); break; case ALL_KEYS: shiftDown=controlDown=altDown=spaceDown=false; break; } }
private ImagePlus captureDelayed() { GenericDialog gd = new GenericDialog("Delayed Capture"); gd.addNumericField("Delay (seconds):", delay, 0); gd.showDialog(); if (gd.wasCanceled()) return null; int delay = (int)gd.getNextNumber(); if (delay<0) return null; if (delay>60) delay=60; for (int i=0; i<delay; i++) { IJ.wait(1000); IJ.showStatus("Delayed capture: "+(i+1)+"/"+delay); if (delay>4 && i==delay-2) IJ.beep(); } return captureScreen(); }