/** Draws image and roi outline using a clip rect. */ public void draw(int x, int y, int width, int height){ if (win!=null) { ImageCanvas ic = win.getCanvas(); double mag = ic.getMagnification(); x = ic.screenX(x); y = ic.screenY(y); width = (int)(width*mag); height = (int)(height*mag); ic.repaint(x, y, width, height); if (listeners.size()>0 && roi!=null && roi.getPasteMode()!=Roi.NOT_PASTING) notifyListeners(UPDATED); } }
/** Draws image and roi outline using a clip rect. */ public void draw(int x, int y, int width, int height){ if (win!=null) { ImageCanvas ic = win.getCanvas(); double mag = ic.getMagnification(); x = ic.screenX(x); y = ic.screenY(y); width = (int)(width*mag); height = (int)(height*mag); ic.repaint(x, y, width, height); if (listeners.size()>0 && roi!=null && roi.getPasteMode()!=Roi.NOT_PASTING) notifyListeners(UPDATED); } }
/** Sets the image name. */ public void setTitle(String title) { if (title==null) return; if (win!=null) { if (ij!=null) Menus.updateWindowMenuItem(this, this.title, title); String virtual = stack!=null && stack.isVirtual()?" (V)":""; String global = getGlobalCalibration()!=null?" (G)":""; String scale = ""; double magnification = win.getCanvas().getMagnification(); if (magnification!=1.0) { double percent = magnification*100.0; int digits = percent>100.0||percent==(int)percent?0:1; scale = " (" + IJ.d2s(percent,digits) + "%)"; } win.setTitle(title+virtual+global+scale); } boolean titleChanged = !title.equals(this.title); this.title = title; if (titleChanged && listeners.size()>0) notifyListeners(UPDATED); }
/** Sets the image name. */ public void setTitle(String title) { if (title==null) return; if (win!=null) { if (ij!=null) Menus.updateWindowMenuItem(this, this.title, title); String virtual = stack!=null && stack.isVirtual()?" (V)":""; String global = getGlobalCalibration()!=null?" (G)":""; String scale = ""; double magnification = win.getCanvas().getMagnification(); if (magnification!=1.0) { double percent = magnification*100.0; int digits = percent>100.0||percent==(int)percent?0:1; scale = " (" + IJ.d2s(percent,digits) + "%)"; } win.setTitle(title+virtual+global+scale); } boolean titleChanged = !title.equals(this.title); this.title = title; if (titleChanged && listeners.size()>0) notifyListeners(UPDATED); }
/** Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).*/ public synchronized void updateAndDraw() { if (stack!=null && !stack.isVirtual() && currentSlice>=1 && currentSlice<=stack.getSize()) { Object pixels = stack.getPixels(currentSlice); if (ip!=null && pixels!=null && pixels!=ip.getPixels()) { // was stack updated? try { ip.setPixels(pixels); ip.setSnapshotPixels(null); } catch(Exception e) {} } } if (win!=null) { win.getCanvas().setImageUpdated(); if (listeners.size()>0) notifyListeners(UPDATED); } draw(); }
/** Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).*/ public synchronized void updateAndDraw() { if (stack!=null && !stack.isVirtual() && currentSlice>=1 && currentSlice<=stack.getSize()) { Object pixels = stack.getPixels(currentSlice); if (ip!=null && pixels!=null && pixels!=ip.getPixels()) { // was stack updated? try { ip.setPixels(pixels); ip.setSnapshotPixels(null); } catch(Exception e) {} } } if (win!=null) { win.getCanvas().setImageUpdated(); if (listeners.size()>0) notifyListeners(UPDATED); } draw(); }
/** Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked. */ public synchronized void flush() { notifyListeners(CLOSED); if (locked || ignoreFlush) return; ip = null; if (roi!=null) roi.setImage(null); roi = null; if (stack!=null && stack.viewers(-1)<=0) { Object[] arrays = stack.getImageArray(); if (arrays!=null) { for (int i=0; i<arrays.length; i++) arrays[i] = null; } if (isComposite()) ((CompositeImage)this).setChannelsUpdated(); //flush } setStackNull(); img = null; win = null; if (roi!=null) roi.setImage(null); roi = null; properties = null; //calibration = null; overlay = null; flatteningCanvas = null; }
/** Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked. */ public synchronized void flush() { notifyListeners(CLOSED); if (locked || ignoreFlush) return; ip = null; if (roi!=null) roi.setImage(null); roi = null; if (stack!=null && stack.viewers(-1)<=0) { Object[] arrays = stack.getImageArray(); if (arrays!=null) { for (int i=0; i<arrays.length; i++) arrays[i] = null; } if (isComposite()) ((CompositeImage)this).setChannelsUpdated(); //flush } setStackNull(); img = null; win = null; if (roi!=null) roi.setImage(null); roi = null; properties = null; //calibration = null; overlay = null; flatteningCanvas = null; }
IJ.showStatus(""); changes = false; notifyListeners(UPDATED);
IJ.showStatus(""); changes = false; notifyListeners(UPDATED);
this.ip = ip; if (this.ip!=null && getWindow()!=null) notifyListeners(UPDATED); if (ij!=null) ip.setProgressBar(ij.getProgressBar());
this.ip = ip; if (this.ip!=null && getWindow()!=null) notifyListeners(UPDATED); if (ij!=null) ip.setProgressBar(ij.getProgressBar());
notifyListeners(OPENED);