From: amwaterhouse Date: Mon, 14 Nov 2005 18:35:52 +0000 (+0000) Subject: Add getAlignment function X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5aca821095eac17ed013a04b66256d5db7df69b7;p=jalview.git Add getAlignment function --- diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 8f48385..4e4f943 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -45,6 +45,8 @@ public class JalviewLite extends Applet Button launcher = new Button("Start Jalview"); public static boolean AWT1 = false; + AlignFrame currentAlignFrame; + /** * init method for Jalview Applet @@ -162,6 +164,29 @@ public class JalviewLite extends Applet frame.setVisible(true); } + public String getAlignment(String format) + { + return getAlignment(format, "true"); + } + + public String getAlignment(String format, String suffix) + { + try + { + boolean seqlimits = suffix.equalsIgnoreCase("true"); + + String reply = new AppletFormatAdapter().formatSequences(format, + currentAlignFrame.viewport.getAlignment().getSequences(), + true, seqlimits); + return reply; + } + catch (Exception ex) + {ex.printStackTrace(); + return "Error retrieving alignment in " + format + " format. "; + + } + } + /** * This paints the background surrounding the "Launch Jalview button" *
@@ -210,12 +235,12 @@ public class JalviewLite extends Applet if ((sequences != null) && (sequences.length > 0)) { - AlignFrame af = new AlignFrame(new Alignment(sequences), + currentAlignFrame = new AlignFrame(new Alignment(sequences), applet, file); - af.statusBar.setText("Successfully loaded file " + file); + currentAlignFrame.statusBar.setText("Successfully loaded file " + file); if(featuresFile!=null) - af.parseFeaturesFile(featuresFile); + currentAlignFrame.parseFeaturesFile(featuresFile); } else {