From: amwaterhouse Date: Thu, 7 Jul 2005 10:14:03 +0000 (+0000) Subject: Remove all gaps must check jSize X-Git-Tag: Release_2_01~21 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b59132cb08bb83359dd7fcb17c50a964d4b162c5;p=jalview.git Remove all gaps must check jSize --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index aeee116..3ab3132 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -397,13 +397,26 @@ public class AlignFrame return; } + SequenceGroup sg = viewport.getSelectionGroup(); + boolean allSequences = false; + if(sg.sequences.size()==viewport.alignment.getHeight()) + allSequences = true; + for (int i = 0; i < sg.sequences.size(); i++) { SequenceI seq = sg.getSequenceAt(i); int index = viewport.getAlignment().findIndex(seq); seq.deleteChars(sg.getStartRes(), sg.getEndRes() + 1); + // If the cut affects all sequences, remove highlighted columns + if (allSequences) + { + viewport.getColumnSelection().removeElements(sg.getStartRes(), + sg.getEndRes() + 1); + } + + if (seq.getSequence().length() < 1) { viewport.getAlignment().deleteSequence(seq); @@ -579,7 +592,7 @@ public class AlignFrame } j++; } - while(j < end); + while(j < end && j < jSize) ; } viewport.updateConservation(); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index d154e2e..2f7e5a8 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -680,6 +680,9 @@ public class AlignFrame extends GAlignFrame HistoryItem.HIDE)); SequenceGroup sg = viewport.getSelectionGroup(); + boolean allSequences = false; + if(sg.sequences.size()==viewport.alignment.getHeight()) + allSequences = true; for (int i = 0; i < sg.sequences.size(); i++) { @@ -687,6 +690,13 @@ public class AlignFrame extends GAlignFrame int index = viewport.getAlignment().findIndex(seq); seq.deleteChars(sg.getStartRes(), sg.getEndRes() + 1); + // If the cut affects all sequences, remove highlighted columns + if(allSequences) + { + viewport.getColumnSelection().removeElements(sg.getStartRes(), sg.getEndRes()+1); + } + + if (seq.getSequence().length() < 1) { seqsdeleted = true; @@ -936,7 +946,7 @@ public class AlignFrame extends GAlignFrame j++; } - while (j < end); + while (j < end && j < jSize); } viewport.updateConservation();