Merge branch 'develop' into JAL-1483_featureBasedTreeCalc
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index cb97ea8..3fedb92 100644 (file)
@@ -1244,6 +1244,28 @@ public abstract class AlignmentViewport implements AlignViewportI
 
   }
 
+  @Override
+  public List<AlignmentAnnotation> getVisibleAlignmentAnnotation(boolean selectedOnly)
+  {
+    ArrayList<AlignmentAnnotation> ala = new ArrayList<AlignmentAnnotation>();
+    AlignmentAnnotation[] aa;
+    if ((aa=alignment.getAlignmentAnnotation())!=null)
+    {
+      for (AlignmentAnnotation annot:aa)
+      {
+        AlignmentAnnotation clone = new AlignmentAnnotation(annot);
+        if (selectedOnly && selectionGroup!=null)
+        {
+          colSel.makeVisibleAnnotation(selectionGroup.getStartRes(), selectionGroup.getEndRes(),clone);
+        } else {
+          colSel.makeVisibleAnnotation(clone);
+        }
+        ala.add(clone);
+      }
+    }
+    return ala;
+  }
+
   /**
    * @return the padGaps
    */