Commit 8fd4cc98 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

create hierarchy when converting to images

parent 14b67122
Pipeline #27678 failed with stage
in 4 minutes and 28 seconds
......@@ -2,6 +2,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();
......
Supports Markdown
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