void paintImage(Graphics2D g, Paint paint, double width, double height, double period) {
      try {
        g.setPaint(paint);
        paintImage(g, width, height, period);
      }
      finally {
        g.dispose();
      }
    }
void paintImage(Graphics2D g, Paint paint, double width, double height, double period)