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(); }
public void updateImage(ImagePlus imp) { if (imp!=this.imp) throw new IllegalArgumentException("imp!=this.imp"); this.imp = imp; ic.updateImage(imp); setLocationAndSize(true); if (this instanceof StackWindow) { StackWindow sw = (StackWindow)this; int stackSize = imp.getStackSize(); int nScrollbars = sw.getNScrollbars(); if (stackSize==1 && nScrollbars>0) sw.removeScrollbars(); else if (stackSize>1 && nScrollbars==0) sw.addScrollbars(imp); } pack(); repaint(); maxBounds = getMaximumBounds(); setMaximizedBounds(maxBounds); setMaxBoundsTime = System.currentTimeMillis(); }
public void updateImage(ImagePlus imp) { if (imp!=this.imp) throw new IllegalArgumentException("imp!=this.imp"); this.imp = imp; ic.updateImage(imp); setLocationAndSize(true); if (this instanceof StackWindow) { StackWindow sw = (StackWindow)this; int stackSize = imp.getStackSize(); int nScrollbars = sw.getNScrollbars(); if (stackSize==1 && nScrollbars>0) sw.removeScrollbars(); else if (stackSize>1 && nScrollbars==0) sw.addScrollbars(imp); } pack(); repaint(); maxBounds = getMaximumBounds(); setMaximizedBounds(maxBounds); setMaxBoundsTime = System.currentTimeMillis(); }