Commit b7f30b21 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

celldesigner provides z-index when parsing

parent e1f924aa
......@@ -22,6 +22,7 @@ import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.Converter;
import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.InvalidInputDataExecption;
import lcsb.mapviewer.converter.ZIndexPopulator;
import lcsb.mapviewer.converter.annotation.XmlAnnotationParser;
import lcsb.mapviewer.converter.model.celldesigner.alias.AliasCollectionXmlParser;
import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
......@@ -236,6 +237,7 @@ public class CellDesignerXmlParser extends Converter {
model.setWidth(width);
model.setHeight(height);
}
new ZIndexPopulator().populateZIndex(model);
} catch (InvalidXmlSchemaException e) {
throw new InvalidInputDataExecption(e);
} catch (CellDesignerParserException e) {
......
......@@ -36,6 +36,7 @@ import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.InvalidInputDataExecption;
import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
import lcsb.mapviewer.model.graphics.PolylineData;
import lcsb.mapviewer.model.map.BioEntity;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.layout.graphics.Layer;
import lcsb.mapviewer.model.map.layout.graphics.LayerOval;
......@@ -82,6 +83,20 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
}
}
@Test
public void testZIndexAvailableForBioEntities() throws Exception {
try {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
for (BioEntity bioEntity : model.getBioEntities()) {
assertNotNull(bioEntity.getZ());
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testOpenFromFile() throws Exception {
try {
......@@ -1068,7 +1083,7 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
InputStream is = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
Model model2 = parser.createModel(new ConverterParams().inputStream(is));
assertEquals(0, modelComparator.compare(model, model2));
} catch (Exception e) {
......
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