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

replace end point because short segments are not properly visualized in pathvisio

parent a6f89f27
Pipeline #27650 passed with stage
in 20 minutes and 11 seconds
......@@ -2,6 +2,8 @@ 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: there is a bug in PathVisio that breaks short segments being the
end of catalist therefore short segments are removed from export (#1263)
-- Piotr Gawron <piotr.gawron@uni.lu> Tue, 2 Jun 2020 16:00:00 +0200
......
package lcsb.mapviewer.wikipathway.XML;
import java.awt.*;
import java.awt.Color;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.*;
import java.util.HashSet;
import java.util.Set;
......@@ -24,9 +26,7 @@ import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.reaction.*;
import lcsb.mapviewer.model.map.species.*;
import lcsb.mapviewer.model.map.species.field.*;
import lcsb.mapviewer.wikipathway.model.GpmlLineType;
import lcsb.mapviewer.wikipathway.model.InteractionMapping;
import lcsb.mapviewer.wikipathway.model.ShapeMapping;
import lcsb.mapviewer.wikipathway.model.*;
import lcsb.mapviewer.wikipathway.utils.Geo;
/**
......@@ -276,7 +276,7 @@ public class ModelToGPML {
if (dis2 > DIS_FOR_LINE) {
Point2D tmpPoint = Geo.closestPointOnPolyline(mainLine, pe);
if (tmpPoint != null) {
res.addPoint(tmpPoint);
res.setPoint(res.getPoints().size() - 1, tmpPoint);
}
}
} else if (rn instanceof Product) {
......@@ -710,10 +710,10 @@ public class ModelToGPML {
.getGpmlString();
String lineStyle = null;
if (reaction.getLine().getType()==LineType.DASHED) {
lineStyle = GpmlLineType.DASHED.getGpmlString();
if (reaction.getLine().getType() == LineType.DASHED) {
lineStyle = GpmlLineType.DASHED.getGpmlString();
}
StringBuilder anchors = new StringBuilder("");
StringBuilder tmp = new StringBuilder("");
......@@ -723,10 +723,10 @@ public class ModelToGPML {
+ "ConnectorType=\"Segmented\" "
+ "ZOrder=\"" + reaction.getZ() + "\" "
+ "Color=\"" + colorToString(reaction.getLine().getColor()) + "\" ");
if (lineStyle!=null) {
interactions.append( "LineStyle=\""+lineStyle+"\" ");
if (lineStyle != null) {
interactions.append("LineStyle=\"" + lineStyle + "\" ");
}
interactions.append( "LineThickness=\"" + reaction.getLine().getWidth() + "\">\n");
interactions.append("LineThickness=\"" + reaction.getLine().getWidth() + "\">\n");
/** Start and End **/
Reactant start = reaction.getReactants().get(0);
......
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