/[classpath]/classpath/javax/swing/JTree.java
ViewVC logotype

Diff of /classpath/javax/swing/JTree.java

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

revision 1.8.2.13 by tromey, Sat Nov 26 05:29:42 2005 UTC revision 1.8.2.14 by gnu_andrew, Sun Nov 27 21:00:38 2005 UTC
# Line 1480  public class JTree extends JComponent im Line 1480  public class JTree extends JComponent im
1480      updateUI();      updateUI();
1481      setRootVisible(true);      setRootVisible(true);
1482      setModel(model);      setModel(model);
1483      setSelectionModel(EmptySelectionModel.sharedInstance());      setSelectionModel(new EmptySelectionModel());
1484    }    }
1485    
1486    /**    /**
# Line 2065  public class JTree extends JComponent im Line 2065  public class JTree extends JComponent im
2065        }        }
2066      Rectangle rect = getPathBounds(path);      Rectangle rect = getPathBounds(path);
2067      scrollRectToVisible(rect);      scrollRectToVisible(rect);
2068      setSelectionPath(temp);      revalidate();
2069        repaint();
2070    }    }
2071    
2072    public void scrollRowToVisible(int row)    public void scrollRowToVisible(int row)
# Line 2363  public class JTree extends JComponent im Line 2364  public class JTree extends JComponent im
2364    
2365    public void expandPath(TreePath path)    public void expandPath(TreePath path)
2366    {    {
2367      // Don't expand if last path component is a leaf node.      // Don't expand if path is null
2368      if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent())))      if (path == null)
2369        return;        return;
2370    
2371      try      try
# Line 2588  public class JTree extends JComponent im Line 2589  public class JTree extends JComponent im
2589    
2590      if (!isExpanded(parent) && parent != null)      if (!isExpanded(parent) && parent != null)
2591        doExpandParents(parent, false);        doExpandParents(parent, false);
2592        
2593      nodeStates.put(path, state ? EXPANDED : COLLAPSED);      nodeStates.put(path, state ? EXPANDED : COLLAPSED);
2594    }    }
2595    
# Line 2596  public class JTree extends JComponent im Line 2597  public class JTree extends JComponent im
2597    {    {
2598      if (path == null)      if (path == null)
2599        return;        return;
     TreePath parent = path.getParentPath();  
2600    
2601      doExpandParents(path, state);      doExpandParents(path, state);
2602    }    }
# Line 2650  public class JTree extends JComponent im Line 2650  public class JTree extends JComponent im
2650    {    {
2651      if (path == null)      if (path == null)
2652        return;        return;
2653        
2654      expandPath(path.getParentPath());      expandPath(path.getParentPath());
2655    }    }
2656    

Legend:
Removed from v.1.8.2.13  
changed lines
  Added in v.1.8.2.14

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