Small fix. Added in a comment as a reminder to fix last bit of painting problem.
2005-10-05 Lillian Angel <[EMAIL PROTECTED]> * javax/swing/plaf/basic/BasicTreeUI.java (paintRow): Fixed indentation. (updateCurrentVisiblePath): Added FIXME comment. On Wed, 2005-10-05 at 17:28 -0400, Lillian Angel wrote: > Fixed up BasicTreeUI because it was not efficent when painting. > > 2005-10-05 Lillian Angel <[EMAIL PROTECTED]> > > * javax/swing/plaf/metal/MetalTreeUI.java > (installUI): Fixed to call toggleExpandState instead. > * javax/swing/plaf/basic/BasicTreeUI.java > (getPathForRow): Used currentVisiblePath to get Path. > (getRowForPath): Used currentVisiblePath to get row. > (getRowCount): Returned currentVisiblePath length. > (updateLayoutCacheExpandedNodes): Took out unneeded code. > (installUI): Fixed to call toggleExpandState instead. > (getPreferredSize): Made more efficent by using > currentVisiblePath. > (toggleExpandState): Called updateCurrentVisiblePath. > (getCellLocation): Made more efficent. > (paintNode): Removed. > (paintRecursive): Made more efficent, changed paintNode calls to > paintRow. > (getNextVisibleNode): Reimplemented to use currentVisiblePath. > (getPreviousVisibleNode): Likewise. > (paintRow): Implemented. > (updateCurrentVisiblePath): New helper used to cache the current > visible path. > > _______________________________________________ > Classpath-patches mailing list > Classpath-patches@gnu.org > http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/plaf/basic/BasicTreeUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v retrieving revision 1.85 diff -u -r1.85 BasicTreeUI.java --- javax/swing/plaf/basic/BasicTreeUI.java 5 Oct 2005 21:29:18 -0000 1.85 +++ javax/swing/plaf/basic/BasicTreeUI.java 5 Oct 2005 21:48:22 -0000 @@ -3144,7 +3144,8 @@ if (!mod.isLeaf(node)) max = mod.getChildCount(node); - if (!node.equals(mod.getRoot())) + if (!node.equals(mod.getRoot()) && + (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) @@ -3691,7 +3692,9 @@ current = current.pathByAddingChild(next); else current = new TreePath(next); - + + // FIXME: Inefficent to have 2 loops when the + // tree is very large. Find a better way. do next = getNextNode(next); while (next != null
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches