From: Charles Ofoegbu Date: Tue, 28 Oct 2014 10:32:23 +0000 (+0000) Subject: JAL-1250 Redundancy removal bug fix for Applet version X-Git-Tag: Jalview_2_9~155^2~14^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=38ff6745cdbbebd2f0f6b5aedde3c815e664b7ad;p=jalview.git JAL-1250 Redundancy removal bug fix for Applet version --- 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();