void (@Nullable JRootPane rootPane, long createdAt) { IdeGlassPane glassPane = rootPane == null ? null : ObjectUtils.tryCast(rootPane.getGlassPane(), IdeGlassPane.class); if (glassPane == null) return; long roundedDuration = TimeoutUtil.getDurationMillis(createdAt) / 1000 * 1000; //noinspection HardCodedStringLiteral String text = KeymapUtil.getShortcutText(CANCEL_SHORTCUT) + " to cancel, " + KeymapUtil.getShortcutText(DUMP_SHORTCUT) + " to dump threads (" + NlsMessages.formatDurationApproximateNarrow(roundedDuration) + ")"; Graphics graphics = rootPane.getGraphics(); GraphicsUtil.setupAAPainting(graphics); Rectangle viewR = rootPane.getBounds(), iconR = new Rectangle(), textR = new Rectangle(); FontMetrics fm = graphics.getFontMetrics(); SwingUtilities.layoutCompoundLabel(fm, text, null, 0, 0, 0, 0, viewR, iconR, textR, 0); graphics.translate(textR.x, textR.y); graphics.setColor(JBColor.GRAY); int border = 10; graphics.fillRoundRect(-border, -border, textR.width + 2 * border, textR.height + 2 * border, border, border); graphics.setColor(JBColor.WHITE); graphics.drawString(text, 0, fm.getAscent()); graphics.dispose(); }