Skip to content
Snippets Groups Projects
Commit f26e9a40 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '2192-feature-request-export-notes-of-elements-in-sbgn-ml' into...

Merge branch '2192-feature-request-export-notes-of-elements-in-sbgn-ml' into 2193-bug-in-sbgn-ml-export-of-compartments-no-compartmentorder-attribute
parents 59d1f63c bd543407
No related branches found
No related tags found
2 merge requests!1871Resolve "problem with websocket connection",!1855Resolve "bug in SBGN-ML export of compartments: no compartmentOrder attribute"
Pipeline #100560 failed
...@@ -40,19 +40,18 @@ import java.nio.file.Files; ...@@ -40,19 +40,18 @@ import java.nio.file.Files;
public class SbgnmlTestFunctions extends TestUtils { public class SbgnmlTestFunctions extends TestUtils {
protected static Logger logger = LogManager.getLogger(); protected static Logger logger = LogManager.getLogger();
private static int counter = 0;
private final Converter sbgnmlConverter = new SbgnmlXmlConverter();
@Rule @Rule
public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher(); public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher();
private static int counter = 0;
protected void showImage(final Model model) throws Exception { protected void showImage(final Model model) throws Exception {
String dir = Files.createTempDirectory("sbml-temp-images-dir").toFile().getAbsolutePath(); String dir = Files.createTempDirectory("sbml-temp-images-dir").toFile().getAbsolutePath();
AbstractImageGenerator.Params params = new AbstractImageGenerator.Params().height(model.getHeight()) AbstractImageGenerator.Params params = new AbstractImageGenerator.Params().height(model.getHeight())
.width(model.getWidth()).nested(true).scale(1).level(20).x(0).y(0).model(model); .width(model.getWidth()).nested(true).scale(1).level(20).x(0).y(0).model(model);
NormalImageGenerator nig = new PngImageGenerator(params); NormalImageGenerator nig = new PngImageGenerator(params);
String pathWithouExtension = dir + "/" + model.getName(); String pathWithoutExtension = dir + "/" + model.getName();
String pngFilePath = pathWithouExtension.concat(".png"); String pngFilePath = pathWithoutExtension.concat(".png");
nig.saveToFile(pngFilePath); nig.saveToFile(pngFilePath);
Desktop.getDesktop().open(new File(pngFilePath)); Desktop.getDesktop().open(new File(pngFilePath));
} }
...@@ -124,11 +123,9 @@ public class SbgnmlTestFunctions extends TestUtils { ...@@ -124,11 +123,9 @@ public class SbgnmlTestFunctions extends TestUtils {
return structuralState; return structuralState;
} }
private final Converter sbgnmlConverter = new SbgnmlXmlConverter();
protected Model serializeAndCleanOverSbgn(final Model model) throws InconsistentModelException, ConverterException, InvalidInputDataExecption { protected Model serializeAndCleanOverSbgn(final Model model) throws InconsistentModelException, ConverterException, InvalidInputDataExecption {
String sbgn = sbgnmlConverter.model2String(model); String sbgn = sbgnmlConverter.model2String(model);
// logger.debug(sbgn); // logger.debug(sbgn);
Model model2 = sbgnmlConverter.createModel( Model model2 = sbgnmlConverter.createModel(
new ConverterParams().inputStream(new ByteArrayInputStream(sbgn.getBytes(StandardCharsets.UTF_8)))); new ConverterParams().inputStream(new ByteArrayInputStream(sbgn.getBytes(StandardCharsets.UTF_8))));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment