Commit 5eec457f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

name of non empty complexes is escaped

parent 17fda2cf
......@@ -43,7 +43,7 @@ public class ModelContructor {
/**
* Default color used by complexes.
*/
private static final Color DEFAULT_COMPLEX_ALIAS_COLOR = new Color(248, 247, 240);
static final Color DEFAULT_COMPLEX_ALIAS_COLOR = new Color(248, 247, 240);
/**
* Epsilon used for double comparison.
......
......@@ -662,7 +662,7 @@ public class ModelToGPML {
groups.append(" <Group"
+ " GroupId=\"" + complex.getElementId() + "\""
+ " GraphId=\"" + complex.getElementId() + "\""
+ " TextLabel=\"" + complex.getName() + "\"");
+ " TextLabel=\"" + XmlParser.escapeXml(complex.getName()) + "\"");
if (complex.getComplex() != null) {
groups.append(" GroupRef=\"" + complex.getComplex().getElementId() + "\"");
}
......
......@@ -303,7 +303,7 @@ public class ModelToGPMLTest extends WikipathwaysTestFunctions {
protein.setHeight(10);
protein.setX(100 * speciesCounter);
protein.setY(10 + 100 * speciesCounter * Math.random());
protein.setZ(15);
protein.setZ(16);
protein.setNamePoint(protein.getCenter());
protein.setNameHorizontalAlign(HorizontalAlign.CENTER);
......@@ -477,6 +477,18 @@ public class ModelToGPMLTest extends WikipathwaysTestFunctions {
serializeOverGpml(model);
}
@Test
public void specialCharacterInNonEmptyComplexName() throws Exception {
Model model = createModel();
Complex complex = createComplex();
Protein protein = createProtein();
complex.addSpecies(protein);
model.addElement(complex);
model.addElement(protein);
serializeOverGpml(model);
}
private BindingRegion createBindingRegion(Protein p1) {
BindingRegion residue = new BindingRegion();
residue.setIdModificationResidue("mr" + speciesCounter++);
......
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