diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-05-05 08:07:57 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-05-05 08:07:57 +0000 |
commit | 06b4343f986f22ff9fcfae7e15f6fb2dee8b7456 (patch) | |
tree | 07ee0dace7d130051a2a143b2150e56b37204034 /javax | |
parent | d0979795927dce23cf395bbee18b04efe495c4fb (diff) | |
download | classpath-06b4343f986f22ff9fcfae7e15f6fb2dee8b7456.tar.gz |
2006-05-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* javax/swing/plaf/basic/BasicTreeUI.java (paint): Return early
if there are no visible nodes to paint.
Diffstat (limited to 'javax')
-rw-r--r-- | javax/swing/plaf/basic/BasicTreeUI.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/javax/swing/plaf/basic/BasicTreeUI.java b/javax/swing/plaf/basic/BasicTreeUI.java index bfbbffcdd..be61ccaec 100644 --- a/javax/swing/plaf/basic/BasicTreeUI.java +++ b/javax/swing/plaf/basic/BasicTreeUI.java @@ -1376,6 +1376,12 @@ public class BasicTreeUI public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; + + int rows = treeState.getRowCount(); + + if (rows == 0) + // There is nothing to do if the tree is empty. + return; Rectangle clip = g.getClipBounds(); @@ -1387,9 +1393,7 @@ public class BasicTreeUI int endIndex = tree.getClosestRowForLocation(clip.x + clip.width, clip.y + clip.height); - // Also paint dashes to the invisible nodes below: - int rows = treeState.getRowCount(); - + // Also paint dashes to the invisible nodes below. // These should be painted first, otherwise they may cover // the control icons. if (endIndex < rows) |