summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-12-04 21:17:20 +0000
committerMark Wielaard <mark@klomp.org>2006-12-04 21:17:20 +0000
commit3c8afd2e2d8f20d98889e8b5abc5180d130d224c (patch)
tree558d87396413c008cdd764b4e7d8d4ce74eba2a0
parent6ae24ae28a2f2e3a63ebcf16bc223a206144874f (diff)
downloadclasspath-3c8afd2e2d8f20d98889e8b5abc5180d130d224c.tar.gz
* javax/swing/plaf/basic/BasicTreeUI.java (paint): Check whether
path[k] is null. (isLastChild): Return false when path is null.
-rw-r--r--ChangeLog6
-rw-r--r--javax/swing/plaf/basic/BasicTreeUI.java22
2 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index e77f081be..21ca3de55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-12-03 Mark Wielaard <mark@klomp.org>
+ * javax/swing/plaf/basic/BasicTreeUI.java (paint): Check whether
+ path[k] is null.
+ (isLastChild): Return false when path is null.
+
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (paintArea): Renamed
to currentPaintArea.
(paintComponent): Work with local reference to currentPaintArea.
diff --git a/javax/swing/plaf/basic/BasicTreeUI.java b/javax/swing/plaf/basic/BasicTreeUI.java
index ef46efdd2..5b0ffce09 100644
--- a/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/javax/swing/plaf/basic/BasicTreeUI.java
@@ -1587,12 +1587,15 @@ public class BasicTreeUI
for (int i = startIndex; i <= endIndex; i++, k++)
{
path[k] = treeState.getPathForRow(i);
- isLeaf[k] = treeModel.isLeaf(path[k].getLastPathComponent());
- isExpanded[k] = tree.isExpanded(path[k]);
- bounds[k] = getPathBounds(tree, path[k]);
+ if (path[k] != null)
+ {
+ isLeaf[k] = treeModel.isLeaf(path[k].getLastPathComponent());
+ isExpanded[k] = tree.isExpanded(path[k]);
+ bounds[k] = getPathBounds(tree, path[k]);
- paintHorizontalPartOfLeg(g, clip, insets, bounds[k], path[k], i,
- isExpanded[k], false, isLeaf[k]);
+ paintHorizontalPartOfLeg(g, clip, insets, bounds[k], path[k],
+ i, isExpanded[k], false, isLeaf[k]);
+ }
if (isLastChild(path[k]))
paintVerticalPartOfLeg(g, clip, insets, path[k]);
}
@@ -1600,8 +1603,9 @@ public class BasicTreeUI
k = 0;
for (int i = startIndex; i <= endIndex; i++, k++)
{
- paintRow(g, clip, insets, bounds[k], path[k], i, isExpanded[k],
- false, isLeaf[k]);
+ if (path[k] != null)
+ paintRow(g, clip, insets, bounds[k], path[k], i, isExpanded[k],
+ false, isLeaf[k]);
}
}
}
@@ -1611,7 +1615,9 @@ public class BasicTreeUI
*/
private boolean isLastChild(TreePath path)
{
- if (path instanceof GnuPath)
+ if (path == null)
+ return false;
+ else if (path instanceof GnuPath)
{
// Except the seldom case when the layout cache is changed, this
// optimized code will be executed.