/[classpath]/classpath/javax/swing/plaf/basic/BasicTreeUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicTreeUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by langel, Fri Jul 15 17:53:09 2005 UTC revision 1.38 by langel, Fri Jul 15 20:37:00 2005 UTC
# Line 1932  public class BasicTreeUI Line 1932  public class BasicTreeUI
1932           TreePath path = BasicTreeUI.this.tree.getPathForRow(row);           TreePath path = BasicTreeUI.this.tree.getPathForRow(row);
1933                    
1934           boolean inBounds = false;           boolean inBounds = false;
1935             boolean cntlClick = false;
1936           Rectangle bounds = BasicTreeUI.this.getPathBounds(           Rectangle bounds = BasicTreeUI.this.getPathBounds(
1937                 BasicTreeUI.this.tree, path);                 BasicTreeUI.this.tree, path);
1938           int x = (int) bounds.getX();           int x = (int) bounds.getX();
1939           int y = (int) bounds.getY();           int y = (int) bounds.getY();
          if ((clickY >= (y - 10) && clickY <= (y + bounds.height + 10))  
                && (clickX >= x && clickX <= (x + bounds.width + 25)))  
             inBounds = true;  
1940    
1941           if (inBounds && path != null && BasicTreeUI.this.tree.isVisible(path))           if (clickY > y && clickY < (y + bounds.height + 10))
1942             {
1943                if (clickX > x && clickX < (x + bounds.width + 20))
1944                   inBounds = true;
1945                else if (clickX < (x - rightChildIndent + 5) &&
1946                      clickX > (x - rightChildIndent - 5))
1947                   cntlClick = true;
1948             }
1949    
1950             if ((inBounds || cntlClick) && path != null &&
1951                   BasicTreeUI.this.tree.isVisible(path))
1952           {                     {          
1953              if (!BasicTreeUI.this.isLeaf(row))              if (!cntlClick && !BasicTreeUI.this.isLeaf(row))
1954                 clickCount++;                 clickCount++;
1955                            
1956              if (clickCount == 2)              if (clickCount == 2 || cntlClick == true)
1957              {              {
                BasicTreeUI.this.tree.getSelectionModel().clearSelection();  
1958                 clickCount = 0;                 clickCount = 0;
1959                   BasicTreeUI.this.tree.getSelectionModel().clearSelection();
1960                 if (BasicTreeUI.this.tree.isExpanded(path))                 if (BasicTreeUI.this.tree.isExpanded(path))
1961                 {                 {
1962                    BasicTreeUI.this.tree.collapsePath(path);                    BasicTreeUI.this.tree.collapsePath(path);
# Line 1960  public class BasicTreeUI Line 1968  public class BasicTreeUI
1968                    BasicTreeUI.this.tree.fireTreeExpanded(path);                    BasicTreeUI.this.tree.fireTreeExpanded(path);
1969                 }                 }
1970              }              }
1971                
1972              BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, path);              BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, path);
1973           }           }
1974        }        }

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26