Cant save to a URL loaded Jar file
[jalview.git] / src / jalview / gui / AlignFrame.java
index 11570ed..be428fe 100755 (executable)
@@ -153,7 +153,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener
   {
      fileName = file;
      currentFileFormat = format;
-     reload.setEnabled(true);
+     if (!fileName.startsWith("http"))
+       reload.setEnabled(true);
   }
 
   void addKeyListener()
@@ -990,6 +991,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener
    */
   protected void redoMenuItem_actionPerformed(ActionEvent e)
   {
+    if(viewport.redoList.size()<1)
+      return;
+
     CommandI command = (CommandI) viewport.redoList.pop();
     viewport.historyList.push(command);
     command.doCommand();
@@ -1010,10 +1014,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener
     //For sequence removal and addition, we need to fire
    //the property change event FROM the viewport where the
    //original alignment was altered
+    AlignmentI al=null;
     if (command instanceof EditCommand)
     {
       EditCommand editCommand = (EditCommand) command;
-      AlignmentI al = editCommand.getAlignment();
+      al = editCommand.getAlignment();
       Vector comps = (Vector) PaintRefresher.components
           .get(viewport.getSequenceSetId());
 
@@ -1028,19 +1033,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener
           }
         }
       }
-      if (originalSource == null)
-      {
-        //The original view is closed, we must validate
-        //the current view against the closed view first
-        if (al != null)
-          PaintRefresher.validateSequences(al, viewport.alignment);
+    }
 
-        originalSource = viewport;
-      }
+    if (originalSource == null)
+    {
+      //The original view is closed, we must validate
+      //the current view against the closed view first
+      if (al != null)
+        PaintRefresher.validateSequences(al, viewport.alignment);
 
+      originalSource = viewport;
     }
 
-
     return originalSource;
   }
 
@@ -1474,7 +1478,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener
   protected void deleteGroups_actionPerformed(ActionEvent e)
   {
     viewport.alignment.deleteAllGroups();
-    viewport.sequenceColours.clear();
+    viewport.sequenceColours = null;
     viewport.setSelectionGroup(null);
     PaintRefresher.Refresh(this, viewport.getSequenceSetId());
     alignPanel.repaint();