JAL-966 promote getName to an api method
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index d2670f4..2398bda 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)
@@ -1493,11 +1503,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
     return av.getAlignment();
   }
 
-  /**
-   * get the name for this view
-   * 
-   * @return
-   */
+
+  @Override
   public String getViewName()
   {
     return av.viewName;