()
| 1870 | } |
| 1871 | |
| 1872 | private String getWindowType() { |
| 1873 | Window win = WindowManager.getActiveWindow(); |
| 1874 | if (win==null) |
| 1875 | return ""; |
| 1876 | String type = win.getClass().getName(); |
| 1877 | if (win instanceof TextWindow) { |
| 1878 | TextPanel tp = ((TextWindow)win).getTextPanel(); |
| 1879 | if (tp.getColumnHeadings().isEmpty() && tp.getResultsTable()==null) |
| 1880 | type = "Text"; |
| 1881 | else { |
| 1882 | if (tp.getResultsTable()!=null) |
| 1883 | type = "ResultsTable"; |
| 1884 | else |
| 1885 | type = "Table"; |
| 1886 | } |
| 1887 | } else if (type.equals("ij.gui.PlotWindow")) |
| 1888 | type = "Plot"; |
| 1889 | else if (type.equals("ij.gui.HistogramWindow")) |
| 1890 | type = "Histogram"; |
| 1891 | else if (win instanceof ij.gui.ImageWindow) |
| 1892 | type = "Image"; |
| 1893 | else { |
| 1894 | if (type.contains(".")) //strip off hierarchy |
| 1895 | type = type.substring(type.lastIndexOf('.')+1); |
| 1896 | } |
| 1897 | return type; |
| 1898 | } |
| 1899 | |
| 1900 | String getWindowContents() { |
| 1901 | Frame frame = WindowManager.getFrontWindow(); |
no test coverage detected