Displays the plot.
()
| 269 | |
| 270 | /** Displays the plot. */ |
| 271 | @AstroImageJ(reason = "Add new buttons, hide some buttons for MP and SP", modified = true) |
| 272 | public void draw() { |
| 273 | Panel bottomPanel = new Panel(); |
| 274 | int hgap = IJ.isMacOSX()?1:5; |
| 275 | |
| 276 | list = new Button(" List "); |
| 277 | list.setVisible(isStandardIJPlot()); |
| 278 | list.addActionListener(this); |
| 279 | if (getTitle().startsWith("Seeing Profile")) { |
| 280 | aps.addActionListener(this); |
| 281 | bottomPanel.add(aps); |
| 282 | } |
| 283 | copy.addActionListener(this); |
| 284 | helpButton = new Button("Help"); |
| 285 | helpButton.setVisible(!isStandardIJPlot()); |
| 286 | bottomPanel.add(helpButton); |
| 287 | bottomPanel.add(list); |
| 288 | bottomPanel.add(copy); |
| 289 | bottomPanel.add(pngButton); |
| 290 | pngButton.addActionListener(this); |
| 291 | bottomPanel.add(pdfButton); |
| 292 | pdfButton.addActionListener(this); |
| 293 | bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT,hgap,0)); |
| 294 | data = new Button(dataButtonLabel); |
| 295 | data.addActionListener(this); |
| 296 | data.setVisible(isStandardIJPlot()); |
| 297 | bottomPanel.add(data); |
| 298 | more = new Button(moreButtonLabel); |
| 299 | more.setVisible(isStandardIJPlot()); |
| 300 | more.addActionListener(this); |
| 301 | bottomPanel.add(more); |
| 302 | if (plot!=null && plot.getPlotMaker()!=null) { |
| 303 | live = new Button("Live"); |
| 304 | live.addActionListener(this); |
| 305 | bottomPanel.add(live); |
| 306 | } |
| 307 | statusLabel = new Label(); |
| 308 | statusLabel.setFont(new Font("Monospaced", Font.PLAIN, 12)); |
| 309 | statusLabel.setBackground(new Color(220, 220, 220)); |
| 310 | bottomPanel.add(statusLabel); |
| 311 | add(bottomPanel); |
| 312 | data.add(getDataPopupMenu()); |
| 313 | more.add(getMorePopupMenu()); |
| 314 | plot.draw(); |
| 315 | LayoutManager lm = getLayout(); |
| 316 | if (lm instanceof ImageLayout) |
| 317 | ((ImageLayout)lm).ignoreNonImageWidths(true); //don't expand size to make the panel fit |
| 318 | GUI.scale(bottomPanel); |
| 319 | maximizeCoordinatesLabelWidth(); |
| 320 | pack(); |
| 321 | |
| 322 | ImageProcessor ip = plot.getProcessor(); |
| 323 | boolean ipIsColor = ip instanceof ColorProcessor; |
| 324 | boolean impIsColor = imp.getProcessor() instanceof ColorProcessor; |
| 325 | if (ipIsColor != impIsColor) |
| 326 | imp.setProcessor(null, ip); |
| 327 | else |
| 328 | imp.updateAndDraw(); |
no test coverage detected