Overrides PlugInFrame.close().
()
| 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) { |
nothing calls this directly
no test coverage detected