Merge branch 'features/JAL-1469_svg-output-for-figure-export' into Release_2_8_2_Branch
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index d2670f4..5527f1e 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import jalview.analysis.AnnotationSorter;
 import jalview.api.AlignmentViewPanel;
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
@@ -734,8 +735,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
     }
   }
 
+  /**
+   * Repaint the alignment including the annotations and overview panels (if
+   * shown).
+   */
   public void paintAlignment(boolean updateOverview)
   {
+    final AnnotationSorter sorter = new AnnotationSorter(getAlignment(),
+            av.isShowAutocalculatedAbove());
+    sorter.sort(getAlignment()
+            .getAlignmentAnnotation(),
+            av.getSortAnnotationsBy());
     repaint();
 
     if (updateOverview)