From: jprocter Date: Mon, 30 May 2005 11:04:29 +0000 (+0000) Subject: modified history for redundancy removal. X-Git-Tag: Release_2_0~136 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b6c0570ea7dc3c805ead26348f849fe69daaf917;p=jalview.git modified history for redundancy removal. --- diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index f91f75d..5d266f8 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -37,9 +37,14 @@ public class RedundancyPanel { float threshold = slider.getValue(); Vector del; - historyList.push(new HistoryItem("Remove redundancy (" + threshold + "%)", + HistoryItem it; + historyList.push(it=new HistoryItem("Remove redundancy", ap.av.alignment, HistoryItem.HIDE)); - + if (historyList.size()==1 + || !af.historyList.contains(historyList.firstElement())) { + af.addHistoryItem((HistoryItem) historyList.firstElement()); + af.updateEditMenuBar(); + } undoButton.setEnabled(true); SequenceGroup sg = ap.av.getSelectionGroup(); if (sg != null && sg.getSize() >= 1) @@ -97,12 +102,18 @@ public class RedundancyPanel public void undoButton_actionPerformed(ActionEvent e) { - HistoryItem hi = (HistoryItem)historyList.pop(); + HistoryItem hi = (HistoryItem) historyList.pop(); af.restoreHistoryItem(hi); - if (historyList.size()==0) + if (historyList.size() == 0) + { undoButton.setEnabled(false); + if (af.historyList.contains(hi)) + { + af.historyList.remove(hi); + af.updateEditMenuBar(); + } + } } - public void valueField_actionPerformed(ActionEvent e) { try