/[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.38 by langel, Fri Jul 15 20:37:00 2005 UTC revision 1.39 by langel, Mon Jul 18 15:04:43 2005 UTC
# Line 1281  public class BasicTreeUI Line 1281  public class BasicTreeUI
1281        g.translate(10, 10);        g.translate(10, 10);
1282        paintRecursive(g, 0, 0, 0, 0, tree, mod, mod.getRoot());        paintRecursive(g, 0, 0, 0, 0, tree, mod, mod.getRoot());
1283        paintControlIcons(g, 0, 0, 0, 0, tree, mod, mod.getRoot());        paintControlIcons(g, 0, 0, 0, 0, tree, mod, mod.getRoot());
1284          
1285          TreePath lead = tree.getLeadSelectionPath();
1286          if (lead != null && tree.isPathSelected(lead))
1287          {
1288             Rectangle cell = getPathBounds(tree, lead);
1289             g.setColor(UIManager.getLookAndFeelDefaults().getColor(
1290                   "Tree.selectionBorderColor"));
1291             g.drawRect(cell.x + 11, cell.y, cell.width, cell.height);
1292          }
1293          
1294        g.translate(-10, -10);        g.translate(-10, -10);
1295     }     }
1296    
# Line 1935  public class BasicTreeUI Line 1945  public class BasicTreeUI
1945           boolean cntlClick = false;           boolean cntlClick = false;
1946           Rectangle bounds = BasicTreeUI.this.getPathBounds(           Rectangle bounds = BasicTreeUI.this.getPathBounds(
1947                 BasicTreeUI.this.tree, path);                 BasicTreeUI.this.tree, path);
1948           int x = (int) bounds.getX();           int x = (int) bounds.x;
1949           int y = (int) bounds.getY();           int y = (int) bounds.y;
1950    
1951           if (clickY > y && clickY < (y + bounds.height + 10))           if (clickY > (y - 10) && clickY < (y + bounds.height + 10))
1952           {           {
1953              if (clickX > x && clickX < (x + bounds.width + 20))              if (clickX > (x - 5) && clickX < (x + bounds.width + 25))
1954                 inBounds = true;                 inBounds = true;
1955              else if (clickX < (x - rightChildIndent + 5) &&              else if (clickX < (x - rightChildIndent + 5) &&
1956                    clickX > (x - rightChildIndent - 5))                    clickX > (x - rightChildIndent - 5))
# Line 2518  public class BasicTreeUI Line 2528  public class BasicTreeUI
2528        }        }
2529        return null;        return null;
2530     }     }
2531      
2532     /**     /**
2533      * Retrieves the location of some node, recursively starting at from      * Retrieves the location of some node, recursively starting at from
2534      * some node.      * some node.
# Line 2591  public class BasicTreeUI Line 2601  public class BasicTreeUI
2601                                      getCellBounds(x, y, leaf));                                      getCellBounds(x, y, leaf));
2602           }           }
2603           else           else
2604           {                       {  
2605              Component c = dtcr.getTreeCellRendererComponent(              Component c = dtcr.getTreeCellRendererComponent(
2606                    tree, leaf, false, false, true, 0, false);                    tree, leaf, false, false, true, 0, false);
2607                            

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

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