(String arg)
| 15 | private boolean centered; |
| 16 | |
| 17 | public void run(String arg) { |
| 18 | ImagePlus imp = IJ.getImage(); |
| 19 | Roi roi = imp.getRoi(); |
| 20 | if (roi==null) { |
| 21 | IJ.error("Scale", "This command requires a selection"); |
| 22 | return; |
| 23 | } |
| 24 | if (!IJ.isMacro() && !imp.okToDeleteRoi()) |
| 25 | return; |
| 26 | if (!showDialog()) |
| 27 | return; |
| 28 | if (!IJ.macroRunning()) { |
| 29 | defaultXScale = xscale; |
| 30 | defaultYScale = yscale; |
| 31 | } |
| 32 | Roi roi2 = scale(roi, xscale, yscale, centered); |
| 33 | if (roi2==null) |
| 34 | return; |
| 35 | Undo.setup(Undo.ROI, imp); |
| 36 | roi = (Roi)roi.clone(); |
| 37 | imp.setRoi(roi2); |
| 38 | Roi.setPreviousRoi(roi); |
| 39 | } |
| 40 | |
| 41 | public boolean showDialog() { |
| 42 | GenericDialog gd = new GenericDialog("Scale Selection"); |
nothing calls this directly
no test coverage detected