Merge branch 'patch/JAL-4213_addref_with_selection' into develop
authorJames Procter <j.procter@dundee.ac.uk>
Wed, 5 Jul 2023 12:41:14 +0000 (13:41 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Wed, 5 Jul 2023 12:41:14 +0000 (13:41 +0100)
src/jalview/analysis/AlignmentUtils.java
src/jalview/gui/PopupMenu.java

index 1158c53..6ab49b2 100644 (file)
@@ -1512,7 +1512,7 @@ public class AlignmentUtils
    * @param alignment
    *          the alignment to add them to
    * @param selectionGroup
-   *          current selection group (or null if none)
+   *          current selection group - may be null, if provided then any added annotation will be trimmed to just those columns in the selection group
    */
   public static void addReferenceAnnotations(
           Map<SequenceI, List<AlignmentAnnotation>> annotations,
@@ -1536,7 +1536,7 @@ public class AlignmentUtils
    * @param seq
    * @param ann
    * @param selectionGroup
-   *          - may be null
+   *          current selection group - may be null, if provided then any added annotation will be trimmed to just those columns in the selection group
    * @return annotation added to {@code seq and {@code alignment}
    */
   public static AlignmentAnnotation addReferenceAnnotationTo(
index be9293f..88c1292 100644 (file)
@@ -1734,10 +1734,9 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
   protected void addReferenceAnnotations_actionPerformed(
           Map<SequenceI, List<AlignmentAnnotation>> candidates)
   {
-    final SequenceGroup selectionGroup = this.ap.av.getSelectionGroup();
     final AlignmentI alignment = this.ap.getAlignment();
     AlignmentUtils.addReferenceAnnotations(candidates, alignment,
-            selectionGroup);
+            null);
     refresh();
   }