public static void paint(@NotNull Graphics2D g, double x1, double y1, double x2, double y2) {
    double sw = g.getStroke() instanceof BasicStroke ? ((BasicStroke)g.getStroke()).getLineWidth() : 1;
    paint(g, x1, y1, x2, y2, StrokeType.INSIDE, sw);
  }
public static void paint(@NotNull Graphics2D g, double x1, double y1, double x2, double y2)