/** * Disposes all the non-image window frames, as given by * {@link WindowManager#getNonImageWindows()}. */ private void disposeNonImageFrames() { for (final Frame frame : WindowManager.getNonImageWindows()) { frame.dispose(); } }
/** Returns whether there is at least one table that can be used for "Add from Table" */ public static boolean tableWindowExists() { Frame[] windows = WindowManager.getNonImageWindows(); for (Frame win : windows) { if (win instanceof TextWindow) { ResultsTable rt = ((TextWindow)win).getResultsTable(); if (isValid(rt)) return true; } } return false; }
/** * Iterates on the list of TextWindows, and keeps only the ones containing a * non-null ResultsTable */ private static final TextWindow[] getTableWindows() { Frame[] frames = WindowManager.getNonImageWindows(); ArrayList<TextWindow> windows = new ArrayList<TextWindow>(frames.length); for (Frame frame : frames) { if (frame instanceof TextWindow) { TextWindow tw = (TextWindow) frame; if (tw.getTextPanel().getResultsTable() != null) { windows.add(tw); } } } return windows.toArray(new TextWindow[0]); }
public static void main(String[] args) { JFrame frame = null; for (java.awt.Frame f : ij.WindowManager.getNonImageWindows()) if (f instanceof JFrame) frame = (JFrame)f; new JFrameCommandFinder("JFrame Command Finder Demo", frame).setVisible(true); } }
/** Returns whether there is at least one table that can be used for "Add from Table" */ public static boolean tableWindowExists() { Frame[] windows = WindowManager.getNonImageWindows(); for (Frame win : windows) { if (win instanceof TextWindow) { ResultsTable rt = ((TextWindow)win).getResultsTable(); if (isValid(rt)) return true; } } return false; }
/** Prepare the lists 'allTables', "allTableNames' for the "Add from Table" dialog. * Also sets 'defaultTableIndex' */ private void prepareAddFromTable() { ArrayList<TextWindow> tableWindows = new ArrayList<TextWindow>(); Frame[] windows = WindowManager.getNonImageWindows(); for (Frame win : windows) { if (!(win instanceof TextWindow)) continue; ResultsTable rt = ((TextWindow)win).getResultsTable(); if (isValid(rt)) tableWindows.add((TextWindow)win); } allTables = new ResultsTable[tableWindows.size()]; allTableNames = new String[tableWindows.size()]; defaultTableIndex = 0; for (int i=0; i<allTables.length; i++) { TextWindow tw = tableWindows.get(i); allTables[i] = tw.getResultsTable(); if (allTableNames[i] == previousTableName) defaultTableIndex = i; allTableNames[i] = tw.getTitle(); } }
/** Prepare the lists 'allTables', "allTableNames' for the "Add from Table" dialog. * Also sets 'defaultTableIndex' */ private void prepareAddFromTable() { ArrayList<TextWindow> tableWindows = new ArrayList<TextWindow>(); Frame[] windows = WindowManager.getNonImageWindows(); for (Frame win : windows) { if (!(win instanceof TextWindow)) continue; ResultsTable rt = ((TextWindow)win).getResultsTable(); if (isValid(rt)) tableWindows.add((TextWindow)win); } allTables = new ResultsTable[tableWindows.size()]; allTableNames = new String[tableWindows.size()]; defaultTableIndex = 0; for (int i=0; i<allTables.length; i++) { TextWindow tw = tableWindows.get(i); allTables[i] = tw.getResultsTable(); if (allTableNames[i] == previousTableName) defaultTableIndex = i; allTableNames[i] = tw.getTitle(); } }
void showAll(int[] wList) { if (wList!=null) { for (int i=0; i<wList.length; i++) { ImageWindow win = getWindow(wList[i]); if (win!=null) WindowManager.toFront(win); } } Frame[] frames = WindowManager.getNonImageWindows(); if (frames!=null) { for (int i=0; i<frames.length; i++) WindowManager.toFront(frames[i]); } IJ.getInstance().toFront(); }
void showAll(int[] wList) { if (wList!=null) { for (int i=0; i<wList.length; i++) { ImageWindow win = getWindow(wList[i]); if (win!=null) WindowManager.toFront(win); } } Frame[] frames = WindowManager.getNonImageWindows(); if (frames!=null) { for (int i=0; i<frames.length; i++) WindowManager.toFront(frames[i]); } IJ.getInstance().toFront(); }
final ArrayList<String> tableTitles = new ArrayList<>(); final Frame[] windows = WindowManager.getNonImageWindows(); TextWindow rtWindow; for (final Frame w : windows) {
Frame[] nonImages = getNonImageWindows(); for (int i=0; i<nonImages.length; i++) { Frame frame = nonImages[i];
Frame[] nonImages = getNonImageWindows(); for (int i=0; i<nonImages.length; i++) { Frame frame = nonImages[i];
Frame[] frames = WindowManager.getNonImageWindows(); if (frames!=null) { for (int i=0; i<frames.length; i++) {
Frame[] frames = WindowManager.getNonImageWindows(); if (frames!=null) { for (int i=0; i<frames.length; i++) {