void (final Graphics g) { Graphics2D g2d = (Graphics2D)g; GraphicsConfig config = new GraphicsConfig(g).setAntialiasing(UISettings.getShadowInstance().getIdeAAType() != AntialiasingType.OFF); Rectangle bounds = getBounds(); g2d.setColor(getBackground()); Insets insets = getInsets(); g2d.fillRect(insets.left, insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom); final String sizeString = String.format("%d x %d", myWidth, myHeight); FontMetrics fm = g2d.getFontMetrics(); int sizeWidth = fm.stringWidth(sizeString); int fontHeight = fm.getHeight(); int innerBoxWidthGap = JBUIScale.scale(20); int innerBoxHeightGap = JBUIScale.scale(5); int boxSize = JBUIScale.scale(15); int centerX = bounds.width / 2; int centerY = bounds.height / 2; int innerX = centerX - sizeWidth / 2 - innerBoxWidthGap; int innerY = centerY - fontHeight / 2 - innerBoxHeightGap; int innerWidth = sizeWidth + innerBoxWidthGap * 2; int innerHeight = fontHeight + innerBoxHeightGap * 2; g2d.setColor(getForeground()); drawCenteredString(g2d, fm, fontHeight, sizeString, centerX, centerY); g2d.setColor(JBColor.GRAY); g2d.drawRect(innerX, innerY, innerWidth, innerHeight); Insets borderInsets = null; if (myBorder != null) borderInsets = myBorder.getBorderInsets(myComponent); UIUtil.drawDottedRectangle(g2d, innerX - boxSize, innerY - boxSize, innerX + innerWidth + boxSize, innerY + innerHeight + boxSize); drawInsets(g2d, fm, "border", borderInsets, boxSize, fontHeight, innerX, innerY, innerWidth, innerHeight); g2d.drawRect(innerX - boxSize * 2, innerY - boxSize * 2, innerWidth + boxSize * 4, innerHeight + boxSize * 4); drawInsets(g2d, fm, "insets", myInsets, boxSize * 2, fontHeight, innerX, innerY, innerWidth, innerHeight); config.restore(); }