2005-07-21  Lillian Angel  <[EMAIL PROTECTED]>
        * javax/swing/plaf/basic/BasicTreeUI.java
        (getPreferredSize): Changed to depend on visible nodes.
        (mouseClicked): Fixed to keep track of last cell clicked, so 
        expand/collapse works properly by clicking 2 times on the same 
        cell.

? .ChangeLog.swp
? examples/gnu/classpath/examples/swing/Demo$1.class
? examples/gnu/classpath/examples/swing/Demo$10.class
? examples/gnu/classpath/examples/swing/Demo$11.class
? examples/gnu/classpath/examples/swing/Demo$2.class
? examples/gnu/classpath/examples/swing/Demo$3.class
? examples/gnu/classpath/examples/swing/Demo$4.class
? examples/gnu/classpath/examples/swing/Demo$5.class
? examples/gnu/classpath/examples/swing/Demo$6.class
? examples/gnu/classpath/examples/swing/Demo$7.class
? examples/gnu/classpath/examples/swing/Demo$8.class
? examples/gnu/classpath/examples/swing/Demo$9.class
? examples/gnu/classpath/examples/swing/Demo$CheckCellRenderer.class
? examples/gnu/classpath/examples/swing/Demo$LabelCellRenderer.class
? examples/gnu/classpath/examples/swing/Demo$LaterMain.class
? examples/gnu/classpath/examples/swing/Demo$PopUpAction.class
? examples/gnu/classpath/examples/swing/Demo.class
? examples/gnu/classpath/examples/swing/GNULookAndFeel.class
Index: examples/gnu/classpath/examples/swing/Demo.java
===================================================================
RCS file: /cvsroot/classpath/classpath/examples/gnu/classpath/examples/swing/Demo.java,v
retrieving revision 1.16
diff -u -r1.16 Demo.java
--- examples/gnu/classpath/examples/swing/Demo.java	21 Jul 2005 14:13:36 -0000	1.16
+++ examples/gnu/classpath/examples/swing/Demo.java	21 Jul 2005 14:30:33 -0000
@@ -70,7 +70,7 @@
                                           "Look and Feel notice",
                                           JOptionPane.INFORMATION_MESSAGE);
             
-            UIManager.setLookAndFeel(new GNULookAndFeel());
+            UIManager.setLookAndFeel(new MetalLookAndFeel());
           }
       }
     catch (UnsupportedLookAndFeelException e)
Index: javax/swing/plaf/basic/BasicTreeUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
retrieving revision 1.45
diff -u -r1.45 BasicTreeUI.java
--- javax/swing/plaf/basic/BasicTreeUI.java	20 Jul 2005 18:59:13 -0000	1.45
+++ javax/swing/plaf/basic/BasicTreeUI.java	21 Jul 2005 14:30:36 -0000
@@ -1322,7 +1322,7 @@
          while (node != null)
          {
             count++;
-            DefaultMutableTreeNode nextNode = node.getNextNode();
+            DefaultMutableTreeNode nextNode = getNextVisibleNode(node);
             if (nextNode != null)
                maxWidth = Math.max(maxWidth, (int) (getCellBounds(0, 0, nextNode)
                      .getWidth()));
@@ -1896,6 +1896,9 @@
       
       /** Number of mouse clicks on a non-leaf */
       private int clickCount = 0;
+      
+      /** The last non-leaf cell that was clicked */
+      private Object lastClicked = null;
 
       /**
        * Constructor
@@ -1943,11 +1946,21 @@
                   && BasicTreeUI.this.tree.isVisible(path))
             {
                if (!cntlClick && !BasicTreeUI.this.isLeaf(row))
-                  clickCount++;
+               {
+                  Object cell = path.getLastPathComponent();
+                  if (lastClicked != null && lastClicked.equals(cell))
+                     clickCount = 2;
+                  else
+                  {
+                     lastClicked = cell;
+                     clickCount = 1;
+                  }
+               }
 
                if (clickCount == 2 || cntlClick == true)
                {
                   clickCount = 0;
+                  lastClicked = null;
                   BasicTreeUI.this.tree.getSelectionModel().clearSelection();
                   if (BasicTreeUI.this.tree.isExpanded(path))
                   {
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to