// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
package org.forester.io.writers;
import org.forester.io.parsers.phyloxml.PhyloXmlMapping;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyNode;
-import org.forester.phylogeny.PhylogenyNodeI.NH_CONVERSION_SUPPORT_VALUE_STYLE;
+import org.forester.phylogeny.PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE;
import org.forester.phylogeny.data.PhylogenyDataUtil;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
import org.forester.phylogeny.iterators.PostOrderStackObject;
writer.flush();
writer.close();
}
-
- public void toPhyloXML( final Phylogeny phy,
- final int phyloxml_level,
- final File out_file ) throws IOException {
+
+ public void toPhyloXML( final Phylogeny phy, final int phyloxml_level, final File out_file ) throws IOException {
final Writer writer = new BufferedWriter( new PrintWriter( out_file ) );
toPhyloXML( writer, phy, phyloxml_level );
writer.flush();
}
if ( tree != null ) {
reset( writer, tree );
- boolean rerootable = true;
String unit = "";
String type = "";
- String rooted = "false";
- if ( tree.isRooted() ) {
- rooted = "true";
- }
- if ( !tree.isRerootable() ) {
- rerootable = false;
- }
if ( !ForesterUtil.isEmpty( tree.getDistanceUnit() ) ) {
unit = tree.getDistanceUnit();
}
if ( !ForesterUtil.isEmpty( tree.getType() ) ) {
type = tree.getType();
}
- if ( rerootable ) {
- PhylogenyDataUtil.appendOpen( writer,
- PhyloXmlMapping.PHYLOGENY,
- PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR,
- rooted,
- PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR,
- unit,
- PhyloXmlMapping.PHYLOGENY_TYPE_ATTR,
- type );
- }
- else {
- PhylogenyDataUtil.appendOpen( writer,
- PhyloXmlMapping.PHYLOGENY,
- PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR,
- rooted,
- PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR,
- unit,
- PhyloXmlMapping.PHYLOGENY_TYPE_ATTR,
- type,
- PhyloXmlMapping.PHYLOGENY_IS_REROOTABLE_ATTR,
- "false" );
- }
+ PhylogenyDataUtil.appendOpen( writer,
+ PhyloXmlMapping.PHYLOGENY,
+ PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR,
+ tree.isRooted() + "",
+ PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR,
+ unit,
+ PhyloXmlMapping.PHYLOGENY_TYPE_ATTR,
+ type,
+ PhyloXmlMapping.PHYLOGENY_IS_REROOTABLE_ATTR,
+ tree.isRerootable() + "" );
appendPhylogenyLevelPhyloXml( writer, tree );
while ( isHasNext() ) {
next();