private synchronized boolean promptForSave(final String tableTitle) { final GenericDialog gd = new GenericDialog("Unsaved Data"); gd.addMessage("Save measurements in " + tableTitle + "?", new Font("SansSerif", Font.BOLD, 12)); gd.addMessage("Data will be discarded if you dismiss this prompt!", new Font("SansSerif", Font.PLAIN, 12), EnhancedGenericDialog.getDisabledComponentColor()); gd.setCancelLabel("No. Discard measurements"); gd.setOKLabel("Yes. Save to..."); gd.showDialog(); if (gd.wasOKed() && (new MeasurementsWriter()).save("")) { setUnsavedMeasurements(false); } return false; }
gd.setCancelLabel("Set All Limits"); gd.showDialog();
gd.setCancelLabel("Set All Limits"); gd.showDialog();
/** Overrides PlugInFrame.close(). */ public void close() { super.close(); instance = null; resetMultiMeasureResults(); Prefs.saveLocation(LOC_KEY, getLocation()); if (!showAllCheckbox.getState() || IJ.macroRunning()) return; int n = getCount(); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || (imp.getCanvas()!=null && imp.getCanvas().getShowAllList()==null)) return; if (n>0) { GenericDialog gd = new GenericDialog("ROI Manager"); gd.addMessage("Save the "+n+" displayed ROIs as an overlay?"); gd.setOKLabel("Discard"); gd.setCancelLabel("Save as Overlay"); gd.showDialog(); if (gd.wasCanceled()) moveRoisToOverlay(imp); else removeOverlay(imp); } else imp.draw(); }
/** Overrides PlugInFrame.close(). */ public void close() { super.close(); instance = null; resetMultiMeasureResults(); Prefs.saveLocation(LOC_KEY, getLocation()); if (!showAllCheckbox.getState() || IJ.macroRunning()) return; int n = getCount(); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || (imp.getCanvas()!=null && imp.getCanvas().getShowAllList()==null)) return; if (n>0) { GenericDialog gd = new GenericDialog("ROI Manager"); gd.addMessage("Save the "+n+" displayed ROIs as an overlay?"); gd.setOKLabel("Discard"); gd.setCancelLabel("Save as Overlay"); gd.showDialog(); if (gd.wasCanceled()) moveRoisToOverlay(imp); else removeOverlay(imp); } else imp.draw(); }