X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;fp=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;h=8fa14aefdf7d83617db41e83636e4104e2cb2d34;hb=a25f31a9140c9764baf76ec1c2ede98c1e3e52f9;hp=e5c7b4c225f82f13070858a812d249d0d31d8d9e;hpb=4b2be7cd8c14e67cc347609199e25c7f09fda988;p=jalview.git diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index e5c7b4c..8fa14ae 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1073,7 +1073,8 @@ public abstract class AlignmentViewport implements AlignViewportI, } /** - * Set the selection group for this window. + * Set the selection group for this window. Also sets the current alignment as + * the context for the group, if it does not already have one. * * @param sg * - group holding references to sequences in this alignment view @@ -1083,7 +1084,7 @@ public abstract class AlignmentViewport implements AlignViewportI, public void setSelectionGroup(SequenceGroup sg) { selectionGroup = sg; - if (sg != null) + if (sg != null && sg.getContext() == null) { sg.setContext(alignment); }