public static void drawCenteredString(@NotNull Graphics2D g, @NotNull Rectangle rect, @NotNull String str) {
    drawCenteredString(g, rect, str, true, true);
  }
public static void drawCenteredString(@NotNull Graphics2D g, @NotNull Rectangle rect, @NotNull String str)