if (translated) gfx.translate (-bounds.x, -bounds.y); if (clipped) gfx.setClip (oldClip.x, oldClip.y, oldClip.width, oldClip.height);
g2.dispose();
  private void visitChild(Graphics gfx, GfxVisitor visitor,                          Component comp)  {    Rectangle bounds = comp.getBounds();    Rectangle oldClip = gfx.getClipBounds();    if (oldClip == null)      oldClip = bounds;    Rectangle clip = oldClip.intersection(bounds);    if (clip.isEmpty()) return;    boolean clipped = false;    boolean translated = false;    try      {        gfx.setClip(clip.x, clip.y, clip.width, clip.height);        clipped = true;        gfx.translate(bounds.x, bounds.y);        translated = true;        visitor.visit(comp, gfx);      }    finally      {        if (translated)          gfx.translate (-bounds.x, -bounds.y);        if (clipped)          gfx.setClip (oldClip.x, oldClip.y, oldClip.width, oldClip.height);      }  }