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

special case with modifying reaction line width

parent 94856fec
Pipeline #40067 canceled with stage
in 59 seconds
...@@ -286,11 +286,13 @@ public class ReactionConverter extends BioEntityConverter<Reaction> { ...@@ -286,11 +286,13 @@ public class ReactionConverter extends BioEntityConverter<Reaction> {
for (AbstractNode node : reaction.getNodes()) { for (AbstractNode node : reaction.getNodes()) {
oldData.add(new Pair<AbstractNode, PolylineData>(node, node.getLine())); oldData.add(new Pair<AbstractNode, PolylineData>(node, node.getLine()));
} }
PolylineData oldReactionData = reaction.getLine();
applyColorSchema(reaction, visualizedDataOverlaysColorSchemas.get(0)); applyColorSchema(reaction, visualizedDataOverlaysColorSchemas.get(0));
drawImpl(reaction, graphics, params); drawImpl(reaction, graphics, params);
for (Pair<AbstractNode, PolylineData> pair : oldData) { for (Pair<AbstractNode, PolylineData> pair : oldData) {
pair.getLeft().setLine(pair.getRight()); pair.getLeft().setLine(pair.getRight());
} }
reaction.setLine(oldReactionData);
} }
} else { } else {
int count = 0; int count = 0;
...@@ -306,11 +308,13 @@ public class ReactionConverter extends BioEntityConverter<Reaction> { ...@@ -306,11 +308,13 @@ public class ReactionConverter extends BioEntityConverter<Reaction> {
for (AbstractNode node : reaction.getNodes()) { for (AbstractNode node : reaction.getNodes()) {
oldData.add(new Pair<AbstractNode, PolylineData>(node, node.getLine())); oldData.add(new Pair<AbstractNode, PolylineData>(node, node.getLine()));
} }
PolylineData oldReactionData = reaction.getLine();
applyColorSchema(reaction, DEFAULT_COLOR_SCHEMA); applyColorSchema(reaction, DEFAULT_COLOR_SCHEMA);
drawImpl(reaction, graphics, params); drawImpl(reaction, graphics, params);
for (Pair<AbstractNode, PolylineData> pair : oldData) { for (Pair<AbstractNode, PolylineData> pair : oldData) {
pair.getLeft().setLine(pair.getRight()); pair.getLeft().setLine(pair.getRight());
} }
reaction.setLine(oldReactionData);
} }
} }
} }
......
...@@ -158,11 +158,11 @@ public class ReactionConverterTest extends GraphicsTestFunctions { ...@@ -158,11 +158,11 @@ public class ReactionConverterTest extends GraphicsTestFunctions {
ImageIO.write(bi, "PNG", outputStream); ImageIO.write(bi, "PNG", outputStream);
byte[] output2 = outputStream.toByteArray(); byte[] output2 = outputStream.toByteArray();
// FileUtils.writeByteArrayToFile(new File("tmp.png"), output1); // FileUtils.writeByteArrayToFile(new File("tmp.png"), output1);
// FileUtils.writeByteArrayToFile(new File("tmp2.png"), output2); // FileUtils.writeByteArrayToFile(new File("tmp2.png"), output2);
// Desktop.getDesktop().open(new File("tmp.png")); // Desktop.getDesktop().open(new File("tmp.png"));
// Desktop.getDesktop().open(new File("tmp2.png")); // Desktop.getDesktop().open(new File("tmp2.png"));
assertTrue(Arrays.equals(output1, output2)); assertTrue(Arrays.equals(output1, output2));
...@@ -185,6 +185,7 @@ public class ReactionConverterTest extends GraphicsTestFunctions { ...@@ -185,6 +185,7 @@ public class ReactionConverterTest extends GraphicsTestFunctions {
result.addProduct(product); result.addProduct(product);
result.addReactant(reactant); result.addReactant(reactant);
result.setLine(new PolylineData(new Point2D.Double(105, 90), new Point2D.Double(95, 90))); result.setLine(new PolylineData(new Point2D.Double(105, 90), new Point2D.Double(95, 90)));
result.getLine().setWidth(lineWidth);
return result; return result;
} }
......
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