X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=1116fe404ec5733ba508dbdae70a5513b3b29d4f;hb=bc39ee8df9694f820a8a8bd2430f527b87c07f31;hp=3e8018bfc44d155f5a50bb1d0d791d8c6904b898;hpb=aca26588a9857a2b71d7ca2450676521ca874eae;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 3e8018b..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 @@ -105,8 +105,8 @@ public class Jalview try { UIManager.setLookAndFeel( - UIManager.getSystemLookAndFeelClassName() - // UIManager.getCrossPlatformLookAndFeelClassName() + UIManager.getSystemLookAndFeelClassName() + // UIManager.getCrossPlatformLookAndFeelClassName() //"com.sun.java.swing.plaf.gtk.GTKLookAndFeel" //"javax.swing.plaf.metal.MetalLookAndFeel" //"com.sun.java.swing.plaf.windows.WindowsLookAndFeel" @@ -137,6 +137,7 @@ public class Jalview if(file!=null) { + System.out.println("Opening file: " + file); if (!file.startsWith("http://")) { @@ -150,31 +151,61 @@ 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) { - af.parseGroupsFile(data); + af.parseFeaturesFile(data, protocol); System.out.println("Added "+data); } data = aparser.getValue("features"); if (data != null) { - af.parseGroupsFile(data); + af.parseFeaturesFile(data, protocol); System.out.println("Added "+data); } @@ -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); - desktop.LoadFile(file, protocol, format); } + + fileLoader.LoadFile(file, protocol, format); + } } }