diff --git a/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java b/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java index 6978f949492188606de1ab858091de4d772ab996..c2edd349dc00bb0716e27c67d9e2900d791bf53d 100644 --- a/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java +++ b/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java @@ -26,13 +26,17 @@ import lcsb.mapviewer.model.map.model.Model; 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; import lcsb.mapviewer.model.map.reaction.Modifier; import lcsb.mapviewer.model.map.reaction.NodeOperator; import lcsb.mapviewer.model.map.reaction.Product; import lcsb.mapviewer.model.map.reaction.Reactant; import lcsb.mapviewer.model.map.reaction.Reaction; import lcsb.mapviewer.model.map.reaction.SplitOperator; +import lcsb.mapviewer.model.map.reaction.TruncationOperator; +import lcsb.mapviewer.model.map.reaction.type.DissociationReaction; import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction; +import lcsb.mapviewer.model.map.reaction.type.TruncationReaction; import lcsb.mapviewer.model.map.species.Complex; import lcsb.mapviewer.model.map.species.Element; import lcsb.mapviewer.model.map.species.Species; @@ -280,9 +284,15 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand { } private void modifyProducts(Reaction reaction, Point2D middle) { - SplitOperator operator = null; + NodeOperator operator = null; if (reaction.getProducts().size() > 1) { - operator = new SplitOperator(); + if (reaction instanceof DissociationReaction) { + operator = new DissociationOperator(); + } else if (reaction instanceof TruncationReaction) { + operator = new TruncationOperator(); + } else { + operator = new SplitOperator(); + } Point2D productPoint = reaction.getProducts().get(0).getElement().getCenter(); Point2D operatorPoint = getMiddlePoint(middle, productPoint); operator.setLine(new PolylineData(middle, operatorPoint));