Commit 0de515d9 authored by legoc's avatar legoc
Browse files

Apply the renaming of the configuration name

parent a4ced4fc
......@@ -5,7 +5,10 @@ package fr.ill.ics.n3d.io;
import java.util.HashMap;
import org.w3c.dom.Element;
import fr.ill.ics.n3d.model.Component;
import fr.ill.ics.n3d.model.ConfigParams;
import fr.ill.ics.n3d.model.Model;
/**
......@@ -38,19 +41,25 @@ public class NameConverter {
}
private void convert(Component component, AsciiStringConverter ascii) {
// Change the filename and the name.
String convertedFileName = ascii.convert(component.getFileName());
String newFileName = new String(convertedFileName);
// for (int i = 0 ; this.fileNameConversion.containsKey(newFileName) ; i++, newFileName = convertedFileName+"--"+Integer.toString(i));
String newFileName = new String(convertedFileName);
String convertedName = ascii.convert(component.getName());
String newName = new String(convertedName);
// for (int i = 0 ; this.nameConversion.containsKey(newName) ; i++, newName = convertedName+"--"+Integer.toString(i));
String newName = new String(convertedName);
this.fileNameConversion.put(component.getFileName(), newFileName);
component.setFileName(newFileName);
this.nameConversion.put(component.getName(), newName);
component.setName(newName);
// Change the name of the configurations.
for (ConfigParams config : component.getConfigurations()) {
config.setConfiguration(ascii.convert(config.getConfiguration()));
}
// Iterate the children.
for (Component child : component.getChildren()) {
convert(child, ascii);
}
......
......@@ -6,6 +6,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.Stack;
import java.util.concurrent.CopyOnWriteArrayList;
......@@ -168,7 +169,7 @@ public class Component {
* Gets the configurations of the component.
* @return Array of the configurations
*/
public CopyOnWriteArrayList<ConfigParams> getConfigurations() {
public List<ConfigParams> getConfigurations() {
return configurations;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment