Component parent = component.getParent();
  public void addDirtyRegion(JComponent component, int x, int y,                                          int w, int h)  {    if (w <= 0 || h <= 0 || !component.isShowing())      return;    component.computeVisibleRect(rectCache);    SwingUtilities.computeIntersection(x, y, w, h, rectCache);    if (! rectCache.isEmpty())      {    if (dirtyComponents.containsKey(component))          {            SwingUtilities.computeUnion(rectCache.x, rectCache.y,                                        rectCache.width, rectCache.height,                                   (Rectangle) dirtyComponents.get(component));          }        else          {    synchronized (dirtyComponents)      {                dirtyComponents.put(component, rectCache.getBounds());              }      }    if (! repaintWorker.isLive())      {        repaintWorker.setLive(true);        SwingUtilities.invokeLater(repaintWorker);      }  }  }