void showImageJ() { ImageJ ij = IJ.getInstance(); if (ij!=null) ij.toFront(); }
void showImageJ() { ImageJ ij = IJ.getInstance(); if (ij!=null) ij.toFront(); }
static public final void showStatus(final String msg, final boolean focus) { if (null == IJ.getInstance() || !ControlWindow.isGUIEnabled() || null == status) { System.out.println(msg); return; } if (focus) IJ.getInstance().toFront(); status.showStatus(msg); }
/** Activates the window with the specified title. */ public static void selectWindow(String title) { if (title.equals("ImageJ")&&ij!=null) {ij.toFront(); return;} long start = System.currentTimeMillis(); while (System.currentTimeMillis()-start<3000) { // 3 sec timeout Window win = WindowManager.getWindow(title); if (win!=null && !(win instanceof ImageWindow)) { selectWindow(win); return; } int[] wList = WindowManager.getIDList(); int len = wList!=null?wList.length:0; for (int i=0; i<len; i++) { ImagePlus imp = WindowManager.getImage(wList[i]); if (imp!=null) { if (imp.getTitle().equals(title)) { selectWindow(imp.getID()); return; } } } wait(10); } error("Macro Error", "No window with the title \""+title+"\" found."); }
/** Activates the window with the specified title. */ public static void selectWindow(String title) { if (title.equals("ImageJ")&&ij!=null) {ij.toFront(); return;} long start = System.currentTimeMillis(); while (System.currentTimeMillis()-start<3000) { // 3 sec timeout Window win = WindowManager.getWindow(title); if (win!=null && !(win instanceof ImageWindow)) { selectWindow(win); return; } int[] wList = WindowManager.getIDList(); int len = wList!=null?wList.length:0; for (int i=0; i<len; i++) { ImagePlus imp = WindowManager.getImage(wList[i]); if (imp!=null) { if (imp.getTitle().equals(title)) { selectWindow(imp.getID()); return; } } } wait(10); } error("Macro Error", "No window with the title \""+title+"\" found."); }
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(); }
else if (cmd.equals("ij")) { ImageJ ij = IJ.getInstance(); if (ij!=null) ij.toFront(); } else if (cmd.equals("tab")) WindowManager.putBehind();
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(); }
else if (cmd.equals("ij")) { ImageJ ij = IJ.getInstance(); if (ij!=null) ij.toFront(); } else if (cmd.equals("tab")) WindowManager.putBehind();
public PlugInDialog(String title) { super(IJ.isMacOSX()?IJ.getInstance():null,title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); this.title = title; ImageJ ij = IJ.getInstance(); if (IJ.isMacOSX() && ij!=null) { ij.toFront(); // needed for keyboard shortcuts to work IJ.wait(250); } addWindowListener(this); addFocusListener(this); if (IJ.isLinux()) setBackground(ImageJ.backgroundColor); if (ij!=null && !IJ.isMacOSX()) { Image img = ij.getIconImage(); if (img!=null) try {setIconImage(img);} catch (Exception e) {} } }
public PlugInDialog(String title) { super(IJ.isMacOSX()?IJ.getInstance():null,title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); this.title = title; ImageJ ij = IJ.getInstance(); if (IJ.isMacOSX() && ij!=null) { ij.toFront(); // needed for keyboard shortcuts to work IJ.wait(250); } addWindowListener(this); addFocusListener(this); if (IJ.isLinux()) setBackground(ImageJ.backgroundColor); if (ij!=null && !IJ.isMacOSX()) { Image img = ij.getIconImage(); if (img!=null) try {setIconImage(img);} catch (Exception e) {} } }
return; } else { IJ.getInstance().toFront(); ke.consume(); return;