void () { if (ApplicationManager.getApplication().isUnitTestMode()) return; Rectangle rect = ((JViewport)myEditorComponent.getParent()).getViewRect(); BufferedImage image = UIUtil.createImage(rect.width, rect.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = image.createGraphics(); graphics.translate(-rect.x, -rect.y); graphics.setClip(rect.x, rect.y, rect.width, rect.height); myEditorComponent.paintComponent(graphics); graphics.dispose(); putUserData(BUFFER, image); }