Commit 70641c12 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1266-drawing-pathways-is-omitted-during-conversion-to-image' into 'master'

Resolve "drawing pathways is omitted during conversion to image"

Closes #1266

See merge request !1164
parents 631064e9 69fc0c44
Pipeline #27682 passed with stage
in 10 minutes and 41 seconds
......@@ -4,6 +4,7 @@ minerva (15.0.0~beta.5) unstable; urgency=medium
* Bug fix: export to GPML uses proper arrow types (#1262)
* Bug fix: export to GPML uses dashed lines in reactions when possible
(#1262)
* Bug fix: pathways are visualized in image converter (#1266)
* Bug fix: there is a bug in PathVisio that breaks short segments being the
end of catalist therefore short segments are removed from export (#1263)
* Bug fix: conversion of file containing BOM did not work (#1264)
......
package lcsb.mapviewer.model.map.reaction;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import org.apache.commons.lang3.SerializationUtils;
......
package lcsb.mapviewer.model.map.reaction;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import org.apache.commons.lang3.SerializationUtils;
......
......@@ -17,8 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import lcsb.mapviewer.api.BaseRestImpl;
import lcsb.mapviewer.api.QueryException;
import lcsb.mapviewer.commands.CommandExecutionException;
import lcsb.mapviewer.commands.MergeCommand;
import lcsb.mapviewer.commands.*;
import lcsb.mapviewer.common.MinervaLoggerAppender;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.exception.InvalidStateException;
......@@ -26,6 +25,7 @@ import lcsb.mapviewer.converter.*;
import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.graphics.*;
import lcsb.mapviewer.model.map.InconsistentModelException;
import lcsb.mapviewer.model.map.layout.graphics.Layer;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.modelutils.map.LogFormatter;
......@@ -61,7 +61,18 @@ public class ConvertRestImpl extends BaseRestImpl {
Double targetWidth, Double targetHeight)
throws InvalidInputDataExecption, SBMLException, IOException, ConverterException, DrawingException,
QueryException {
Model model = getModelParserByNameOrClass(fromFormat).createModel(createConvertParams(input));
Model original = getModelParserByNameOrClass(fromFormat).createModel(createConvertParams(input));
Model model = new CopyCommand(original).execute();
try {
new CreateHierarchyCommand(model, 10, 1024).execute();
for (Layer layer : model.getLayers()) {
layer.setVisible(false);
}
} catch (Exception e) {
logger.error("Problem with creating pathways", e);
model = original;
}
AbstractImageGenerator generator = getImageGenerator(toFormat, createImageParams(model, targetWidth, targetHeight));
ByteArrayOutputStream os = new ByteArrayOutputStream();
......
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