From: Jim Procter Date: Thu, 12 Feb 2015 16:50:31 +0000 (+0000) Subject: JAL-1350 pass the columnselection rather then selected sequence strings if column... X-Git-Tag: Jalview_2_9~91 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=29475c148f5dcf99f0067b44a4ac4f9b07d734d5;p=jalview.git JAL-1350 pass the columnselection rather then selected sequence strings if column-selection exists. --- diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index 4d734c7..3b54641 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -79,14 +79,26 @@ public class AlignViewController implements AlignViewControllerI @Override public boolean makeGroupsFromSelection() { - - if (viewport.getSelectionGroup() != null) + SequenceGroup sg = viewport.getSelectionGroup(); + ColumnSelection cs = viewport.getColumnSelection(); + SequenceGroup[] gps = null; + if (sg != null + && (cs == null || cs.getSelected() == null || cs.size() == 0)) { - SequenceGroup[] gps = jalview.analysis.Grouping.makeGroupsFrom( + gps = jalview.analysis.Grouping.makeGroupsFrom( viewport.getSequenceSelection(), viewport.getAlignmentView(true).getSequenceStrings( viewport.getGapCharacter()), viewport.getAlignment() .getGroups()); + } else { + if (cs!=null) { + gps = jalview.analysis.Grouping.makeGroupsFromCols( + (sg == null) ? viewport.getAlignment().getSequencesArray() + : sg.getSequences().toArray(new SequenceI[0]), cs, + viewport.getAlignment().getGroups()); + } + } + if (gps!=null) { viewport.getAlignment().deleteAllGroups(); viewport.clearSequenceColours(); viewport.setSelectionGroup(null);