import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.data.SequenceRelation;
import org.forester.util.ForesterUtil;
+import org.forester.util.ForesterConstants;
+
// Use like this:
// <applet archive="forester.jar"
repaint();
}
+ /**
+ * This method returns the current phylogeny as a string in the chosen format
+ *
+ * @param format must be NH, NHX, NEXUS or PHYLOXML
+ * @return the phylogeny string
+ * @author Hervé Ménager
+ */
+ public String getCurrentPhylogeny( final String format ) {
+ removeTextFrame();
+ if ( ( getMainPanel().getCurrentPhylogeny() == null ) || getMainPanel().getCurrentPhylogeny().isEmpty()
+ || ( getMainPanel().getCurrentPhylogeny().getNumberOfExternalNodes() > 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" ) );
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}
}
+
+