X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceGroup.java;h=5e33229f6c87dc19bd2ab5db8fd8b08bed84d587;hb=5a352aa2f3330ae269d9b70c4a7374c2518bfb2e;hp=3bf7bc4168b4e676ef38b7c598170c404583bb87;hpb=bb6c9d30f57964136b759376b121f121f61c11e6;p=jalview.git diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 3bf7bc4..5e33229 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -108,7 +108,7 @@ public class SequenceGroup implements AnnotatedCollectionI private int startRes = 0; /** - * end column (base 0) + * end column (base 0) */ private int endRes = 0; @@ -214,7 +214,7 @@ public class SequenceGroup implements AnnotatedCollectionI displayBoxes = seqsel.displayBoxes; displayText = seqsel.displayText; colourText = seqsel.colourText; - + startRes = seqsel.startRes; endRes = seqsel.endRes; cs = new ResidueShader((ResidueShader) seqsel.cs); @@ -269,16 +269,16 @@ public class SequenceGroup implements AnnotatedCollectionI for (int i = 0, ipos = 0; i < inorder.length; i++) { SequenceI seq = inorder[i]; - - seqs[ipos] = seq.getSubSequence(startRes, endRes + 1); - if (seqs[ipos] != null) + SequenceI seqipos = seqs[ipos] = seq.getSubSequence(startRes, + endRes + 1); + if (seqipos != null) { - seqs[ipos].setDescription(seq.getDescription()); - seqs[ipos].setDBRefs(seq.getDBRefs()); - seqs[ipos].setSequenceFeatures(seq.getSequenceFeatures()); + seqipos.setDescription(seq.getDescription()); + seqipos.setDBRefs(seq.getDBRefs()); + seqipos.setSequenceFeatures(seq.getSequenceFeatures()); if (seq.getDatasetSequence() != null) { - seqs[ipos].setDatasetSequence(seq.getDatasetSequence()); + seqipos.setDatasetSequence(seq.getDatasetSequence()); } if (seq.getAnnotation() != null) @@ -292,7 +292,7 @@ public class SequenceGroup implements AnnotatedCollectionI if (alann != null) { boolean found = false; - for (int pos = 0; pos < alann.length; pos++) + for (int pos = 0, np = alann.length; pos < np; pos++) { if (alann[pos] == tocopy) { @@ -310,7 +310,7 @@ public class SequenceGroup implements AnnotatedCollectionI newannot.restrict(startRes, endRes); newannot.setSequenceRef(seqs[ipos]); newannot.adjustForAlignment(); - seqs[ipos].addAlignmentAnnotation(newannot); + seqipos.addAlignmentAnnotation(newannot); } } ipos++; @@ -774,10 +774,9 @@ public class SequenceGroup implements AnnotatedCollectionI public void setStartRes(int newStart) { int before = startRes; - startRes= Math.max(0,newStart); // sanity check for negative start column positions - changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, before, startRes); - - + startRes = Math.max(0, newStart); // sanity check for negative start column + // positions + changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, before, startRes); }