()
| 49 | } |
| 50 | |
| 51 | public void doOptions() { |
| 52 | double ymin = ProfilePlot.getFixedMin(); |
| 53 | double ymax = ProfilePlot.getFixedMax(); |
| 54 | boolean fixedScale = ymin!=0.0 || ymax!=0.0; |
| 55 | boolean wasFixedScale = fixedScale; |
| 56 | GenericDialog gd = new GenericDialog("Plot Defaults"); |
| 57 | gd.setInsets(4,0,0); |
| 58 | gd.addMessage("---------- Plot Defaults ---------"); |
| 59 | gd.addNumericField("Width:", PlotWindow.plotWidth, 0); |
| 60 | gd.addNumericField("Height:", PlotWindow.plotHeight, 0); |
| 61 | gd.addNumericField("Font size:", PlotWindow.getDefaultFontSize()); |
| 62 | gd.setInsets(5,20,0); //distance to previous |
| 63 | //gd.addCheckbox("Draw grid lines", !PlotWindow.noGridLines); |
| 64 | gd.addCheckbox("Draw_ticks", !PlotWindow.noTicks); |
| 65 | gd.addCheckbox("Auto-close", PlotWindow.autoClose); |
| 66 | gd.addCheckbox("List values", PlotWindow.listValues); |
| 67 | gd.setInsets(15,0,0); |
| 68 | gd.addMessage("------- Profile Plot Options -------"); |
| 69 | gd.setInsets(5,20,0); |
| 70 | gd.addCheckbox("Fixed y-axis scale", fixedScale); |
| 71 | gd.addNumericField("Minimum Y:", ymin, 2); |
| 72 | gd.addNumericField("Maximum Y:", ymax, 2); |
| 73 | gd.setInsets(10,20,0); |
| 74 | String[] labels = {"Vertical", "Interpolate", "Live"}; |
| 75 | boolean[] states = {Prefs.verticalProfile, PlotWindow.interpolate, Prefs.autoLivePlots}; |
| 76 | gd.addCheckboxGroup(2, 2, labels, states); |
| 77 | gd.addHelp(IJ.URL2+"/docs/menus/edit.html#plot-options"); |
| 78 | gd.showDialog(); |
| 79 | if (gd.wasCanceled()) |
| 80 | return; |
| 81 | int w = (int)gd.getNextNumber(); |
| 82 | int h = (int)gd.getNextNumber(); |
| 83 | if (w<Plot.MIN_FRAMEWIDTH) w = Plot.MIN_FRAMEWIDTH; |
| 84 | if (h<Plot.MIN_FRAMEHEIGHT) h = Plot.MIN_FRAMEHEIGHT; |
| 85 | int fontSize = (int)gd.getNextNumber(); |
| 86 | if (!gd.invalidNumber()) { |
| 87 | PlotWindow.plotWidth = w; |
| 88 | PlotWindow.plotHeight = h; |
| 89 | PlotWindow.setDefaultFontSize(fontSize); |
| 90 | } |
| 91 | PlotWindow.noTicks = !gd.getNextBoolean(); |
| 92 | //data options |
| 93 | PlotWindow.autoClose = gd.getNextBoolean(); |
| 94 | PlotWindow.listValues = gd.getNextBoolean(); |
| 95 | //profile plot options |
| 96 | fixedScale = gd.getNextBoolean(); |
| 97 | ymin = gd.getNextNumber(); |
| 98 | ymax = gd.getNextNumber(); |
| 99 | //profile options |
| 100 | Prefs.verticalProfile = gd.getNextBoolean(); |
| 101 | PlotWindow.interpolate = gd.getNextBoolean(); |
| 102 | Prefs.autoLivePlots = gd.getNextBoolean(); |
| 103 | if (!fixedScale && !wasFixedScale && (ymin!=0.0 || ymax!=0.0)) |
| 104 | fixedScale = true; |
| 105 | if (!fixedScale) { |
| 106 | ymin = 0.0; |
| 107 | ymax = 0.0; |
| 108 | } else if (ymin>ymax) { |
no test coverage detected