void (Graphics g) { Rectangle visible = getVisibleRect(); if (!AbstractTreeBuilder.isToPaintSelection(this)) { boolean canHoldSelection = false; TreePath[] paths = getSelectionModel().getSelectionPaths(); if (paths != null) { for (TreePath each : paths) { Rectangle selection = getPathBounds(each); if (selection != null && (g.getClipBounds().intersects(selection) || g.getClipBounds().contains(selection))) { if (myBusy && myBusyIcon != null) { Rectangle busyIconBounds = myBusyIcon.getBounds(); if (selection.contains(busyIconBounds) || selection.intersects(busyIconBounds)) { canHoldSelection = false; break; } } canHoldSelection = true; if (!myBusy || myBusyIcon == null) break; } } } if (canHoldSelection) { mySelectionModel.holdSelection(); } } try { super.paint(g); if (!visible.equals(myLastVisibleRec)) { updateBusyIconLocation(); } myLastVisibleRec = visible; } finally { mySelectionModel.unholdSelection(); } }