MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / close

Method close

ij/src/main/java/ij/plugin/frame/RoiManager.java:2725–2748  ·  view source on GitHub ↗

Overrides PlugInFrame.close().

()

Source from the content-addressed store, hash-verified

2723
2724 /** Overrides PlugInFrame.close(). */
2725 public void close() {
2726 super.close();
2727 instance = null;
2728 resetMultiMeasureResults();
2729 Prefs.saveLocation(LOC_KEY, getLocation());
2730 if (!showAllCheckbox.getState() || IJ.macroRunning())
2731 return;
2732 int n = getCount();
2733 ImagePlus imp = WindowManager.getCurrentImage();
2734 if (imp==null || (imp.getCanvas()!=null && imp.getCanvas().getShowAllList()==null))
2735 return;
2736 if (n>0) {
2737 GenericDialog gd = new GenericDialog("ROI Manager");
2738 gd.addMessage("Save the "+n+" displayed ROIs as an overlay?");
2739 gd.setOKLabel("Discard");
2740 gd.setCancelLabel("Save as Overlay");
2741 gd.showDialog();
2742 if (gd.wasCanceled())
2743 moveRoisToOverlay(imp);
2744 else
2745 removeOverlay(imp);
2746 } else
2747 imp.draw();
2748 }
2749
2750 /** Moves all the ROIs to the specified image's overlay. */
2751 public void moveRoisToOverlay(ImagePlus imp) {

Callers

nothing calls this directly

Calls 15

saveLocationMethod · 0.95
macroRunningMethod · 0.95
getCountMethod · 0.95
getCurrentImageMethod · 0.95
getCanvasMethod · 0.95
addMessageMethod · 0.95
setOKLabelMethod · 0.95
setCancelLabelMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
moveRoisToOverlayMethod · 0.95

Tested by

no test coverage detected