public boolean promptBeforeDeleting() { if (promptBeforeDeletingCalled) return promptBeforeDeleting; else return nMarkers>10 && imp!=null && imp.getWindow()!=null; }
void resetMaxBounds() { ImageWindow win = imp.getWindow(); if (win!=null && (System.currentTimeMillis()-win.setMaxBoundsTime)>500L) { win.setMaximizedBounds(win.maxWindowBounds); maxBoundsReset = true; } }
ImageWindow getWindow(int id) { ImageWindow win = null; ImagePlus imp = WindowManager.getImage(id); if (imp!=null) win = imp.getWindow(); return win; }
@Override public void imageOpened(ImagePlus ip) { //when a new image is opened in the environement we need to listen to it gaining foces ip.getWindow().addWindowFocusListener(this); }
protected void adaptChannelCanvasses() { final Image5DWindow win = (Image5DWindow) imp.getWindow(); if (win != null) { win.adaptCanvasses(this); } }
void setMaxBounds() { if (maxBoundsReset) { maxBoundsReset = false; ImageWindow win = imp.getWindow(); if (win!=null && !IJ.isLinux() && win.maxBounds!=null) { win.setMaximizedBounds(win.maxBounds); win.setMaxBoundsTime = System.currentTimeMillis(); } } }
/** overrides ImageCanvas.mouseExited; removes 'range' arrows */ public void mouseExited(MouseEvent e) { ImageWindow win = imp.getWindow(); if (win instanceof PlotWindow) ((PlotWindow)win).mouseExited(e); super.mouseExited(e); }
/** * Toggle current result overlay image */ public static void toggleOverlay() { final ImageWindow iw = WindowManager.getCurrentImage().getWindow(); if( iw instanceof CustomWindow ) { final CustomWindow win = (CustomWindow) iw; win.toggleOverlay(); } }
private static Frame getImageWindow(String title) { int[] wList = getIDList(); int len = wList!=null?wList.length:0; for (int i=0; i<len; i++) { ImagePlus imp = getImage(wList[i]); if (imp!=null) { if (imp.getTitle().equals(title)) return imp.getWindow(); } } return null; }
ImagePlus getImage() { ImagePlus imp = IJ.getImage(interp); if (imp.getWindow()==null && IJ.getInstance()!=null && !interp.isBatchMode() && WindowManager.getTempCurrentImage()==null) throw new RuntimeException(Macro.MACRO_CANCELED); defaultIP = null; defaultImp = imp; return imp; }
void abortPluginOrMacro() { Interpreter.abortPrevious(); IJ.setKeyDown(KeyEvent.VK_ESCAPE); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { ImageWindow win = imp.getWindow(); if (win!=null) { win.running = false; win.running2 = false; } } }
public static void closeAllWithoutConfirmation() { int[] wList = WindowManager.getIDList(); if (wList==null) { return; } for (int i=0; i<wList.length; i++) { ImagePlus imp = WindowManager.getImage(wList[i]); imp.changes=false; imp.getWindow().close(); } }
protected void adaptChannelRois(final boolean thisChannel) { final Image5DWindow win = (Image5DWindow) imp.getWindow(); if (win != null) { if (thisChannel) { win.adaptRois(this); } else { win.adaptRois((Image5DCanvas) win.getCanvas()); } } }
/** * Method mouse moved, show the coordinates of the mouse pointer. * * @param e mouse event */ public void mouseMoved (final MouseEvent e) { setControl(); final int x = mainImp.getWindow().getCanvas().offScreenX(e.getX()); final int y = mainImp.getWindow().getCanvas().offScreenY(e.getY()); IJ.showStatus(mainImp.getLocationAsString(x, y) + getValueAsString(x, y)); } /* end mouseMoved */
void abortPluginOrMacro(ImagePlus imp) { if (imp!=null) { ImageWindow win = imp.getWindow(); if (win!=null) { win.running = false; win.running2 = false; } } Macro.abort(); Interpreter.abort(); if (Interpreter.getInstance()!=null) IJ.beep(); }
private void addImageListeners() { imp.addImageListener(this); ImageWindow win = imp.getWindow(); if (win == null) close(); canvas = win.getCanvas(); canvas.addKeyListener(this); }
void setDimensions(ImagePlus img) { int c = (int)getFirstArg(); int z = (int)getNextArg(); int t = (int)getLastArg(); img.setDimensions(c, z, t); if (img.getWindow()==null) img.setOpenAsHyperStack(true); }
public void mouseExited(MouseEvent e) { PlugInTool tool = Toolbar.getPlugInTool(); if (tool!=null) { tool.mouseExited(imp, e); if (e.isConsumed()) return; } ImageWindow win = imp.getWindow(); if (win!=null) setCursor(defaultCursor); IJ.showStatus(""); mouseExited = true; }
private static Frame getParentFrame() { Frame parent = WindowManager.getCurrentImage()!=null? (Frame)WindowManager.getCurrentImage().getWindow():IJ.getInstance()!=null?IJ.getInstance():new Frame(); if (IJ.isMacOSX() && IJ.isJava18()) { ImageJ ij = IJ.getInstance(); if (ij!=null && ij.isActive()) parent = ij; else parent = null; } return parent; }