X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalviewLite.java;h=1fbb82ee5f6af3ccd1bacdb8c3086e5593adae3f;hb=d587f1aa61946dc14f6f089cf1dc2a3116cfb773;hp=68769761536f1f23e37a6545cdaa2f7b8a95db22;hpb=03c446f178b6a0b61ad33cb219398132d640fbef;p=jalview.git diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 6876976..1fbb82e 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,7 @@ import java.applet.*; import java.awt.*; import java.awt.event.*; -import jalview.appletgui.TreePanel; +import jalview.appletgui.FeatureSettings; /** @@ -47,7 +47,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 +89,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")) @@ -164,6 +178,8 @@ public class JalviewLite extends Applet { public void windowClosing(WindowEvent e) { + if(frame instanceof AlignFrame) + ((AlignFrame)frame).closeMenuItem_actionPerformed(); if(currentAlignFrame == frame) { currentAlignFrame = null; @@ -262,7 +278,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,13 +311,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 @@ -330,7 +356,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); + new FeatureSettings(currentAlignFrame.alignPanel); } param = getParameter("annotations"); @@ -339,7 +372,7 @@ public class JalviewLite extends Applet if( !inArchive(param) ) param = addProtocol( param ); - new AnnotationReader().readAnnotationFile( + new AnnotationFile().readAnnotationFile( currentAlignFrame.viewport.getAlignment(), param); @@ -348,6 +381,31 @@ public class JalviewLite extends Applet } + 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(); + } + } + String pdbfile = applet.getParameter("PDBFILE"); if(pdbfile!=null)