X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fext%2Fedu%2Fucsf%2Frbvi%2Fstrucviz2%2FChimeraModel.java;h=7da7a485d08a8948281fd4e11e9ac0e454e81397;hb=86ce701110991d006f506c585e13128996a01477;hp=07005652d9107842af56ce4c00e18350606f06b1;hpb=364f1cf36d12a069be963ec0166c9170e8b6f365;p=jalview.git diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java index 0700565..7da7a48 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java @@ -145,6 +145,7 @@ public class ChimeraModel implements ChimeraStructuralObject * * @return ChimeraModel */ + @Override public ChimeraModel getChimeraModel() { return this; @@ -272,6 +273,7 @@ public class ChimeraModel implements ChimeraStructuralObject * * @return user data */ + @Override public Object getUserData() { return userData; @@ -283,6 +285,7 @@ public class ChimeraModel implements ChimeraStructuralObject * @param data * user data to associate with this model */ + @Override public void setUserData(Object data) { this.userData = data; @@ -293,6 +296,7 @@ public class ChimeraModel implements ChimeraStructuralObject * * @return the selected state */ + @Override public boolean isSelected() { return selected; @@ -304,6 +308,7 @@ public class ChimeraModel implements ChimeraStructuralObject * @param selected * a boolean to set the selected state to */ + @Override public void setSelected(boolean selected) { this.selected = selected; @@ -314,6 +319,7 @@ public class ChimeraModel implements ChimeraStructuralObject * * @return the chains in this model as a list */ + @Override public List getChildren() { return new ArrayList(chainMap.values()); @@ -414,6 +420,7 @@ public class ChimeraModel implements ChimeraStructuralObject /** * Checks if this model has selected children. */ + @Override public boolean hasSelectedChildren() { if (selected) @@ -458,10 +465,13 @@ public class ChimeraModel implements ChimeraStructuralObject /** * Return the Chimera specification for this model. */ + @Override public String toSpec() { if (subModelNumber == 0) + { return ("#" + modelNumber); + } return ("#" + modelNumber + "." + subModelNumber); } @@ -469,6 +479,7 @@ public class ChimeraModel implements ChimeraStructuralObject * Return a string representation for the model. Shorten if longer than 100 * characters. */ + @Override public String toString() { String modelName = ""; @@ -554,4 +565,27 @@ public class ChimeraModel implements ChimeraStructuralObject } return nodeName; } + + @Override + public boolean equals(Object otherChimeraModel) + { + if (!(otherChimeraModel instanceof ChimeraModel)) + { + return false; + } + ChimeraModel otherCM = ((ChimeraModel) otherChimeraModel); + return this.name.equals(otherCM.name) + && this.modelNumber == otherCM.modelNumber + && this.type == otherCM.type; + } + + @Override + public int hashCode() + { + int hashCode = 1; + hashCode = hashCode * 37 + this.name.hashCode(); + hashCode = hashCode * 37 + this.type.hashCode(); + hashCode = (hashCode * 37) + modelNumber; + return hashCode; + } }