From 0abface2b7614a456e5c33191e14b7f611a4bbc0 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Fri, 25 Oct 2013 00:42:22 +0000 Subject: [PATCH] in progress --- .../applications/simple_node_processor.java | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/forester_applications/src/org/forester/applications/simple_node_processor.java b/forester_applications/src/org/forester/applications/simple_node_processor.java index 7b77a4f..c4bdfac 100644 --- a/forester_applications/src/org/forester/applications/simple_node_processor.java +++ b/forester_applications/src/org/forester/applications/simple_node_processor.java @@ -40,13 +40,12 @@ import org.forester.phylogeny.data.Taxonomy; import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory; import org.forester.phylogeny.factories.PhylogenyFactory; import org.forester.phylogeny.iterators.PhylogenyNodeIterator; +import org.forester.surfacing.SurfacingUtil; import org.forester.util.CommandLineArguments; import org.forester.util.ForesterUtil; public class simple_node_processor { - private final static String BASE = "b_"; - public static void main( final String args[] ) { File in = null; File out = null; @@ -67,7 +66,7 @@ public class simple_node_processor { int i = 0; while ( it.hasNext() ) { final PhylogenyNode node = it.next(); - processNode( node, i ); + processNode( node, i, phylogeny_0 ); i++; } final PhylogenyWriter writer = new PhylogenyWriter(); @@ -88,7 +87,7 @@ public class simple_node_processor { // } // } // } - private static void processNode( final PhylogenyNode node, final int i ) { + private static void processNode( final PhylogenyNode node, final int i, Phylogeny phy ) { //if ( node.isExternal() ) { // final String c = "" + node.getNodeData().getBinaryCharacters().getPresentCount(); // final String s = node.getNodeData().getTaxonomy().getScientificName(); @@ -108,12 +107,18 @@ public class simple_node_processor { // } // } if ( node.isExternal() ) { +// if ( node.getNodeData().isHasTaxonomy() ) { +// final Taxonomy t = node.getNodeData().getTaxonomy(); +// if ( !ForesterUtil.isEmpty( t.getTaxonomyCode() ) && ( t.getTaxonomyCode().length() == 5 ) ) { +// if ( node.getName().equalsIgnoreCase( t.getTaxonomyCode() ) ) { +// node.setName( "" ); +// } +// } +// } if ( node.getNodeData().isHasTaxonomy() ) { final Taxonomy t = node.getNodeData().getTaxonomy(); - if ( !ForesterUtil.isEmpty( t.getTaxonomyCode() ) && ( t.getTaxonomyCode().length() == 5 ) ) { - if ( node.getName().equalsIgnoreCase( t.getTaxonomyCode() ) ) { - node.setName( "" ); - } + if ( !ForesterUtil.isEmpty( t.getTaxonomyCode() ) ) { + SurfacingUtil.obtainHexColorStringDependingOnTaxonomyGroup( t.getTaxonomyCode(), phy ); } } } -- 1.7.10.2