hideSequence hide all before recalc consensus
[jalview.git] / src / jalview / appletgui / APopupMenu.java
index 82477ea..76fec4f 100755 (executable)
@@ -620,25 +620,32 @@ public class APopupMenu
     SequenceGroup sg = ap.av.getSelectionGroup();\r
     if(sg==null || sg.getSize(false)<1)\r
     {\r
-      ap.av.hideSequence(seq);\r
+      ap.av.hideSequence(new SequenceI[]{seq});\r
       return;\r
     }\r
 \r
+    int gsize = sg.getSize(false);\r
+    SequenceI [] hseqs;\r
+\r
+    hseqs = new SequenceI[ representGroup ? gsize-1 : gsize ];\r
+\r
       int index = 0;\r
-      while(index < sg.getSize(false))\r
+      while(index < gsize)\r
       {\r
         if(representGroup && sg.getSequenceAt(index)!=seq)\r
         {\r
           seq.addHiddenSequence(sg.getSequenceAt(index));\r
-          ap.av.hideSequence(sg.getSequenceAt(index));\r
+          hseqs[index] = sg.getSequenceAt(index);\r
         }\r
         else if(!representGroup)\r
         {\r
-          ap.av.hideSequence(sg.getSequenceAt(index));\r
+          hseqs[index] = sg.getSequenceAt(index);\r
         }\r
         index ++;\r
       }\r
 \r
+      ap.av.hideSequence(hseqs);\r
+\r
       ap.av.setSelectionGroup(null);\r
     }\r
 \r