()
| 32 | } |
| 33 | |
| 34 | void pageSetup() { |
| 35 | ImagePlus imp = WindowManager.getCurrentImage(); |
| 36 | Roi roi = imp!=null?imp.getRoi():null; |
| 37 | boolean isRoi = roi!=null && roi.isArea(); |
| 38 | GenericDialog gd = new GenericDialog("Page Setup"); |
| 39 | gd.addNumericField("Scale:", scaling, 0, 3, "%"); |
| 40 | gd.addCheckbox("Draw border", drawBorder); |
| 41 | gd.addCheckbox("Center on page", center); |
| 42 | gd.addCheckbox("Print title", label); |
| 43 | if (isRoi) |
| 44 | gd.addCheckbox("Selection only", printSelection); |
| 45 | gd.addCheckbox("Rotate 90"+IJ.degreeSymbol, rotate); |
| 46 | gd.addCheckbox("Print_actual size", actualSize); |
| 47 | if (imp!=null) |
| 48 | gd.enableYesNoCancel(" OK ", "Print"); |
| 49 | gd.showDialog(); |
| 50 | if (gd.wasCanceled()) |
| 51 | return; |
| 52 | scaling = gd.getNextNumber(); |
| 53 | if (scaling<5.0) scaling = 5; |
| 54 | drawBorder = gd.getNextBoolean(); |
| 55 | center = gd.getNextBoolean(); |
| 56 | label = gd.getNextBoolean(); |
| 57 | if (isRoi) |
| 58 | printSelection = gd.getNextBoolean(); |
| 59 | else |
| 60 | printSelection = false; |
| 61 | rotate = gd.getNextBoolean(); |
| 62 | actualSize = gd.getNextBoolean(); |
| 63 | if (!gd.wasOKed() && imp!=null) { |
| 64 | this.imp = imp; |
| 65 | print(imp); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | void print(ImagePlus imp) { |
| 70 | PrinterJob pj = PrinterJob.getPrinterJob(); |
no test coverage detected