Rectangle dirty = new Rectangle(x, y, width, height); Rectangle vis = getVisibleRect(); dirty = dirty.intersection(vis); RepaintManager.currentManager(this).addDirtyRegion(this, dirty.x, dirty.y, dirty.width, dirty.height);
RepaintManager.currentManager(this).addDirtyRegion(this, x, y, width, height);
  public void repaint(long tm, int x, int y, int width, int height)  {    Rectangle dirty = new Rectangle(x, y, width, height);    Rectangle vis = getVisibleRect();    dirty = dirty.intersection(vis);    RepaintManager.currentManager(this).addDirtyRegion(this, dirty.x, dirty.y,                                                       dirty.width,                                                       dirty.height);  }