Only adds history item if size>0
authoramwaterhouse <Andrew Waterhouse>
Thu, 26 Oct 2006 13:09:47 +0000 (13:09 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 26 Oct 2006 13:09:47 +0000 (13:09 +0000)
src/jalview/gui/AlignFrame.java

index db9e75e..284989d 100755 (executable)
@@ -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