lensModel.setLensLocation((int) (newX/lensModel.getImageZoomFactor()), (int)(newY/lensModel.getImageZoomFactor())); lensModel.setWidth((int)(newWidth/lensModel.getImageZoomFactor())); lensModel.setHeight((int)(newHeight/lensModel.getImageZoomFactor()));
double f = lensModel.getImageZoomFactor(); lensModel.setLensLocation((int) (newX/f), (int)(newY/f)); lensModel.setWidth((int) (newWidth/f)); lensModel.setHeight((int) (newHeight/f));
	private void setLensBounds(int dx, int dy, int dw, int dh, 														boolean keepSquare)	{		int newX = lens.getX()+dx;		int newY = lens.getY()+dy;		int newWidth, newHeight;				if(keepSquare)		{			int mx = Math.max(dw, dh);			int mn = Math.min(dw, dh);			if( Math.abs(mx) > Math.abs(mn) )			{				dw = mx;				dh = mx;			}			else			{				dw = mn;				dh = mn;			}					}		if(checkBounds(dx, dy, dw, dh))		{			newWidth = lens.getWidth()+dw;			newHeight = lens.getHeight()+dh;									lens.setBounds(newX, newY, newWidth, newHeight);			lensModel.setLensLocation((int) (newX/lensModel.getImageZoomFactor()),					(int)(newY/lensModel.getImageZoomFactor()));			lensModel.setWidth((int)(newWidth/lensModel.getImageZoomFactor()));			lensModel.setHeight((int)(newHeight/lensModel.getImageZoomFactor()));			zoomWindow.setLensXY(lensModel.getX(), lensModel.getY());			zoomWindow.setLensWidthHeight(lensModel.getWidth(), 					lensModel.getHeight());			setZoomUISize();		}			}