From b6c0570ea7dc3c805ead26348f849fe69daaf917 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 30 May 2005 11:04:29 +0000 Subject: [PATCH] modified history for redundancy removal. --- src/jalview/gui/RedundancyPanel.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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 -- 1.7.10.2