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

Merge branch...

Merge branch '1263-exported-to-gpml-in-pathvisio-reactions-are-displayed-not-adjacent' into 'master'

Resolve "exported to GPML, in pathvisio reactions are displayed not adjacent"

Closes #1263

See merge request !1161
parents b63ce6b8 ed20b798
Pipeline #27657 passed with stage
in 16 minutes and 56 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);
......
......@@ -139,37 +139,38 @@ public enum InteractionMapping {
Product.class, true),
/**
* Modification.
* Catalysis.
*/
MODIFICATION(GpmlInteractionType.MODIFICATION, GpmlLineType.SOLID,
CATALYSIS(GpmlInteractionType.CATALYSIS, GpmlLineType.SOLID,
PositiveInfluenceReaction.class, true,
Modulation.class, false,
Catalysis.class, false,
Product.class, true),
/**
* Modification dashed.
* Catalysis dashed.
*/
MODIFICATION_DASHED(GpmlInteractionType.MODIFICATION, GpmlLineType.DASHED,
UnknownPositiveInfluenceReaction.class, false,
Modulation.class, true,
CATALYSIS_DASHED(GpmlInteractionType.CATALYSIS, GpmlLineType.DASHED,
UnknownPositiveInfluenceReaction.class, true,
UnknownCatalysis.class, false,
Product.class, true),
/**
* Catalysis.
* Modification.
*/
CATALYSIS(GpmlInteractionType.CATALYSIS, GpmlLineType.SOLID,
MODIFICATION(GpmlInteractionType.MODIFICATION, GpmlLineType.SOLID,
PositiveInfluenceReaction.class, true,
Catalysis.class, false,
Modulation.class, false,
Product.class, true),
/**
* Catalysis dashed.
* Modification dashed.
*/
CATALYSIS_DASHED(GpmlInteractionType.CATALYSIS, GpmlLineType.DASHED,
UnknownPositiveInfluenceReaction.class, true,
UnknownCatalysis.class, false,
MODIFICATION_DASHED(GpmlInteractionType.MODIFICATION, GpmlLineType.DASHED,
UnknownPositiveInfluenceReaction.class, false,
Modulation.class, true,
Product.class, true),
/**
* Inhibition.
*/
......
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