JAL-3210 Barebones gradle/buildship/eclipse. See README
[jalview.git] / src / jalview / io / FileLoader.java
index 0d46e76..95f85e6 100755 (executable)
@@ -278,9 +278,9 @@ public class FileLoader implements Runnable
     Runtime rt = Runtime.getRuntime();
     try
     {
-      if (Desktop.getInstance() != null)
+      if (Desktop.instance != null)
       {
-        Desktop.getInstance().startLoading(file);
+        Desktop.instance.startLoading(file);
       }
       if (format == null)
       {
@@ -302,12 +302,12 @@ public class FileLoader implements Runnable
 
       if (format == null)
       {
-        Desktop.getInstance().stopLoading();
+        Desktop.instance.stopLoading();
         System.err.println("The input file \"" + file
                 + "\" has null or unidentifiable data content!");
         if (!Jalview.isHeadlessMode())
         {
-          JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+          JvOptionPane.showInternalMessageDialog(Desktop.desktop,
                   MessageManager.getString("label.couldnt_read_data")
                           + " in " + file + "\n"
                           + AppletFormatAdapter.getSupportedFormats(),
@@ -318,7 +318,7 @@ public class FileLoader implements Runnable
       }
       // TODO: cache any stream datasources as a temporary file (eg. PDBs
       // retrieved via URL)
-      if (Desktop.getDesktopPane() != null && Desktop.getDesktopPane().isShowMemoryUsage())
+      if (Desktop.desktop != null && Desktop.desktop.isShowMemoryUsage())
       {
         System.gc();
         memused = (rt.maxMemory() - rt.totalMemory() + rt.freeMemory()); // free
@@ -411,7 +411,7 @@ public class FileLoader implements Runnable
                 // register PDB entries with desktop's structure selection
                 // manager
                 StructureSelectionManager
-                        .getStructureSelectionManager(Desktop.getInstance())
+                        .getStructureSelectionManager(Desktop.instance)
                         .registerPDBEntry(pdbe);
               }
             }
@@ -500,23 +500,23 @@ public class FileLoader implements Runnable
         }
         else
         {
-          if (Desktop.getInstance() != null)
+          if (Desktop.instance != null)
           {
-            Desktop.getInstance().stopLoading();
+            Desktop.instance.stopLoading();
           }
 
           final String errorMessage = MessageManager.getString(
                   "label.couldnt_load_file") + " " + title + "\n" + error;
           // TODO: refactor FileLoader to be independent of Desktop / Applet GUI
           // bits ?
-          if (raiseGUI && Desktop.getDesktopPane() != null)
+          if (raiseGUI && Desktop.desktop != null)
           {
             javax.swing.SwingUtilities.invokeLater(new Runnable()
             {
               @Override
               public void run()
               {
-                JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+                JvOptionPane.showInternalMessageDialog(Desktop.desktop,
                         errorMessage,
                         MessageManager
                                 .getString("label.error_loading_file"),
@@ -544,7 +544,7 @@ public class FileLoader implements Runnable
           @Override
           public void run()
           {
-            JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+            JvOptionPane.showInternalMessageDialog(Desktop.desktop,
                     MessageManager.formatMessage(
                             "label.problems_opening_file", new String[]
                             { file }),
@@ -566,7 +566,7 @@ public class FileLoader implements Runnable
           @Override
           public void run()
           {
-            JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+            JvOptionPane.showInternalMessageDialog(Desktop.desktop,
                     MessageManager.formatMessage(
                             "warn.out_of_memory_loading_file", new String[]
                             { file }),
@@ -588,7 +588,7 @@ public class FileLoader implements Runnable
     // memory
     // after
     // load
-    if (Desktop.getDesktopPane() != null && Desktop.getDesktopPane().isShowMemoryUsage())
+    if (Desktop.desktop != null && Desktop.desktop.isShowMemoryUsage())
     {
       if (alignFrame != null)
       {
@@ -610,9 +610,9 @@ public class FileLoader implements Runnable
       }
     }
     // remove the visual delay indicator
-    if (Desktop.getInstance() != null)
+    if (Desktop.instance != null)
     {
-      Desktop.getInstance().stopLoading();
+      Desktop.instance.stopLoading();
     }
 
   }