X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalviewLite.java;h=09e87013484837b26038173afea1de51deac5861;hb=bc39ee8df9694f820a8a8bd2430f527b87c07f31;hp=199a843cb66245466bb2e7eea32288a72ef16f23;hpb=6a60c733dc23235562e32583e68284efa5d29ac9;p=jalview.git diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 199a843..09e8701 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.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 @@ -28,7 +28,6 @@ import java.applet.*; import java.awt.*; import java.awt.event.*; -import jalview.appletgui.TreePanel; /** @@ -47,7 +46,7 @@ public class JalviewLite extends Applet //The currentAlignFrame is static, it will change //if and when the user selects a new window - static AlignFrame currentAlignFrame; + public static AlignFrame currentAlignFrame; //This is the first frame to be displayed, and does not change AlignFrame initialAlignFrame; @@ -89,6 +88,20 @@ public class JalviewLite extends Applet file = getParameter("file"); + if(file==null) + { + //Maybe the sequences are added as parameters + StringBuffer data = new StringBuffer("PASTE"); + int i=1; + while( (file=getParameter("sequence"+i))!=null) + { + data.append(file.toString()+"\n"); + i++; + } + if(data.length()>5) + file = data.toString(); + } + final JalviewLite applet = this; if(getParameter("embedded")!=null && getParameter("embedded").equalsIgnoreCase("true")) @@ -262,7 +275,12 @@ public class JalviewLite extends Applet JalviewLite _applet) { file = _file; - if(inArchive(file)) + if(file.startsWith("PASTE")) + { + file = file.substring(5); + protocol = AppletFormatAdapter.PASTE; + } + else if(inArchive(file)) protocol = AppletFormatAdapter.CLASSLOADER; else { @@ -290,12 +308,18 @@ public class JalviewLite extends Applet file, embedded); + if(protocol==jalview.io.AppletFormatAdapter.PASTE) + currentAlignFrame.setTitle("Sequences from "+getDocumentBase()); + initialAlignFrame = currentAlignFrame; currentAlignFrame.statusBar.setText("Successfully loaded file " + file); - String treeFile = applet.getParameter("treeFile"); + String treeFile = applet.getParameter("tree"); + if(treeFile==null) + treeFile = applet.getParameter("treeFile"); + if (treeFile != null) { try @@ -329,7 +353,14 @@ public class JalviewLite extends Applet if( !inArchive(param) ) param = addProtocol( param ); - currentAlignFrame.parseFeaturesFile(param); + currentAlignFrame.parseFeaturesFile(param, protocol); + } + + param = getParameter("showFeatureSettings"); + if(param !=null && param.equalsIgnoreCase("true")) + { + currentAlignFrame.viewport.showSequenceFeatures(true); + currentAlignFrame.featureSettings_actionPerformed(); } param = getParameter("annotations"); @@ -338,11 +369,38 @@ public class JalviewLite extends Applet if( !inArchive(param) ) param = addProtocol( param ); - new AnnotationReader().readAnnotationFile( + new AnnotationFile().readAnnotationFile( currentAlignFrame.viewport.getAlignment(), param); currentAlignFrame.alignPanel.fontChanged(); + currentAlignFrame.alignPanel.setScrollValues(0,0); + + } + + param = getParameter("jnetfile"); + if (param != null) + { + try + { + if (inArchive(param)) + protocol = AppletFormatAdapter.CLASSLOADER; + else + { + protocol = AppletFormatAdapter.URL; + param = addProtocol(param); + } + + jalview.io.JPredFile predictions = new jalview.io.JPredFile( + param, protocol); + new JnetAnnotationMaker().add_annotation(predictions, + currentAlignFrame.viewport.getAlignment(), + 0,false); // do not add sequence profile from concise output + currentAlignFrame.alignPanel.fontChanged(); + currentAlignFrame.alignPanel.setScrollValues(0, 0); + } catch (Exception ex) { + ex.printStackTrace(); + } }