JAL-1503 update version in GPL header
[jalview.git] / src / jalview / gui / Desktop.java
index 7ca6338..a0e45a6 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -14,6 +14,7 @@
  * PURPOSE.  See the GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.gui;
 
@@ -806,6 +807,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    */
   public void drop(DropTargetDropEvent evt)
   {
+    boolean success=true;
     Transferable t = evt.getTransferable();
     java.util.List files = null;
     java.util.List protocols = null;
@@ -854,6 +856,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
       }
     } catch (Exception e)
     {
+      success=false;
     }
 
     if (files != null)
@@ -882,8 +885,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         }
       } catch (Exception ex)
       {
+        success=false;
       }
     }
+    evt.dropComplete(success); // need this to ensure input focus is properly transfered to any new windows created 
   }
 
   /**
@@ -913,7 +918,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
               .getSelectedFile().getParent());
 
       String format = null;
-      if (chooser.getSelectedFormat().equals("Jalview"))
+      if (chooser.getSelectedFormat()!=null && chooser.getSelectedFormat().equals("Jalview"))
       {
         format = "Jalview";
       }