/** Resizes the plot (unless frozen) to fit the window */ public void fitToWindow() { if (plot == null || plot.isFrozen()) { super.fitToWindow(); return; } ImageWindow win = imp.getWindow(); if (win==null) return; Rectangle bounds = win.getBounds(); Dimension extraSize = win.getExtraSize(); int width = bounds.width-extraSize.width;//(insets.left+insets.right+ImageWindow.HGAP*2); int height = bounds.height-extraSize.height;//(insets.top+insets.bottom+ImageWindow.VGAP*2); //IJ.log("fitToWindow "+bounds+"-> w*h="+width+"*"+height); resizeCanvas(width, height); getParent().doLayout(); }
/** Resizes the plot (unless frozen) to fit the window */ public void fitToWindow() { if (plot == null || plot.isFrozen()) { super.fitToWindow(); return; } ImageWindow win = imp.getWindow(); if (win==null) return; Rectangle bounds = win.getBounds(); Dimension extraSize = win.getExtraSize(); int width = bounds.width-extraSize.width;//(insets.left+insets.right+ImageWindow.HGAP*2); int height = bounds.height-extraSize.height;//(insets.top+insets.bottom+ImageWindow.VGAP*2); //IJ.log("fitToWindow "+bounds+"-> w*h="+width+"*"+height); resizeCanvas(width, height); getParent().doLayout(); }