From 1da593c9a6e87837ebe95e22cb138c8a682ddab5 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 19 Jun 2009 09:53:27 +0000 Subject: [PATCH] intersect did not intersect (used in selection listener) --- src/jalview/datamodel/SequenceGroup.java | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index abc6d45..c0d8f5e 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -824,15 +824,22 @@ public class SequenceGroup public SequenceGroup intersect(AlignmentI alignment, Hashtable hashtable) { SequenceGroup sgroup = new SequenceGroup(this); - Enumeration en = getSequences(hashtable).elements(); - while (en.hasMoreElements()) - { - SequenceI elem = (SequenceI) en.nextElement(); - if (alignment.getSequences().contains(elem)) - { - sgroup.addSequence(elem, false); - } + SequenceI[] insect=getSequencesInOrder(alignment); + sgroup.sequences = new Vector(); + for (int s=0;insect!=null && s