Commit 698356fd authored by Piotr Gawron's avatar Piotr Gawron
Browse files

center line for truncation reaction implemented

parent c4a61491
......@@ -676,6 +676,12 @@ public class ReactionFromXml {
operator.getLine().trimEnd(ReactionCellDesignerConverter.RECT_SIZE / 2 - 1);
result.addNode(operator);
PolylineData centerLine = new PolylineData();
centerLine.addPoint(reactant.getLine().getEndPoint());
centerLine.addPoint(operator.getLine().getEndPoint());
result.setLine(centerLine);
}
/**
......
......@@ -12,7 +12,8 @@ import java.io.ByteArrayInputStream;
import java.util.List;
import java.util.Set;
import org.apache.logging.log4j.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
......@@ -29,7 +30,6 @@ import lcsb.mapviewer.model.graphics.PolylineData;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelComparator;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
import lcsb.mapviewer.model.map.reaction.AbstractNode;
import lcsb.mapviewer.model.map.reaction.AndOperator;
import lcsb.mapviewer.model.map.reaction.AssociationOperator;
import lcsb.mapviewer.model.map.reaction.DissociationOperator;
......@@ -1242,7 +1242,7 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
assertEquals(reaction1.getClass(), reaction2.getClass());
} catch (Exception e) {
logger.error(e.getMessage(), e);
e.printStackTrace();
throw e;
}
}
......@@ -1353,7 +1353,7 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
List<Line2D> lines1 = reaction1.getLines();
List<Line2D> lines2 = reaction2.getLines();
for (int i = 0; i < lines1.size(); i++) {
assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
......
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