new TexturePaint(pattern2D, new Rectangle2D.Double(0., 0., 4., 2.));
new TexturePaint(pattern2D, new Rectangle2D.Double(0., 0., 4., 4.));
  static void fillMetalPattern2D(Graphics2D g2d,  int x, int y, int w, int h,                                 Color light, Color dark)  {    if (pattern2D == null || !darkColor.equals(dark) || !lightColor.equals(light))      initializePattern(light, dark);    // Prepare the texture.    TexturePaint texture =      new TexturePaint(pattern2D, new Rectangle2D.Double(0., 0., 4., 2.));    g2d.setPaint(texture);    g2d.fillRect(x, y, w, h);  }