diff --git a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java index 567e40b0cfce92e2e42c6a3c64d2371290a829e1..36c3ad235ce382a8d2acbb03dd47e6dc008742ad 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java @@ -261,6 +261,10 @@ public class Reaction implements BioEntity { } + public Reaction(String reactionId) { + setIdReaction(reactionId); + } + /** * Adds node to the reaction. * diff --git a/model/src/main/java/lcsb/mapviewer/model/map/reaction/type/TransportReaction.java b/model/src/main/java/lcsb/mapviewer/model/map/reaction/type/TransportReaction.java index b55aaa188a6a8a327d428cc66566d777035a2b0c..4d107c09f92de61b1c36698215e6069ee0f87d6e 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/reaction/type/TransportReaction.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/reaction/type/TransportReaction.java @@ -18,51 +18,57 @@ import lcsb.mapviewer.model.map.reaction.Reaction; @DiscriminatorValue("TRANSPORT_REACTION") public class TransportReaction extends Reaction implements SimpleReactionInterface { - /** - * - */ - private static final long serialVersionUID = 1L; + /** + * + */ + private static final long serialVersionUID = 1L; - /** - * Default constructor. - */ - public TransportReaction() { - super(); - } + /** + * Default constructor. + */ + public TransportReaction() { + super(); + } - /** - * Constructor that copies data from the parameter given in the argument. - * - * @param result - * parent reaction from which we copy data - */ - public TransportReaction(Reaction result) { - super(result); - if (result.getProducts().size() < 1) { - throw new InvalidArgumentException("Reaction cannot be transformed to " + getStringType() + ": number of products must be greater than 0"); - } - if (result.getReactants().size() < 1) { - throw new InvalidArgumentException("Reaction cannot be transformed to " + getStringType() + ": number of reactants must be greater than 0"); - } - } + /** + * Constructor that copies data from the parameter given in the argument. + * + * @param result + * parent reaction from which we copy data + */ + public TransportReaction(Reaction result) { + super(result); + if (result.getProducts().size() < 1) { + throw new InvalidArgumentException( + "Reaction cannot be transformed to " + getStringType() + ": number of products must be greater than 0"); + } + if (result.getReactants().size() < 1) { + throw new InvalidArgumentException( + "Reaction cannot be transformed to " + getStringType() + ": number of reactants must be greater than 0"); + } + } - @Override - public String getStringType() { - return "Transport"; - } + public TransportReaction(String reactionId) { + super(reactionId); + } - @Override - public ReactionRect getReactionRect() { - return ReactionRect.RECT_EMPTY; - } + @Override + public String getStringType() { + return "Transport"; + } - @Override - public TransportReaction copy() { - if (this.getClass() == TransportReaction.class) { - return new TransportReaction(this); - } else { - throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass()); - } - } + @Override + public ReactionRect getReactionRect() { + return ReactionRect.RECT_EMPTY; + } + + @Override + public TransportReaction copy() { + if (this.getClass() == TransportReaction.class) { + return new TransportReaction(this); + } else { + throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass()); + } + } }