setClip(clip);
  public void clip(Shape s)  {    // Initialize clip if not already present.    if (clip == null)      clip = s;        // This is so common, let's optimize this.     else if (clip instanceof Rectangle && s instanceof Rectangle)      {        Rectangle clipRect = (Rectangle) clip;        Rectangle r = (Rectangle) s;        computeIntersection(r.x, r.y, r.width, r.height, clipRect);      }   else     {       Area current;       if (clip instanceof Area)         current = (Area) clip;       else         current = new Area(clip);       Area intersect;       if (s instanceof Area)         intersect = (Area) s;       else         intersect = new Area(s);       current.intersect(intersect);       clip = current;       isOptimized = false;     }  }