Displays the plot in a PlotWindow. Plot stacks are shown in a StackWindow, not in a PlotWindow; in this case the return value is null (use getImagePlus().getWindow() instead). Also returns null in BatchMode. Note that the PlotWindow might get closed immediately if its 'listValues' and 'autoClose
()
| 1749 | * @see #update() |
| 1750 | */ |
| 1751 | public PlotWindow show() { |
| 1752 | PlotVirtualStack stack = getStack(); |
| 1753 | if (stack!=null) { |
| 1754 | getImagePlus().show(); |
| 1755 | return null; |
| 1756 | } |
| 1757 | if ((IJ.macroRunning() && IJ.getInstance()==null) || Interpreter.isBatchMode()) { |
| 1758 | imp = getImagePlus(); |
| 1759 | imp.setPlot(this); |
| 1760 | WindowManager.setTempCurrentImage(imp); |
| 1761 | if (getMainCurveObject() != null) { |
| 1762 | imp.setProperty("XValues", getXValues()); // Allows values to be retrieved by |
| 1763 | imp.setProperty("YValues", getYValues()); // by Plot.getValues() macro function |
| 1764 | } |
| 1765 | Interpreter.addBatchModeImage(imp); |
| 1766 | return null; |
| 1767 | } |
| 1768 | if (imp != null) { |
| 1769 | Window win = imp.getWindow(); |
| 1770 | if (win instanceof PlotWindow && win.isVisible()) { |
| 1771 | updateImage(); // show in existing window |
| 1772 | return (PlotWindow)win; |
| 1773 | } else |
| 1774 | setImagePlus(null); |
| 1775 | } |
| 1776 | PlotWindow pw = new PlotWindow(this); //note: this may set imp to null if pw has listValues and autoClose are set |
| 1777 | if (IJ.isMacro() && imp!=null) // wait for plot to be displayed |
| 1778 | IJ.selectWindow(imp.getID()); |
| 1779 | return pw; |
| 1780 | } |
| 1781 | |
| 1782 | /** |
| 1783 | * Appends the current plot to a virtual stack and resets allPlotObjects |
no test coverage detected