From 0cc0607495a69fc52505ae2d306bfbf9137d54aa Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Jun 2005 09:34:31 +0000 Subject: [PATCH] remove gaps applies to selected area --- src/jalview/appletgui/AlignFrame.java | 30 +++++++++++++++++++++++++----- src/jalview/gui/AlignFrame.java | 23 +++++++++++++++++++---- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index b314854..bb4b58a 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -544,16 +544,32 @@ public class AlignFrame public void removeAllGapsMenuItem_actionPerformed(ActionEvent e) { - addHistoryItem(new HistoryItem("Remove Gaps", - viewport.alignment, + addHistoryItem(new HistoryItem("Remove Gaps", viewport.alignment, HistoryItem.HIDE)); + SequenceI current; int jSize; - for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++) + + Vector seqs=null; + + int start=0, end = viewport.alignment.getWidth(); + + if(viewport.getSelectionGroup()!=null) { - current = viewport.getAlignment().getSequenceAt(i); + seqs = viewport.getSelectionGroup().sequences; + start = viewport.getSelectionGroup().getStartRes(); + end = viewport.getSelectionGroup().getEndRes(); + } + else + seqs = viewport.alignment.getSequences(); + + for (int i = 0; i