X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fcommands%2FRemoveGapColCommand.java;h=1e9b83299d897e7142c9008b49c84bc1851f8b41;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=d3aebdb9e2356778e9d122abbcafaa5e2571e9cb;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/jalview/commands/RemoveGapColCommand.java b/src/jalview/commands/RemoveGapColCommand.java index d3aebdb..1e9b832 100644 --- a/src/jalview/commands/RemoveGapColCommand.java +++ b/src/jalview/commands/RemoveGapColCommand.java @@ -1,7 +1,8 @@ package jalview.commands; - /* + +/* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,7 +21,8 @@ package jalview.commands; import jalview.datamodel.*; -public class RemoveGapColCommand extends EditCommand +public class RemoveGapColCommand + extends EditCommand { int columnsDeleted; public RemoveGapColCommand(String description, @@ -32,7 +34,7 @@ public class RemoveGapColCommand extends EditCommand int j, jSize = seqs.length; int startCol = -1, endCol = -1; - columnsDeleted=0; + columnsDeleted = 0; edits = new Edit[0]; @@ -48,7 +50,9 @@ public class RemoveGapColCommand extends EditCommand if (!jalview.util.Comparison.isGap(seqs[j].getCharAt(i))) { if (delete) + { endCol = i; + } delete = false; break; @@ -77,19 +81,18 @@ public class RemoveGapColCommand extends EditCommand if (delete && startCol > -1) { - //This is for empty columns at the - //end of the alignment + //This is for empty columns at the + //end of the alignment this.appendEdit(DELETE_GAP, seqs, - startCol - columnsDeleted, - end - startCol +1, - al, - false); + startCol - columnsDeleted, + end - startCol + 1, + al, + false); - columnsDeleted += (end - startCol +1); + columnsDeleted += (end - startCol + 1); } - performEdit(0); }