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

Class AppearanceOptions

ij/src/main/java/ij/plugin/AppearanceOptions.java:16–199  ·  view source on GitHub ↗

This plugin implements the Edit/Options/Appearance command.

Source from the content-addressed store, hash-verified

14
15/** This plugin implements the Edit/Options/Appearance command. */
16public class AppearanceOptions implements PlugIn, DialogListener {
17 private boolean interpolate = Prefs.interpolateScaledImages;
18 private boolean open100 = Prefs.open100Percent;
19 private boolean black = Prefs.blackCanvas;
20 private boolean noBorder = Prefs.noBorder;
21 private boolean inverting = Prefs.useInvertingLut;
22 private int rangeIndex = ContrastAdjuster.get16bitRangeIndex();
23 private LUT[] luts = getLuts();
24 private int menuFontSize = Menus.getFontSize();
25 private double saveScale = Prefs.getGuiScale();
26 private boolean redrawn, repainted;
27
28 public void run(String arg) {
29 showDialog();
30 }
31
32 @AstroImageJ(reason = "Add option to disable beep", modified = true)
33 void showDialog() {
34 var disableBeepInit = Prefs.getBoolean(".aij.disableBeep", false);
35 String[] ranges = ContrastAdjuster.getSixteenBitRanges();
36 GenericDialog gd = new GenericDialog("Appearance");
37 gd.addCheckbox("Disable beep", disableBeepInit);
38 gd.addCheckbox("Interpolate zoomed images", Prefs.interpolateScaledImages);
39 gd.addCheckbox("Open images at 100%", Prefs.open100Percent);
40 gd.addCheckbox("Black canvas", Prefs.blackCanvas);
41 gd.addCheckbox("No image border", Prefs.noBorder);
42 gd.addCheckbox("Use inverting lookup table", Prefs.useInvertingLut);
43 gd.addCheckbox("Auto contrast stacks", Prefs.autoContrast);
44 gd.addCheckbox("IJ window always on top", Prefs.alwaysOnTop);
45 if (IJ.isLinux())
46 gd.addCheckbox("Cancel button on right", Prefs.dialogCancelButtonOnRight);
47 gd.addChoice("16-bit range:", ranges, ranges[rangeIndex]);
48 Font font = new Font("SansSerif", Font.PLAIN, 9);
49 if (!IJ.isMacOSX()) {
50 gd.setInsets(0, 0, 0);
51 gd.addNumericField("Menu font size:", Menus.getFontSize(), 0, 4, "points");
52 if (IJ.isWindows()) {
53 gd.setInsets(2,30,5);
54 gd.addMessage("Setting size>17 may not work on Windows", font);
55 }
56 }
57 gd.setInsets(0, 0, 0);
58 gd.addNumericField("GUI scale (0.5-3.0):", Prefs.getGuiScale(), 2, 5, "");
59 gd.setInsets(2,20,0);
60 gd.addMessage("Set to 1.5 to double size of tool icons, or 2.5 to triple", font);
61 gd.addHelp(IJ.URL2+"/docs/menus/edit.html#appearance");
62 gd.addDialogListener(this);
63 gd.showDialog();
64 if (gd.wasCanceled()) {
65 Prefs.set("aij.disableBeep", disableBeepInit);
66 Prefs.interpolateScaledImages = interpolate;
67 Prefs.open100Percent = open100;
68 Prefs.blackCanvas = black;
69 Prefs.noBorder = noBorder;
70 Prefs.useInvertingLut = inverting;
71 Prefs.setGuiScale(saveScale);
72 if (redrawn) draw();
73 if (repainted) repaintWindow();

Callers

nothing calls this directly

Calls 4

get16bitRangeIndexMethod · 0.95
getLutsMethod · 0.95
getFontSizeMethod · 0.95
getGuiScaleMethod · 0.95

Tested by

no test coverage detected