int scrollLeft = scrollPane.getScrollLeft();
if (view != null
&& view.isShowing()
&& isOptimizeScrolling()) {
Bounds blitArea = view.getVisibleArea();
int blitX = blitArea.x + view.getX();
int blitY = blitArea.y + view.getY();
int blitWidth = blitArea.width;
int blitHeight = blitArea.height;
if (columnHeader != null) {
// Blit the column header as well
int columnHeaderHeight = columnHeader.getHeight();
blitY -= columnHeaderHeight;
blitHeight += columnHeaderHeight;
}
int deltaScrollLeft = scrollLeft - previousScrollLeft;
blitX += Math.max(deltaScrollLeft, 0);
blitWidth -= Math.abs(deltaScrollLeft);
Graphics2D graphics = scrollPane.getGraphics();
graphics.copyArea(blitX, blitY, blitWidth, blitHeight, -deltaScrollLeft, 0);
scrollPane.setConsumeRepaint(true);
try {
view.setLocation(rowHeaderWidth - scrollLeft, view.getY());
if (columnHeader != null) {
columnHeader.setLocation(rowHeaderWidth - scrollLeft, 0);
}
} finally {
scrollPane.setConsumeRepaint(false);
}
boolean repaintAllViewport = scrollPane.isRepaintAllViewport();
if (!repaintAllViewport) {
scrollPane.repaint(rowHeaderWidth + (deltaScrollLeft > 0 ? blitWidth : 0), blitY,
Math.abs(deltaScrollLeft), blitHeight, true);
} else {
Bounds viewportBounds = getViewportBounds();
scrollPane.repaint(viewportBounds.x, viewportBounds.y,
viewportBounds.width, viewportBounds.height, true);
}
} else {
if (view != null) {