X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFileLoader.java;h=3d2ddedfee15fb8180f4a3c86671fa088c831fe0;hb=45bf1ca88efba1a6510947bbad6667a210ccd752;hp=390e8cd3360f9dee5856d82c0e53a1472a8104d5;hpb=fab0afc9e1e7a5ca460f0cbd48545536f989a435;p=jalview.git diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 390e8cd..3d2dded 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -20,6 +20,13 @@ */ 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; } @@ -338,7 +333,8 @@ public class FileLoader implements Runnable "IMPLEMENTATION ERROR: Cannot read consecutive Jalview XML projects from a stream."); // We read the data anyway - it might make sense. } - alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(file); + // BH 2018 switch to File object here instead of filename + alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(selectedFile == null ? file : selectedFile); } else { @@ -420,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 { @@ -490,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) { @@ -639,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)); - } - }