X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=1116fe404ec5733ba508dbdae70a5513b3b29d4f;hb=2d740577b9dda7b872d808e2419ca66e2ad0eb4b;hp=50faf67fad239e2113bf601ee2a2b509e6d2c94e;hpb=cd71fb9ef1a21678ad648ba13564b658b53ab834;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 50faf67..1116fe4 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -137,6 +137,7 @@ public class Jalview if(file!=null) { + System.out.println("Opening file: " + file); if (!file.startsWith("http://")) { @@ -150,20 +151,50 @@ public class Jalview protocol = "File"; - if (file.indexOf("http:") > -1) + if (file.indexOf("http:") > -1 || file.indexOf("file:") >-1) { protocol = "URL"; } + + if (file.endsWith(".jar")) format = "Jalview"; else format = new jalview.io.IdentifyFile().Identify(file, protocol); - System.out.println("Opening: " + format + " file " + file); + AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol, format); + if(af==null) + { + System.out.println("error"); + return; + } + + data = aparser.getValue("colour"); + if(data!=null) + { + data.replaceAll("%20", " "); + + jalview.schemes.ColourSchemeI cs = + jalview.schemes.ColourSchemeProperty.getColour(af.getViewport(). + getAlignment(), data); + + if(cs == null) + { + jalview.schemes.UserColourScheme ucs + = new jalview.schemes.UserColourScheme("white"); + ucs.parseAppletParameter(data); + cs = ucs; + } + + System.out.println("colour is " + data); + af.changeColour( cs ); + } + + // Must maintain ability to use the groups flag data = aparser.getValue("groups"); if (data != null) @@ -228,9 +259,11 @@ public class Jalview } // We'll only open the default file if the desktop is visible. + // And the user ////////////////////// if ( !headless + && file==null && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true) ) { @@ -247,13 +280,15 @@ public class Jalview if (file.endsWith(".jar")) { - new Jalview2XML().LoadJalviewAlign(file); + format = "Jalview"; } else { format = new jalview.io.IdentifyFile().Identify(file, protocol); - new jalview.io.FileLoader().LoadFile(file, protocol, format); } + + fileLoader.LoadFile(file, protocol, format); + } } }