@Override
  public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
    Graphics2D g2 = (Graphics2D)g.create();
    Rectangle r = new Rectangle(x, y, width, height);
    JBInsets.removeFrom(r, JBUI.insets(1));

    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);

      g2.translate(r.x, r.y);

      float lw = LW.getFloat();
      float bw = BW.getFloat();
      float arc = COMPONENT_ARC.getFloat();

      Outline op = getOutline((JComponent)c);
      if (c.isEnabled() && op != null) {
        paintOutlineBorder(g2, r.width, r.height, arc, true, isFocused(c), op);
      }
      else {
        if (isFocused(c)) {
          paintFocusBorder(g2, r.width, r.height, arc, true);
        }

        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);
        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.setColor(getOutlineColor(c.isEnabled(), isFocused(c)));
        g2.fill(border);
      }
    }
    finally {
      g2.dispose();
    }
  }
@Override
  public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)