X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDesktop.java;h=259e69378b606da9cc2cec0d7fb0554afd49f2fc;hb=bafa881ff4b88ced2ca6917924fb9f0dc5133bf9;hp=04487e0e521e3ae363f360f87e2b7ec4fd761265;hpb=81af7e9323594eee02a906091f4e5dd2140d2514;p=jalview.git diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 04487e0..259e693 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -515,7 +515,7 @@ public class Desktop extends jalview.jbgui.GDesktop { final Desktop me = this; // Thread off the news reader, in case there are connection problems. - addDialogThread(new Runnable() + new Thread(new Runnable() { @Override public void run() @@ -526,13 +526,13 @@ public class Desktop extends jalview.jbgui.GDesktop showNews.setVisible(true); Cache.log.debug("Completed news thread."); } - }); + }).start(); } public void getIdentifiersOrgData() { // Thread off the identifiers fetcher - addDialogThread(new Runnable() + new Thread(new Runnable() { @Override public void run() @@ -549,7 +549,8 @@ public class Desktop extends jalview.jbgui.GDesktop + e.getMessage()); } } - }); + }).start(); + ; } @Override @@ -3297,6 +3298,21 @@ public class Desktop extends jalview.jbgui.GDesktop return groovyConsole; } + /** + * handles the payload of a drag and drop event. + * + * TODO refactor to desktop utilities class + * + * @param files + * - Data source strings extracted from the drop event + * @param protocols + * - protocol for each data source extracted from the drop event + * @param evt + * - the drop event + * @param t + * - the payload from the drop event + * @throws Exception + */ public static void transferFromDropTarget(List files, List protocols, DropTargetDropEvent evt, Transferable t) throws Exception @@ -3456,7 +3472,10 @@ public class Desktop extends jalview.jbgui.GDesktop // resolve any .lnk files in the file drop for (int f = 0; f < files.size(); f++) { - if (protocols.get(f).equals(DataSourceType.FILE) && files.get(f).toLowerCase().endsWith(".lnk") || files.get(f).toLowerCase().endsWith(".url")|| files.get(f).toLowerCase().endsWith(".site")) + String source = files.get(f).toLowerCase(); + if (protocols.get(f).equals(DataSourceType.FILE) + && (source.endsWith(".lnk") || source.endsWith(".url") + || source.endsWith(".site"))) { try { File lf = new File(files.get(f));