From 38ff6745cdbbebd2f0f6b5aedde3c815e664b7ad Mon Sep 17 00:00:00 2001 From: Charles Ofoegbu Date: Tue, 28 Oct 2014 10:32:23 +0000 Subject: [PATCH] JAL-1250 Redundancy removal bug fix for Applet version --- src/jalview/appletgui/RedundancyPanel.java | 4 ++-- src/jalview/gui/RedundancyPanel.java | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jalview/appletgui/RedundancyPanel.java b/src/jalview/appletgui/RedundancyPanel.java index 216f45d..1547862 100644 --- a/src/jalview/appletgui/RedundancyPanel.java +++ b/src/jalview/appletgui/RedundancyPanel.java @@ -213,8 +213,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable, ap.alignFrame.addHistoryItem(cut); PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true); - // ap.av.firePropertyChange("alignment", null, ap.av.getAlignment() - // .getSequences()); + ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); } } @@ -228,6 +227,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable, { ap.av.historyList.removeElement(command); ap.alignFrame.updateEditMenuBar(); + ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); } ap.paintAlignment(true); diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index 693dc37..0e55cf8 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -258,11 +258,15 @@ public class RedundancyPanel extends GSliderPanel implements Runnable */ public void undoButton_actionPerformed(ActionEvent e) { + if(historyList == null || historyList.isEmpty()){ + undoButton.setEnabled(false); + return; + } + CommandI command = (CommandI) historyList.pop(); - command.undoCommand(af.getViewAlignments()); - if (ap.av.historyList.contains(command)) { + command.undoCommand(af.getViewAlignments()); ap.av.historyList.remove(command); ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); af.updateEditMenuBar(); -- 1.7.10.2