From: cmzmasek@gmail.com Date: Fri, 1 Jul 2011 23:03:39 +0000 (+0000) Subject: Added method getCurrentPhylogeny( final String format ) written by Hervé Ménager X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=09d0269700d3108a10d8e349e37384a9cad551ea;p=jalview.git Added method getCurrentPhylogeny( final String format ) written by Hervé Ménager This is used for interaction with JavaScript --- diff --git a/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java b/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java index 7dbed25..de79c15 100644 --- a/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java +++ b/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java @@ -31,6 +31,8 @@ import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.data.SequenceRelation; import org.forester.util.ForesterUtil; +import org.forester.util.ForesterConstants; + // Use like this: // 10000 ) ) { + return new String(); + } + switch ( ForesterConstants.PhylogeneticTreeFormats.valueOf( format ) ) { + case NH: + return getMainPanel().getCurrentPhylogeny().toNewHampshire(); + case NHX: + return getMainPanel().getCurrentPhylogeny().toNewHampshireX(); + case NEXUS: + return getMainPanel().getCurrentPhylogeny().toNexus(); + case PHYLOXML: + return getMainPanel().getCurrentPhylogeny().toPhyloXML(-1); + default: + break; + } + return new String(); + } + + void buildFontSizeMenu() { _font_size_menu = MainFrame.createMenu( MainFrame.FONT_SIZE_MENU_LABEL, getConfiguration() ); _font_size_menu.add( _super_tiny_fonts_mi = new JMenuItem( "Super tiny fonts" ) ); diff --git a/forester/java/src/org/forester/util/ForesterConstants.java b/forester/java/src/org/forester/util/ForesterConstants.java index 7fd5c84..e7c05f2 100644 --- a/forester/java/src/org/forester/util/ForesterConstants.java +++ b/forester/java/src/org/forester/util/ForesterConstants.java @@ -36,4 +36,7 @@ public final class ForesterConstants { public final static String UTF8 = "UTF-8"; public final static String PHYLO_XML_REFERENCE = "Han MV and Zmasek CM (2009): \"phyloXML: XML for evolutionary biology and comparative genomics\", BMC Bioinformatics 10:356"; public final static boolean RELEASE = false; + public enum PhylogeneticTreeFormats {NH, NHX, NEXUS, PHYLOXML} } + +