public void setImagesUpdated() { ic.setImageUpdated(); if (channelCanvasses == null) return; for (int i = 0; i < channelCanvasses.size(); i++) { channelCanvasses.get(i).setImageUpdated(); } }
public void setImage(ImagePlus imp2) { ImageCanvas ic = getCanvas(); if (ic==null || imp2==null) return; imp = imp2; imp.setWindow(this); ic.updateImage(imp); ic.setImageUpdated(); ic.repaint(); repaint(); }
public void setImage(ImagePlus imp2) { ImageCanvas ic = getCanvas(); if (ic==null || imp2==null) return; imp = imp2; imp.setWindow(this); ic.updateImage(imp); ic.setImageUpdated(); ic.repaint(); repaint(); }
/** 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(); }
void updatePaste() { if (clipboard!=null) { imp.getMask(); ImageProcessor ip = imp.getProcessor(); ip.reset(); int xoffset=0, yoffset=0; Roi croi = clipboard.getRoi(); if (croi!=null) { Rectangle r = croi.getBounds(); if (r.x<0) xoffset=-r.x; if (r.y<0) yoffset=-r.y; } ip.copyBits(clipboard.getProcessor(), x+xoffset, y+yoffset, pasteMode); if (type!=RECTANGLE) ip.reset(ip.getMask()); if (ic!=null) ic.setImageUpdated(); } }
void updatePaste() { if (clipboard!=null) { imp.getMask(); ImageProcessor ip = imp.getProcessor(); ip.reset(); int xoffset=0, yoffset=0; Roi croi = clipboard.getRoi(); if (croi!=null) { Rectangle r = croi.getBounds(); if (r.x<0) xoffset=-r.x; if (r.y<0) yoffset=-r.y; } ip.copyBits(clipboard.getProcessor(), x+xoffset, y+yoffset, pasteMode); if (type!=RECTANGLE) ip.reset(ip.getMask()); if (ic!=null) ic.setImageUpdated(); } }