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); } |