From f27df5aa83fc925caead09b59bb25c11c6d675c4 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 26 Oct 2006 13:09:47 +0000 Subject: [PATCH] Only adds history item if size>0 --- src/jalview/gui/AlignFrame.java | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index db9e75e..284989d 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -855,11 +855,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener public void addHistoryItem(CommandI command) { - historyList.push(command); - redoList.clear(); - updateEditMenuBar(); - - viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null; + if(command.getSize()>0) + { + historyList.push(command); + redoList.clear(); + updateEditMenuBar(); + viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null; + } } @@ -1477,6 +1479,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener viewport.selectionGroup); } + statusBar.setText("Removed "+trimRegion.getSize()+" columns."); + + addHistoryItem(trimRegion); Vector groups = viewport.alignment.getGroups(); @@ -1516,10 +1521,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener seqs = viewport.alignment.getSequencesArray(); - addHistoryItem(new RemoveGapColCommand("Remove Gapped Columns", - seqs, - start, end, - viewport.getGapCharacter())); + RemoveGapColCommand removeGapCols = + new RemoveGapColCommand("Remove Gapped Columns", + seqs, + start, end, + viewport.getGapCharacter()); + + addHistoryItem(removeGapCols); + + statusBar.setText("Removed "+removeGapCols.getSize()+" empty columns."); //This is to maintain viewport position on first residue //of first sequence -- 1.7.10.2