public static void drawHDottedLine(@NotNull Graphics2D g,
                                     int startX,
                                     int endX,
                                     int lineY,
                                     final @Nullable Color bgColor,
                                     final Color fgColor) {
    if (bgColor != null) {
      g.setColor(bgColor);
      LinePainter2D.paint(g, startX, lineY, endX, lineY);
    }

    g.setColor(fgColor);

    for (int i = startX / 2 * 2; i < endX; i += 2) {
      g.drawRect(i, lineY, 0, 0);
    }
  }
public static void drawHDottedLine(@NotNull Graphics2D g,
                                     int startX,
                                     int endX,
                                     int lineY,
                                     final @Nullable Color bgColor,
                                     final Color fgColor)