JAL-1250 Redundancy removal bug fix for Applet version
authorCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 28 Oct 2014 10:32:23 +0000 (10:32 +0000)
committerCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 28 Oct 2014 10:32:23 +0000 (10:32 +0000)
src/jalview/appletgui/RedundancyPanel.java
src/jalview/gui/RedundancyPanel.java

index 216f45d..1547862 100644 (file)
@@ -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);
index 693dc37..0e55cf8 100755 (executable)
@@ -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();