void (Component c, Graphics g, int x, int y, int width, int height) { Graphics2D g2 = (Graphics2D)g.create(); try { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, MacUIUtil.USE_QUARTZ ? RenderingHints.VALUE_STROKE_PURE : RenderingHints.VALUE_STROKE_NORMALIZE); boolean isSmallComboButton = isSmallVariant(c); int diam = HELP_BUTTON_DIAMETER.get(); float lw = LW.getFloat(); float bw = isSmallComboButton || isGotItButton(c) ? 0 : BW.getFloat(); float arc = isTag(c) ? height - bw * 2 - lw * 2: BUTTON_ARC.getFloat(); Rectangle r = new Rectangle(x, y, width, height); boolean paintComboFocus = isSmallComboButton && c.isFocusable() && c.hasFocus(); if (paintComboFocus) { // a11y support g2.setColor(JBUI.CurrentTheme.Focus.focusColor()); Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD); border.append(new RoundRectangle2D.Float(r.x, r.y, r.width, r.height, arc + lw, arc + lw), false); border.append(new RoundRectangle2D.Float(r.x + lw * 2, r.y + lw * 2, r.width - lw * 4, r.height - lw * 4, arc, arc), false); g2.fill(border); } if (!isGotItButton(c)) JBInsets.removeFrom(r, JBUI.insets(1)); g2.translate(r.x, r.y); if (!isSmallComboButton && !isGotItButton(c)) { if (c.hasFocus()) { if (UIUtil.isHelpButton(c)) { paintFocusOval(g2, (r.width - diam) / 2.0f, (r.height - diam) / 2.0f, diam, diam); } else if (isTag(c)) { paintTag(g2, r.width, r.height, c.hasFocus(), computeOutlineFor(c)); } else { Outline type = isDefaultButton((JComponent)c) ? Outline.defaultButton : Outline.focus; paintOutlineBorder(g2, r.width, r.height, arc, true, true, type); } } else if (isTag(c)) { paintTag(g2, r.width, r.height, c.hasFocus(), computeOutlineFor(c)); } } g2.setPaint(getBorderPaint(c)); if (UIUtil.isHelpButton(c)) { g2.draw(new Ellipse2D.Float((r.width - diam) / 2.0f, (r.height - diam) / 2.0f, diam, diam)); } else if (!paintComboFocus) { Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD); border.append(new RoundRectangle2D.Float(bw, bw, r.width - bw * 2, r.height - bw * 2, arc, arc), false); if (!isGotItButton(c)) { arc = arc > lw ? arc - lw : 0.0f; } border.append(new RoundRectangle2D.Float(bw + lw, bw + lw, r.width - (bw + lw) * 2, r.height - (bw + lw) * 2, arc, arc), false); g2.fill(border); } } finally { g2.dispose(); } }