From 09d0269700d3108a10d8e349e37384a9cad551ea Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Fri, 1 Jul 2011 23:03:39 +0000 Subject: [PATCH] =?utf8?q?Added=20method=20getCurrentPhylogeny(=20final=20St?= =?utf8?q?ring=20format=20)=20written=20by=20Herv=C3=A9=20M=C3=A9nager=20Thi?= =?utf8?q?s=20is=20used=20for=20interaction=20with=20JavaScript?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../org/forester/archaeopteryx/ArchaeopteryxE.java | 31 ++++++++++++++++++++ .../src/org/forester/util/ForesterConstants.java | 3 ++ 2 files changed, 34 insertions(+) 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} } + + -- 1.7.10.2