/[svn]/jsampler/trunk/src/org/jsampler/view/DbDirectoryTreeNode.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/DbDirectoryTreeNode.java

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

revision 1351 by iliev, Thu May 24 21:43:45 2007 UTC revision 1352 by iliev, Sun Sep 16 23:24:15 2007 UTC
# Line 78  public class DbDirectoryTreeNode impleme Line 78  public class DbDirectoryTreeNode impleme
78          public void          public void
79          setInfo(DbDirectoryInfo info) { this.info = info; }          setInfo(DbDirectoryInfo info) { this.info = info; }
80                    
81            /**
82             * Renames this node.
83             * Also updates the paths of all children.
84             */
85            protected void
86            setName(String newName) {
87                    getInfo().setName(newName);
88                    for(DbInstrumentInfo i : instrs) {
89                            i.setDirectoryPath(getInfo().getDirectoryPath());
90                    }
91                    
92                    for(DbDirectoryTreeNode n : dirs) n.updateDirectoryPaths();
93            }
94            
95            /**
96             * Invoked when the name of a parent node is changed.
97             */
98            protected void
99            updateDirectoryPaths() {
100                    getInfo().setParentDirectoryPath(parent.getInfo().getDirectoryPath());
101                    
102                    for(DbInstrumentInfo i : instrs) {
103                            i.setDirectoryPath(getInfo().getDirectoryPath());
104                    }
105                    
106                    for(DbDirectoryTreeNode n : dirs) n.updateDirectoryPaths();
107            }
108            
109          // Tree node model methods          // Tree node model methods
110          public DbDirectoryTreeNode          public DbDirectoryTreeNode
111          getChildAt(int index) { return dirs.get(index); }          getChildAt(int index) { return dirs.get(index); }

Legend:
Removed from v.1351  
changed lines
  Added in v.1352

  ViewVC Help
Powered by ViewVC