private static boolean quittingViaMacro() { ImageJ ij = IJ.getInstance(); return ij!=null && ij.quittingViaMacro(); }
private static boolean quittingViaMacro() { ImageJ ij = IJ.getInstance(); return ij!=null && ij.quittingViaMacro(); }
/** Overrides close() in PlugInFrame. */ public void close() { boolean okayToClose = true; ImageJ ij = IJ.getInstance(); if (!getTitle().equals("Errors") && changes && !IJ.isMacro() && ij!=null && !ij.quittingViaMacro()) { String msg = "Save changes to \"" + getTitle() + "\"?"; YesNoCancelDialog d = new YesNoCancelDialog(this, "Editor", msg); if (d.cancelPressed()) okayToClose = false; else if (d.yesPressed()) save(); } if (okayToClose) { //setVisible(false); dispose(); WindowManager.removeWindow(this); nWindows--; instance = null; changes = false; if (functionFinder!=null) functionFinder.close(); } }
/** Overrides close() in PlugInFrame. */ public void close() { boolean okayToClose = true; ImageJ ij = IJ.getInstance(); if (!getTitle().equals("Errors") && changes && !IJ.isMacro() && ij!=null && !ij.quittingViaMacro()) { String msg = "Save changes to \"" + getTitle() + "\"?"; YesNoCancelDialog d = new YesNoCancelDialog(this, "Editor", msg); if (d.cancelPressed()) okayToClose = false; else if (d.yesPressed()) save(); } if (okayToClose) { //setVisible(false); dispose(); WindowManager.removeWindow(this); nWindows--; instance = null; changes = false; if (functionFinder!=null) functionFinder.close(); } }
if (roi!=null && (roi instanceof PointRoi) && ((PointRoi)roi).promptBeforeDeleting()) changes = true; if (ij==null || ij.quittingViaMacro() || IJ.getApplet()!=null || Interpreter.isBatchMode() || IJ.macroRunning() || virtual) changes = false; if (changes) {
if (roi!=null && (roi instanceof PointRoi) && ((PointRoi)roi).promptBeforeDeleting()) changes = true; if (ij==null || ij.quittingViaMacro() || IJ.getApplet()!=null || Interpreter.isBatchMode() || IJ.macroRunning() || virtual) changes = false; if (changes) {