+ private final void nodeDataAsSB( final PhylogenyNode node, final StringBuilder sb ) {
+ if ( node != null ) {
+ if ( getControlPanel().isShowNodeNames() && ( !ForesterUtil.isEmpty( node.getName() ) ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getName() );
+ }
+ if ( node.getNodeData().isHasSequence() ) {
+ if ( getControlPanel().isShowSeqSymbols()
+ && ( node.getNodeData().getSequence().getSymbol().length() > 0 ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getNodeData().getSequence().getSymbol() );
+ }
+ if ( getControlPanel().isShowGeneNames()
+ && ( node.getNodeData().getSequence().getGeneName().length() > 0 ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getNodeData().getSequence().getGeneName() );
+ }
+ if ( getControlPanel().isShowSeqNames() && ( node.getNodeData().getSequence().getName().length() > 0 ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getNodeData().getSequence().getName() );
+ }
+ if ( getControlPanel().isShowSequenceAcc()
+ && ( node.getNodeData().getSequence().getAccession() != null ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ if ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getSource() ) ) {
+ sb.append( node.getNodeData().getSequence().getAccession().getSource() );
+ sb.append( ":" );
+ }
+ sb.append( node.getNodeData().getSequence().getAccession().getValue() );
+ }
+ }
+ if ( getControlPanel().isShowProperties() && node.getNodeData().isHasProperties() ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( propertiesToString( node ) );
+ }
+ }
+ }
+
+ private final void nodeTaxonomyDataAsSB( final Taxonomy taxonomy, final StringBuilder sb ) {
+ if ( _control_panel.isShowTaxonomyCode() && !ForesterUtil.isEmpty( taxonomy.getTaxonomyCode() ) ) {
+ sb.append( taxonomy.getTaxonomyCode() );
+ sb.append( " " );
+ }
+ if ( _control_panel.isShowTaxonomyScientificNames() && _control_panel.isShowTaxonomyCommonNames() ) {
+ if ( !ForesterUtil.isEmpty( taxonomy.getScientificName() )
+ && !ForesterUtil.isEmpty( taxonomy.getCommonName() ) ) {
+ if ( getOptions().isAbbreviateScientificTaxonNames()
+ && ( taxonomy.getScientificName().indexOf( ' ' ) > 0 ) ) {
+ abbreviateScientificName( taxonomy.getScientificName(), sb );
+ }
+ else {
+ sb.append( taxonomy.getScientificName() );
+ }
+ sb.append( " (" );
+ sb.append( taxonomy.getCommonName() );
+ sb.append( ") " );
+ }
+ else if ( !ForesterUtil.isEmpty( taxonomy.getScientificName() ) ) {
+ if ( getOptions().isAbbreviateScientificTaxonNames()
+ && ( taxonomy.getScientificName().indexOf( ' ' ) > 0 ) ) {
+ abbreviateScientificName( taxonomy.getScientificName(), sb );
+ }
+ else {
+ sb.append( taxonomy.getScientificName() );
+ }
+ sb.append( " " );
+ }
+ else if ( !ForesterUtil.isEmpty( taxonomy.getCommonName() ) ) {
+ sb.append( taxonomy.getCommonName() );
+ sb.append( " " );
+ }
+ }
+ else if ( _control_panel.isShowTaxonomyScientificNames() ) {
+ if ( !ForesterUtil.isEmpty( taxonomy.getScientificName() ) ) {
+ if ( getOptions().isAbbreviateScientificTaxonNames()
+ && ( taxonomy.getScientificName().indexOf( ' ' ) > 0 ) ) {
+ abbreviateScientificName( taxonomy.getScientificName(), sb );
+ }
+ else {
+ sb.append( taxonomy.getScientificName() );
+ }
+ sb.append( " " );
+ }
+ }
+ else if ( _control_panel.isShowTaxonomyCommonNames() ) {
+ if ( !ForesterUtil.isEmpty( taxonomy.getCommonName() ) ) {
+ sb.append( taxonomy.getCommonName() );
+ sb.append( " " );
+ }
+ }
+ }
+