X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FRedundancyPanel.java;h=0e55cf89f733d8dc081b57a6ad261a9a3e97208a;hb=9d139ca8d1af8f0f2d78193d418ae9e9168a3e8a;hp=1fcd87593e9088f14df8c87224739ca76af9c5ab;hpb=10b903bf6b22d53e8920091efb2145d6b6a677ba;p=jalview.git diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index 1fcd875..0e55cf8 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -245,8 +245,7 @@ public class RedundancyPanel extends GSliderPanel 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()); } } @@ -259,12 +258,17 @@ 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(); }