setClip(r);
  public void translate(int x, int y)  {    transform.translate(x, y);    // Update the clip. We special-case rectangular clips here, because they    // are so common (e.g. in Swing).    if (clip != null)      {        if (clip instanceof Rectangle)          {            Rectangle r = (Rectangle) clip;            r.x -= x;            r.y -= y;          }        else          {            AffineTransform clipTransform = new AffineTransform();            clipTransform.translate(-x, -y);            updateClip(clipTransform);          }      }  }