code: public void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) {
          SegmentType segmentStatus = getSegmentType(c);
          int         newHeight     = getButtonHeight(c, height);
  
          int yOffset = (height - newHeight) / 2;
  
          height = newHeight;
  
          g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  
          int x = focusInsets.left;
          int y = focusInsets.top + yOffset;
  
          width  -= focusInsets.left + focusInsets.right;
          height -= focusInsets.top + focusInsets.bottom;
  
          boolean useToolBarFocus = isInToolBar(c);
          Shape   s;
  
          if (focused) {
              s = createOuterFocus(segmentStatus, x, y, width, height);
              g.setPaint(getFocusPaint(s, FocusType.OUTER_FOCUS, useToolBarFocus));
              g.draw(s);
              s = createInnerFocus(segmentStatus, x, y, width, height);
              g.setPaint(getFocusPaint(s, FocusType.INNER_FOCUS, useToolBarFocus));
              g.draw(s);
          }
  
          if (!isInToolBar(c) || this instanceof TexturedButtonPainter) {
              s = createBorder(segmentStatus, x, y, width, height);
  
              if (!focused) {
                  dropShadow.fill(g, s);
              }
  
              g.setPaint(getCommonBorderPaint(s, type));
              g.fill(s);
  
              s = createInterior(segmentStatus, x, y, width, height);
              g.setPaint(getCommonInteriorPaint(s, type));
              g.fill(s);
          }
      }
docs: {@inheritDoc}