MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getWindowType

Method getWindowType

ij/src/main/java/ij/macro/Functions.java:1872–1898  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

getInfoMethod · 0.95

Calls 9

getActiveWindowMethod · 0.95
getColumnHeadingsMethod · 0.95
getResultsTableMethod · 0.95
substringMethod · 0.80
getNameMethod · 0.65
getTextPanelMethod · 0.45
isEmptyMethod · 0.45
equalsMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected