diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java index ed26df150ffc8caed0f30e5130f3693c1b618c57..8d39fb32d1cf5d5ca605739b4466e36dd97040ec 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java @@ -199,7 +199,9 @@ public abstract class Species extends Element { substanceUnitRawType = original.substanceUnitRawType; uniprots = original.getUniprots(); - structuralState = original.structuralState; + if (original.structuralState != null) { + setStructuralState(original.structuralState.copy()); + } // don't copy reaction nodes } diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/field/StructuralState.java b/model/src/main/java/lcsb/mapviewer/model/map/species/field/StructuralState.java index 6e292ef3c77f9046f31814c9eb66b70fdb49c7fe..bc8637150d99ba6c281a751d06579af299d2c57f 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/species/field/StructuralState.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/species/field/StructuralState.java @@ -8,11 +8,8 @@ import javax.persistence.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.hibernate.annotations.Cascade; -import org.hibernate.annotations.CascadeType; import org.hibernate.annotations.Type; -import lcsb.mapviewer.common.exception.NotImplementedException; import lcsb.mapviewer.model.map.species.Species; /** @@ -65,6 +62,9 @@ public class StructuralState implements Serializable { public StructuralState(StructuralState mr) { this.value = mr.getValue(); this.position = mr.position; + this.width = mr.getWidth(); + this.height = mr.getHeight(); + this.fontSize = mr.getFontSize(); } public Species getSpecies() { @@ -84,7 +84,7 @@ public class StructuralState implements Serializable { } public StructuralState copy() { - throw new NotImplementedException(); + return new StructuralState(this); } public String getValue() {