void (Component c, Graphics g, int x, int y, int width, int height) { if (!(c instanceof JComponent)) return; Graphics2D g2 = (Graphics2D)g.create(); try { boolean focused = isFocused(c); if (!isTableCellEditor(c)) { g2.translate(x, y); 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); Shape clip = g2.getClip(); Area area = new Area(new Rectangle2D.Double(0, 0, width, height)); area.subtract(getButtonBounds(c)); area.intersect(new Area(clip)); g2.setClip(area); float arc = isRound(c) ? ARC.getFloat() : 0; float bw = BW.getFloat(); float lw = LW(g2); Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD); border.append(new RoundRectangle2D.Double(bw, bw, width - bw * 2, height - bw * 2, arc, arc), false); border.append(new RoundRectangle2D.Double( bw + lw, bw + lw, width - (bw + lw) * 2, height - (bw + lw) * 2, arc - lw, arc - lw), false); g2.setColor(Gray.xBC); g2.fill(border); g2.setClip(clip); // Reset clip clipForBorder(c, g2, width, height); Outline op = getOutline((JComponent)c); if (c.isEnabled() && op != null) { paintOutlineBorder(g2, width, height, arc, isSymmetric(), focused, op); } else if (focused) { paintOutlineBorder(g2, width, height, arc, isSymmetric(), true, Outline.focus); } } else { paintCellEditorBorder(g2, c, new Rectangle(x, y, width, height), focused); } } finally { g2.dispose(); } }