This class implements the Analyze/Plot Profile command. @author Michael Schmid @author Wayne Rasband
| 51 | * @author Wayne Rasband |
| 52 | */ |
| 53 | public class PlotWindow extends ImageWindow implements ActionListener, ItemListener, |
| 54 | ClipboardOwner, ImageListener, RoiListener, Runnable { |
| 55 | |
| 56 | private static final int WIDTH = 600; |
| 57 | private static final int HEIGHT = 340; |
| 58 | @AstroImageJ(reason = "Revert font size to 12 from 14", modified = true) |
| 59 | private static final int FONT_SIZE = 12; |
| 60 | private static final String PREFS_WIDTH = "pp.width"; |
| 61 | private static final String PREFS_HEIGHT = "pp.height"; |
| 62 | private static final String PREFS_FONT_SIZE = "pp.fontsize"; |
| 63 | |
| 64 | /** @deprecated */ |
| 65 | public static final int CIRCLE = Plot.CIRCLE; |
| 66 | /** @deprecated */ |
| 67 | public static final int X = Plot.X; |
| 68 | /** @deprecated */ |
| 69 | public static final int BOX = Plot.BOX; |
| 70 | /** @deprecated */ |
| 71 | public static final int TRIANGLE = Plot.TRIANGLE; |
| 72 | /** @deprecated */ |
| 73 | public static final int CROSS = Plot.CROSS; |
| 74 | /** @deprecated */ |
| 75 | public static final int LINE = Plot.LINE; |
| 76 | /** Write first X column when listing or saving. */ |
| 77 | public static boolean saveXValues = true; |
| 78 | /** Automatically close window after saving values. To set, use Edit/Options/Plots. */ |
| 79 | public static boolean autoClose; |
| 80 | /** Display the XY coordinates in a separate window. To set, use Edit/Options/Plots. */ |
| 81 | public static boolean listValues; |
| 82 | /** Interpolate line profiles. To set, use Edit/Options/Plots or setOption("InterpolateLines",boolean). */ |
| 83 | public static boolean interpolate = true; |
| 84 | // default values for new installations; values will be then saved in prefs |
| 85 | private static int defaultFontSize = Prefs.getInt(PREFS_FONT_SIZE, FONT_SIZE); |
| 86 | /** The width of the plot (without frame) in pixels. */ |
| 87 | public static int plotWidth = WIDTH; |
| 88 | /** The height of the plot in pixels. */ |
| 89 | public static int plotHeight = HEIGHT; |
| 90 | /** The plot text size, can be overridden by Plot.setFont, Plot.setFontSize, Plot.setXLabelFont etc. */ |
| 91 | public static int fontSize = defaultFontSize; |
| 92 | /** Have axes with no grid lines. If both noGridLines and noTicks are true, |
| 93 | * only min&max value of the axes are given */ |
| 94 | public static boolean noGridLines; |
| 95 | /** Have axes with no ticks. If both noGridLines and noTicks are true, |
| 96 | * only min&max value of the axes are given */ |
| 97 | public static boolean noTicks; |
| 98 | |
| 99 | private static final String OPTIONS = "pp.options"; |
| 100 | private static final int SAVE_X_VALUES = 1; |
| 101 | private static final int AUTO_CLOSE = 2; |
| 102 | private static final int LIST_VALUES = 4; |
| 103 | private static final int INTERPOLATE = 8; |
| 104 | private static final int NO_GRID_LINES = 16; |
| 105 | private static final int NO_TICKS = 32; |
| 106 | private static String moreButtonLabel = "More "+'\u00bb'; |
| 107 | private static String dataButtonLabel = "Data "+'\u00bb'; |
| 108 | |
| 109 | @AstroImageJ(reason = "Copy plot as PNG") |
| 110 | private Button pngButton = new Button("PNG"); |
nothing calls this directly
no test coverage detected