JAL-2578 Moved hidden columns reveal to before selection adjustment bug/JAL-2578
authorkiramt <k.mourao@dundee.ac.uk>
Fri, 2 Jun 2017 08:59:22 +0000 (09:59 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Fri, 2 Jun 2017 08:59:22 +0000 (09:59 +0100)
src/jalview/gui/AnnotationColumnChooser.java

index 96299e7..7dafa7d 100644 (file)
@@ -113,7 +113,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements
     setOldHiddenColumns(av.getAlignment().getHiddenColumns());
     adjusting = true;
 
-    setAnnotations(new JComboBox<String>(getAnnotationItems(false)));
+    setAnnotations(new JComboBox<>(getAnnotationItems(false)));
     populateThresholdComboBox(threshold);
     AnnotationColumnChooser lastChooser = av
             .getAnnotationColumnSelectionState();
@@ -394,10 +394,13 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements
       }
     }
 
+    // show hidden columns here, before changing the column selection in
+    // filterAnnotations, because showing hidden columns has the side effect of
+    // adding them to the selection
+    av.showAllHiddenColumns();
     av.getColumnSelection().filterAnnotations(
             getCurrentAnnotation().annotations, filterParams);
 
-    av.showAllHiddenColumns();
     if (getActionOption() == ACTION_OPTION_HIDE)
     {
       av.hideSelectedColumns();