void paintComponent(BalloonImpl balloon, final Rectangle bounds, final Graphics2D g, Point pointTarget) {
      final GraphicsConfig cfg = new GraphicsConfig(g);
      cfg.setAntialiasing(true);

      if (balloon.myShadowBorderProvider != null) {
        balloon.myShadowBorderProvider.paintBorder(bounds, g);
        if (balloon.myShowPointer) {
          Position position;
          if (this == ABOVE) {
            position = Position.above;
          }
          else if (this == BELOW) {
            position = Position.below;
          }
          else if (this == AT_LEFT) {
            position = Position.atLeft;
          }
          else {
            position = Position.atRight;
          }
          balloon.myShadowBorderProvider.paintPointingShape(bounds, pointTarget, position, g);
        }
        cfg.restore();
        return;
      }

      Shape shape;
      if (balloon.myShowPointer) {
        shape = getPointingShape(bounds, pointTarget, balloon);
      }
      else {
        shape = getPointlessShape(balloon, bounds);
      }

      g.setPaint(balloon.myFillColor);
      g.fill(shape);
      if (balloon.myShowPointer && balloon.myPointerColor != null) {
        Shape balloonShape = getPointlessContentRec(bounds, getPointerLength(this, balloon.myDialogMode) + 1);
        Area area = new Area(shape);
        area.subtract(new Area(balloonShape));
        g.setColor(balloon.myPointerColor);
        g.fill(area);
      }
      g.setColor(balloon.myBorderColor);

      if (balloon.myTitleLabel != null) {
        Rectangle titleBounds = balloon.myTitleLabel.getBounds();

        Insets inset = getTitleInsets(getNormalInset() - 1, balloon.getPointerLength(this) + 50);
        Insets borderInsets = balloon.getShadowBorderInsets();
        inset.top += borderInsets.top;
        inset.bottom += borderInsets.bottom;
        inset.left += borderInsets.left;
        inset.right += borderInsets.right;

        titleBounds.x -= inset.left + JBUIScale.scale(1);
        titleBounds.width += inset.left + inset.right + JBUIScale.scale(50);
        titleBounds.y -= inset.top + JBUIScale.scale(1);
        titleBounds.height += inset.top + inset.bottom + JBUIScale.scale(1);

        Area area = new Area(shape);
        area.intersect(new Area(titleBounds));


        Color fgColor = UIManager.getColor("Label.foreground");
        fgColor = ColorUtil.toAlpha(fgColor, 140);
        g.setColor(fgColor);
        g.fill(area);

        g.setColor(balloon.myBorderColor);
        g.draw(area);
      }

      g.setStroke(new BasicStroke(BORDER_STROKE_WIDTH.get()));
      g.draw(shape);
      cfg.restore();
    }
void paintComponent(BalloonImpl balloon, final Rectangle bounds, final Graphics2D g, Point pointTarget)