public void syncActiveImage(final ImageDisplay activeDisplay) { final LegacyImageMap imageMap = legacyService.getImageMap(); final ImagePlus activeImagePlus = imageMap.lookupImagePlus(activeDisplay); // NB - old way - caused probs with 3d Project // WindowManager.setTempCurrentImage(activeImagePlus); // NB - new way - test thoroughly if (activeImagePlus == null) WindowManager.setCurrentWindow(null); else WindowManager.setCurrentWindow(activeImagePlus.getWindow()); }
private static void removeImageWindow(ImageWindow win) { int index = imageList.indexOf(win); if (index==-1) return; // not on the window list imageList.removeElementAt(index); activations.remove(win); if (imageList.size()>1 && !Prefs.closingAll) { ImageWindow win2 = activations.size()>0?(ImageWindow)activations.get(activations.size()-1):null; setCurrentWindow(win2); } else currentWindow = null; setTempCurrentImage(null); //??? int nonImageCount = nonImageList.size(); if (nonImageCount>0) nonImageCount++; Menus.removeWindowMenuItem(nonImageCount+index); Menus.updateMenus(); Undo.reset(); }
private static void addImageWindow(ImageWindow win) { ImagePlus imp = win.getImagePlus(); if (imp==null) return; checkForDuplicateName(imp); imageList.add(win); Menus.addWindowMenuItem(imp); setCurrentWindow(win); }
private static void removeImageWindow(ImageWindow win) { int index = imageList.indexOf(win); if (index==-1) return; // not on the window list imageList.removeElementAt(index); activations.remove(win); if (imageList.size()>1 && !Prefs.closingAll) { ImageWindow win2 = activations.size()>0?(ImageWindow)activations.get(activations.size()-1):null; setCurrentWindow(win2); } else currentWindow = null; setTempCurrentImage(null); //??? int nonImageCount = nonImageList.size(); if (nonImageCount>0) nonImageCount++; Menus.removeWindowMenuItem(nonImageCount+index); Menus.updateMenus(); Undo.reset(); }
private static void addImageWindow(ImageWindow win) { ImagePlus imp = win.getImagePlus(); if (imp==null) return; checkForDuplicateName(imp); imageList.add(win); Menus.addWindowMenuItem(imp); setCurrentWindow(win); }
public void windowClosing(WindowEvent e) { if (closed) return; if (ij!=null) { WindowManager.setCurrentWindow(this); IJ.doCommand("Close"); } else { dispose(); WindowManager.removeWindow(this); } }
public void focusGained(FocusEvent e) { if (!Interpreter.isBatchMode() && ij!=null && !ij.quitting() && imp!=null) { if (IJ.debugMode) IJ.log("focusGained: "+imp); WindowManager.setCurrentWindow(this); } }
public void focusGained(FocusEvent e) { if (!Interpreter.isBatchMode() && ij!=null && !ij.quitting() && imp!=null) { if (IJ.debugMode) IJ.log("focusGained: "+imp); WindowManager.setCurrentWindow(this); } }
public void windowClosing(WindowEvent e) { if (closed) return; if (ij!=null) { WindowManager.setCurrentWindow(this); IJ.doCommand("Close"); } else { dispose(); WindowManager.removeWindow(this); } }
/** * Method mouse entered, applied to set the main window. * * @param e mouse event */ public void mouseEntered (final MouseEvent e) { WindowManager.setCurrentWindow(mainImp.getWindow()); mainImp.getWindow().toFront(); updateAndDraw(); } /* end mouseEntered */
private void setTempCurrentImage() { WindowManager.setCurrentWindow(canvas.getFakeImagePlus().getWindow()); WindowManager.setTempCurrentImage(canvas.getFakeImagePlus()); }
ImagePlus convertRGBToCompositeImage(ImagePlus imp) { ImageWindow win = imp.getWindow(); Point loc = win!=null?win.getLocation():null; ImagePlus imp2 = new CompositeImage(imp, CompositeImage.COMPOSITE); if (loc!=null) ImageWindow.setNextLocation(loc); imp2.show(); imp.hide(); WindowManager.setCurrentWindow(imp2.getWindow()); return imp2; }
ImageWindow win1 = imp.getWindow(); if (win1==null) return; setCurrentWindow(win1); toFront(win1); int index = imageList.indexOf(win1);
public void windowActivated(WindowEvent e) { if (IJ.debugMode) IJ.log("windowActivated: "+imp.getTitle()); if (IJ.isMacOSX()) setImageJMenuBar(this); if (imp==null) return; ImageJ ij = IJ.getInstance(); if (ij!=null && !closed && !ij.quitting() && !Interpreter.isBatchMode()) WindowManager.setCurrentWindow(this); Roi roi = imp.getRoi(); if (roi!=null && (roi instanceof PointRoi)) PointToolOptions.update(); if (imp.isComposite()) Channels.updateChannels(); imp.setActivated(); // notify ImagePlus that image has been activated }
public void windowActivated(WindowEvent e) { if (IJ.debugMode) IJ.log("windowActivated: "+imp.getTitle()); if (IJ.isMacOSX()) setImageJMenuBar(this); if (imp==null) return; ImageJ ij = IJ.getInstance(); if (ij!=null && !closed && !ij.quitting() && !Interpreter.isBatchMode()) WindowManager.setCurrentWindow(this); Roi roi = imp.getRoi(); if (roi!=null && (roi instanceof PointRoi)) PointToolOptions.update(); if (imp.isComposite()) Channels.updateChannels(); imp.setActivated(); // notify ImagePlus that image has been activated }
ImageWindow win = img1.getWindow(); if (win!=null) WindowManager.setCurrentWindow(win); ip1.snapshot(); Undo.setup(Undo.FILTER, img1);
ImageWindow win = img1.getWindow(); if (win!=null) WindowManager.setCurrentWindow(win); else if (Interpreter.isBatchMode() && !createWindow && WindowManager.getImage(img1.getID())!=null) IJ.selectWindow(img1.getID());
ImageWindow win = img1.getWindow(); if (win!=null) WindowManager.setCurrentWindow(win); else if (Interpreter.isBatchMode() && !createWindow && WindowManager.getImage(img1.getID())!=null) IJ.selectWindow(img1.getID());
ImageWindow win = img1.getWindow(); if (win!=null) WindowManager.setCurrentWindow(win); else if (Interpreter.isBatchMode() && !createWindow && WindowManager.getImage(img1.getID())!=null) IJ.selectWindow(img1.getID());
if (newImage.getWindow() != null) WindowManager.setCurrentWindow(newImage .getWindow());