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

Method pageSetup

ij/src/main/java/ij/plugin/filter/Printer.java:34–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

setupMethod · 0.95

Calls 12

getCurrentImageMethod · 0.95
getRoiMethod · 0.95
isAreaMethod · 0.95
addNumericFieldMethod · 0.95
addCheckboxMethod · 0.95
enableYesNoCancelMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
getNextNumberMethod · 0.95
getNextBooleanMethod · 0.95
wasOKedMethod · 0.95
printMethod · 0.95

Tested by

no test coverage detected