void (double magnification) { Magnificator magnificator = ((ZoomableViewport)myViewportComponent).getMagnificator(); if (magnificator != null && Double.compare(magnification, 0) != 0) { Point inContent = convertToContentCoordinates(myMagnificationPoint); final Point inContentScaled = magnificator.magnify(magnificationToScale(magnification), inContent); int vOffset = inContentScaled.y - myMagnificationPoint.y; int hOffset = inContentScaled.x - myMagnificationPoint.x; myViewportComponent.repaint(); myViewportComponent.validate(); scrollTo(vOffset, hOffset); } myMagnificationPoint = null; myMagnification = 0; myCachedImage = null; }