modified history for redundancy removal.
authorjprocter <Jim Procter>
Mon, 30 May 2005 11:04:29 +0000 (11:04 +0000)
committerjprocter <Jim Procter>
Mon, 30 May 2005 11:04:29 +0000 (11:04 +0000)
src/jalview/gui/RedundancyPanel.java

index f91f75d..5d266f8 100755 (executable)
@@ -37,9 +37,14 @@ public class RedundancyPanel
   {\r
     float threshold = slider.getValue();\r
     Vector del;\r
-    historyList.push(new HistoryItem("Remove redundancy (" + threshold + "%)",\r
+    HistoryItem it;\r
+    historyList.push(it=new HistoryItem("Remove redundancy",\r
                                       ap.av.alignment, HistoryItem.HIDE));\r
-\r
+    if (historyList.size()==1\r
+        || !af.historyList.contains(historyList.firstElement())) {\r
+      af.addHistoryItem((HistoryItem) historyList.firstElement());\r
+      af.updateEditMenuBar();\r
+    }\r
     undoButton.setEnabled(true);\r
     SequenceGroup sg = ap.av.getSelectionGroup();\r
     if (sg != null && sg.getSize() >= 1)\r
@@ -97,12 +102,18 @@ public class RedundancyPanel
 \r
   public void undoButton_actionPerformed(ActionEvent e)\r
   {\r
-    HistoryItem hi = (HistoryItem)historyList.pop();\r
+    HistoryItem hi = (HistoryItem) historyList.pop();\r
     af.restoreHistoryItem(hi);\r
-    if (historyList.size()==0)\r
+    if (historyList.size() == 0)\r
+    {\r
       undoButton.setEnabled(false);\r
+      if (af.historyList.contains(hi))\r
+      {\r
+        af.historyList.remove(hi);\r
+        af.updateEditMenuBar();\r
+      }\r
+    }\r
   }\r
-\r
   public void valueField_actionPerformed(ActionEvent e)\r
   {\r
     try\r