Merge branch 'improvement/JAL-1350_makegroups_markedcolumns' into merge/JAL-845_JAL...
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 12 Feb 2015 17:05:17 +0000 (17:05 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 12 Feb 2015 17:05:17 +0000 (17:05 +0000)
Conflicts:
src/jalview/datamodel/SequenceGroup.java

1  2 
src/jalview/datamodel/ColumnSelection.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/datamodel/SequenceI.java

@@@ -159,10 -159,8 +159,7 @@@ public class SequenceGroup implements A
    {
      if (seqsel != null)
      {
-       for (SequenceI seq : seqsel.sequences)
-       {
-         sequences.addElement(seq);
-       }
 -      sequences = new ArrayList<SequenceI>();
+       sequences.addAll(seqsel.sequences);
        if (seqsel.groupName != null)
        {
          groupName = new String(seqsel.groupName);
    {
      SequenceGroup sgroup = new SequenceGroup(this);
      SequenceI[] insect = getSequencesInOrder(alignment);
-     sgroup.sequences = new Vector<SequenceI>();
-     if (insect != null)
+     sgroup.sequences = new ArrayList<SequenceI>();
+     for (int s = 0; insect != null && s < insect.length; s++)
      {
 -      if (map == null || map.containsKey(insect[s]))
 +      for (SequenceI seq : insect)
        {
 -        sgroup.sequences.add(insect[s]);
 +        if (map == null || map.containsKey(seq))
 +        {
-           sgroup.sequences.addElement(seq);
-         }
++          sgroup.sequences.add(insect[s]);
++      }
        }
      }
-     // Enumeration en =getSequences(hashtable).elements();
-     // while (en.hasMoreElements())
-     // {
-     // SequenceI elem = (SequenceI) en.nextElement();
-     // if (alignment.getSequences().contains(elem))
-     // {
-     // sgroup.addSequence(elem, false);
-     // }
-     // }
      return sgroup;
    }
  
Simple merge