- return;
- }
- _sb.setLength( 0 );
- int x = 0;
- final int half_box_size = getOptions().getDefaultNodeShapeSize() / 2;
- if ( getControlPanel().isShowTaxonomyImages()
- && ( getImageMap() != null )
- && !getImageMap().isEmpty()
- && node.getNodeData().isHasTaxonomy()
- && ( ( node.getNodeData().getTaxonomy().getUris() != null ) && !node.getNodeData().getTaxonomy()
- .getUris().isEmpty() ) ) {
- x += drawTaxonomyImage( node.getXcoord() + 2 + half_box_size, node.getYcoord(), node, g );
- }
- if ( ( getControlPanel().isShowTaxonomyCode() || getControlPanel().isShowTaxonomyScientificNames() || getControlPanel()
- .isShowTaxonomyCommonNames() ) && node.getNodeData().isHasTaxonomy() ) {
- x += paintTaxonomy( g, node, is_in_found_nodes, to_pdf, to_graphics_file, x );
- }
- if ( ( to_pdf || to_graphics_file ) && getOptions().isPrintBlackAndWhite() ) {
- g.setColor( Color.BLACK );
- }
- else if ( is_in_found_nodes ) {
- g.setColor( getColorForFoundNode( node ) );
- }
- else if ( getControlPanel().isColorAccordingToTaxonomy() ) {
- g.setColor( getTaxonomyBasedColor( node ) );
- }
- else if ( getControlPanel().isColorAccordingToAnnotation()
- && ( node.getNodeData().isHasSequence() && ( node.getNodeData().getSequence().getAnnotations() != null ) && ( !node
- .getNodeData().getSequence().getAnnotations().isEmpty() ) ) ) {
- g.setColor( calculateColorForAnnotation( node.getNodeData().getSequence().getAnnotations() ) );
- }
- else if ( getOptions().isColorLabelsSameAsParentBranch() && getControlPanel().isColorBranches()
- && ( PhylogenyMethods.getBranchColorValue( node ) != null ) ) {
- g.setColor( PhylogenyMethods.getBranchColorValue( node ) );
- }
- else if ( to_pdf ) {
- g.setColor( Color.BLACK );
- }
- else {
- g.setColor( getTreeColorSet().getSequenceColor() );
- }
- if ( node.isCollapse() && ( ( !node.isRoot() && !node.getParent().isCollapse() ) || node.isRoot() ) ) {
- if ( _sb.length() > 0 ) {
- _sb.setLength( 0 );
- _sb.append( "(" );
- _sb.append( node.getAllExternalDescendants().size() );
- _sb.append( ")" );
- }
- }
- else {
- _sb.setLength( 0 );
- }
- if ( getControlPanel().isShowNodeNames() && ( node.getName().length() > 0 ) ) {
- 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() );
- }