/** Moves and resizes this window. Changes the magnification so the image fills the window. */ public void setLocationAndSize(int x, int y, int width, int height) { setBounds(x, y, width, height); getCanvas().fitToWindow(); pack(); }
/** Moves and resizes this window. Changes the magnification so the image fills the window. */ public void setLocationAndSize(int x, int y, int width, int height) { setBounds(x, y, width, height); getCanvas().fitToWindow(); pack(); }
/** Implements the Image/Zoom/Original Scale command. */ public void unzoom() { double imag = imp.getWindow().getInitialMagnification(); if (magnification==imag) return; srcRect = new Rectangle(0, 0, imageWidth, imageHeight); ImageWindow win = imp.getWindow(); setSize((int)(imageWidth*imag), (int)(imageHeight*imag)); setMagnification(imag); setMaxBounds(); win.pack(); setMaxBounds(); repaint(); }
/** Implements the Image/Zoom/Original Scale command. */ public void unzoom() { double imag = imp.getWindow().getInitialMagnification(); if (magnification==imag) return; srcRect = new Rectangle(0, 0, imageWidth, imageHeight); ImageWindow win = imp.getWindow(); setSize((int)(imageWidth*imag), (int)(imageHeight*imag)); setMagnification(imag); setMaxBounds(); win.pack(); setMaxBounds(); 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(); }
imp.getWindow().pack();
/** * Copied over from ImageCanvas just to move the "pack" call behind adapting * channel canvasses. */ @Override public void zoomIn(final int x, final int y) { if (magnification >= 32) return; final double newMag = getHigherZoomLevel(magnification); final int newWidth = (int) (imageWidth * newMag); final int newHeight = (int) (imageHeight * newMag); final Dimension newSize = canEnlarge(newWidth, newHeight); if (newSize != null) { setDrawingSize(newSize.width, newSize.height); if (newSize.width != newWidth || newSize.height != newHeight) adjustSourceRectI5d( newMag, x, y); else setMagnification(newMag); adaptChannelCanvasses(); imp.getWindow().pack(); } else { adjustSourceRectI5d(newMag, x, y); adaptChannelCanvasses(); } repaint(); }
validate(); } else pack(); if (!updating) setLocation(x, y);
validate(); } else pack(); if (!updating) setLocation(x, y);
ic.setSize((int)newWidth, (int)newHeight); ic.setSourceRect(new Rectangle(0, 0, srcWidth, srcHeight)); win.pack();
ic.setSize((int)newWidth, (int)newHeight); ic.setSourceRect(new Rectangle(0, 0, srcWidth, srcHeight)); win.pack();
else setMagnification(newMag); imp.getWindow().pack(); } else // can't enlarge window adjustSourceRect(newMag, zoomTargetOX, zoomTargetOY);
else setMagnification(newMag); imp.getWindow().pack(); } else // can't enlarge window adjustSourceRect(newMag, zoomTargetOX, zoomTargetOY);
setLocation(loc.x, loc.y); if (!(this instanceof StackWindow || this instanceof PlotWindow)) { //layout now unless components will be added later pack(); show();
setLocation(loc.x, loc.y); if (!(this instanceof StackWindow || this instanceof PlotWindow)) { //layout now unless components will be added later pack(); show();
scaleField = CreateTextField(params, "Display scaling:", "2", 1); win.add(params); win.pack(); draw();