void updateShowAll() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; if (showAllCheckbox.getState()) { if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } else removeOverlay(imp); } else removeOverlay(imp); }
void updateShowAll() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; if (showAllCheckbox.getState()) { if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } else removeOverlay(imp); } else removeOverlay(imp); }
void showAll(int mode) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; boolean showAll = mode==SHOW_ALL; if (showAll) imageID = imp.getID(); if (mode==LABELS || mode==NO_LABELS) showAll = true; if (showAll) imp.deleteRoi(); if (mode==SHOW_NONE) { removeOverlay(imp); imageID = 0; } else if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } }
void showAll(int mode) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; boolean showAll = mode==SHOW_ALL; if (showAll) imageID = imp.getID(); if (mode==LABELS || mode==NO_LABELS) showAll = true; if (showAll) imp.deleteRoi(); if (mode==SHOW_NONE) { removeOverlay(imp); imageID = 0; } else if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } }
/** 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(); }