JAL-1551 format and tidy
[jalview.git] / src / jalview / io / FileLoader.java
index 0673522..1d9655b 100755 (executable)
@@ -307,7 +307,7 @@ public class FileLoader implements Runnable
             error = format + "\n" + error;
           }
         }
-        
+
         if ((al != null) && (al.getHeight() > 0))
         {
           if (viewport != null)
@@ -319,22 +319,27 @@ public class FileLoader implements Runnable
             }
             viewport.firePropertyChange("alignment", null, viewport
                     .getAlignment().getSequences());
-
           }
           else
           {
             alignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
                     AlignFrame.DEFAULT_HEIGHT);
 
-            alignFrame.statusBar.setText(MessageManager.formatMessage("label.successfully_loaded_file", new String[]{title}));
+            alignFrame.statusBar.setText(MessageManager.formatMessage(
+                    "label.successfully_loaded_file", new String[]
+                    { title }));
 
             if (!protocol.equals(AppletFormatAdapter.PASTE))
+            {
               alignFrame.setFileName(file, format);
+            }
             if (raiseGUI)
             {
               // add the window to the GUI
-              // note - this actually should happen regardless of raiseGUI status in Jalview 3
-              // TODO: define 'virtual desktop' for benefit of headless scripts that perform queries to find the 'current working alignment'
+              // note - this actually should happen regardless of raiseGUI
+              // status in Jalview 3
+              // TODO: define 'virtual desktop' for benefit of headless scripts
+              // that perform queries to find the 'current working alignment'
               Desktop.addInternalFrame(alignFrame, title,
                       AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
             }
@@ -364,7 +369,8 @@ public class FileLoader implements Runnable
               public void run()
               {
                 JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                        errorMessage, MessageManager.getString("label.error_loading_file"),
+                        errorMessage, MessageManager
+                                .getString("label.error_loading_file"),
                         JOptionPane.WARNING_MESSAGE);
               }
             });
@@ -389,8 +395,10 @@ public class FileLoader implements Runnable
           public void run()
           {
             javax.swing.JOptionPane.showInternalMessageDialog(
-                    Desktop.desktop, MessageManager.formatMessage("label.problems_opening_file", new String[]{file}),
-                    MessageManager.getString("label.file_open_error"),
+                    Desktop.desktop, MessageManager.formatMessage(
+                            "label.problems_opening_file", new String[]
+                            { file }), MessageManager
+                            .getString("label.file_open_error"),
                     javax.swing.JOptionPane.WARNING_MESSAGE);
           }
         });
@@ -410,11 +418,8 @@ public class FileLoader implements Runnable
             javax.swing.JOptionPane
                     .showInternalMessageDialog(
                             Desktop.desktop,
-                            "Out of memory loading file "
-                                    + file
-                                    + "!!"
-                                    + "\nSee help files for increasing Java Virtual Machine memory.",
-                            "Out of memory",
+                            MessageManager.formatMessage("warn.out_of_memory_loading_file", new String[]{file}),
+                            MessageManager.getString("label.out_of_memory"),
                             javax.swing.JOptionPane.WARNING_MESSAGE);
           }
         });