Merge branch 'develop' into update/JAL-3949_abstracted_logging_for_jalviewjs_and_sanity
[jalview.git] / src / jalview / io / FileLoader.java
index f244d14..3d2dded 100755 (executable)
  */
 package jalview.io;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import javax.swing.SwingUtilities;
+
 import jalview.api.ComplexAlignFile;
 import jalview.api.FeatureSettingsModelI;
 import jalview.api.FeaturesDisplayedI;
@@ -41,19 +48,6 @@ import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
 import jalview.ws.utils.UrlDownloadClient;
 
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.swing.SwingUtilities;
-
 public class FileLoader implements Runnable
 {
   String file;
@@ -214,6 +208,7 @@ public class FileLoader implements Runnable
   protected AlignFrame _LoadFileWaitTillLoaded()
   {
     this.run();
+
     return alignFrame;
   }
 
@@ -421,12 +416,9 @@ public class FileLoader implements Runnable
                   .getFeatureColourScheme();
           if (viewport != null)
           {
-            if (proxyColourScheme != null)
-            {
-              viewport.applyFeaturesStyle(proxyColourScheme);
-            }
             // append to existing alignment
             viewport.addAlignment(al, title);
+            viewport.applyFeaturesStyle(proxyColourScheme);
           }
           else
           {
@@ -491,7 +483,7 @@ public class FileLoader implements Runnable
 
             try
             {
-              alignFrame.setMaximum(jalview.bin.Cache
+              alignFrame.setMaximum(Cache
                       .getDefault("SHOW_FULLSCREEN", false));
             } catch (java.beans.PropertyVetoException ex)
             {
@@ -640,21 +632,4 @@ public class FileLoader implements Runnable
     return tempStructFile.toString();
   }
 
-  /**
-   * 
-   * @param file a File, or a String which is a name of a file
-   * @return
-   * @throws FileNotFoundException 
-   */
-  @SuppressWarnings("unused")
-  public static BufferedReader getBuffereReader(Object file) throws FileNotFoundException {
-    if (file instanceof String)
-      return new BufferedReader(new FileReader((String) file));
-    
-    byte[] bytes = /** @j2sNative file._bytes || */ null;
-    if (bytes != null)
-      return new BufferedReader(new InputStreamReader(new ByteArrayInputStream(bytes)));
-    return  new BufferedReader(new FileReader((File) file));
-  }
-
 }