- final List<PhylogenyNode> nodes = phy.getNodesViaTaxonomyCode( tax_code );
- Color c = null;
- if ( ( nodes == null ) || nodes.isEmpty() ) {
- throw new IllegalArgumentException( "code " + tax_code + " is not found" );
- }
- if ( nodes.size() != 1 ) {
- throw new IllegalArgumentException( "code " + tax_code + " is not unique" );
- }
- PhylogenyNode n = nodes.get( 0 );
- while ( n != null ) {
- if ( n.getNodeData().isHasTaxonomy()
- && !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) ) {
- c = ForesterUtil.obtainColorDependingOnTaxonomyGroup( n.getNodeData().getTaxonomy()
- .getScientificName(), tax_code );
- }
- if ( ( c == null ) && !ForesterUtil.isEmpty( n.getName() ) ) {
- c = ForesterUtil.obtainColorDependingOnTaxonomyGroup( n.getName(), tax_code );
- }
- if ( c != null ) {
- break;
- }
- n = n.getParent();
- }
+ // final List<PhylogenyNode> nodes = phy.getNodesViaTaxonomyCode( tax_code );
+ // Color c = null;
+ // if ( ( nodes == null ) || nodes.isEmpty() ) {
+ // throw new IllegalArgumentException( "code " + tax_code + " is not found" );
+ // }
+ // if ( nodes.size() != 1 ) {
+ // throw new IllegalArgumentException( "code " + tax_code + " is not unique" );
+ // }
+ // PhylogenyNode n = nodes.get( 0 );
+ // while ( n != null ) {
+ // if ( n.getNodeData().isHasTaxonomy()
+ // && !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) ) {
+ // c = ForesterUtil.obtainColorDependingOnTaxonomyGroup( n.getNodeData().getTaxonomy()
+ // .getScientificName(), tax_code );
+ // }
+ // if ( ( c == null ) && !ForesterUtil.isEmpty( n.getName() ) ) {
+ // c = ForesterUtil.obtainColorDependingOnTaxonomyGroup( n.getName(), tax_code );
+ // }
+ // if ( c != null ) {
+ // break;
+ // }
+ // n = n.getParent();
+ // }
+ final String group = obtainTaxonomyGroup( tax_code, phy );
+ final Color c = ForesterUtil.obtainColorDependingOnTaxonomyGroup( group );