| 183 | |
| 184 | // Make an appropriate automatic name from weighted ROC data file |
| 185 | static String autoName(File f, String scoreName) { |
| 186 | final StringBuilder autoname = new StringBuilder(); |
| 187 | final String parentDir = mangleDir(f.getAbsoluteFile().getParentFile().getName()); |
| 188 | autoname.append(parentDir); |
| 189 | |
| 190 | final String fname = f.getName(); |
| 191 | final int rocIdx = fname.indexOf(RocFilter.ROC_EXT); |
| 192 | if (rocIdx != -1 && !fname.startsWith(RocFilter.ALL.fileName())) { |
| 193 | if (autoname.length() > 0) { |
| 194 | autoname.append(' '); |
| 195 | } |
| 196 | autoname.append(fname, 0, rocIdx); |
| 197 | } |
| 198 | |
| 199 | if (scoreName != null) { |
| 200 | if (autoname.length() > 0) { |
| 201 | autoname.append(' '); |
| 202 | } |
| 203 | autoname.append(scoreName); |
| 204 | } |
| 205 | return autoname.toString(); |
| 206 | } |
| 207 | |
| 208 | // Set an automatic name based on directory name of file and score field if no explicit name was provided |
| 209 | void setTitle(File f, String name) { |