A few NPEs were being raised after the most recent changes.

2005-10-06  Lillian Angel  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicTreeUI.java
        (startEditing): Should always change the bounds, whenever
        we start editing.
        (paintRow): Fixed location where editing component should
        be drawn. The constant takes care of the space around the
        icon.
        * javax/swing/JTree.java
        (JTree): Called updateUI first so currentVisiblePath is
        cached right away. Prevents NPEs.


On Thu, 2005-10-06 at 09:45 -0400, Lillian Angel wrote:
> The click-area for a leaf was slightly off. Fixed.
> 
> 2005-10-06  Lillian Angel  <[EMAIL PROTECTED]>
> 
>         * javax/swing/plaf/basic/BasicTreeUI.java
>         (mousePressed): Shouldn't change x location for leaf.
> 
> 
> 
> On Wed, 2005-10-05 at 17:49 -0400, Lillian Angel wrote:
> > 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
> > > [email protected]
> > > http://lists.gnu.org/mailman/listinfo/classpath-patches
> > _______________________________________________
> > Classpath-patches mailing list
> > [email protected]
> > http://lists.gnu.org/mailman/listinfo/classpath-patches
> _______________________________________________
> Classpath-patches mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/classpath-patches

Index: javax/swing/JTree.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTree.java,v
retrieving revision 1.43
diff -u -r1.43 JTree.java
--- javax/swing/JTree.java	26 Sep 2005 20:53:01 -0000	1.43
+++ javax/swing/JTree.java	6 Oct 2005 19:21:07 -0000
@@ -1477,11 +1477,11 @@
    */
   public JTree(TreeModel model)
   {
+    updateUI();
     setRootVisible(true);
-    setModel(model);
     setSelectionModel(EmptySelectionModel.sharedInstance());
     setCellRenderer(new DefaultTreeCellRenderer());
-    updateUI();
+    setModel(model);
   }
 
   /**
Index: javax/swing/plaf/basic/BasicTreeUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
retrieving revision 1.87
diff -u -r1.87 BasicTreeUI.java
--- javax/swing/plaf/basic/BasicTreeUI.java	6 Oct 2005 13:44:32 -0000	1.87
+++ javax/swing/plaf/basic/BasicTreeUI.java	6 Oct 2005 19:21:07 -0000
@@ -1564,8 +1564,7 @@
     int y;
     if (event == null)
       {
-	if (bounds == null)
-           bounds = getPathBounds(tree, path);
+        bounds = getPathBounds(tree, path);
         x = bounds.x;
         y = bounds.y;
       }
@@ -3628,7 +3627,9 @@
             && node.equals(editingPath.getLastPathComponent()))
           {
             rendererPane.paintComponent(g, editingComponent.getParent(), null,
-                                        new Rectangle(0, 0, bounds.width, bounds.height));
+                                        new Rectangle(getCurrentControlIcon(path).
+                                                      getIconWidth() - 5, 0, bounds.width, 
+                                                      bounds.height));
           }
         else
           {
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to