- final private void paintNodeData( final Graphics2D g,
- final PhylogenyNode node,
- final boolean to_graphics_file,
- final boolean to_pdf,
- final boolean is_in_found_nodes ) {
- if ( isNodeDataInvisible( node ) && !to_graphics_file && !to_pdf ) {
- return;
- }
- if ( getOptions().isShowBranchLengthValues()
- && ( ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR )
- || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED ) || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) )
- && ( !node.isRoot() ) && ( node.getDistanceToParent() != PhylogenyDataUtil.BRANCH_LENGTH_DEFAULT ) ) {
- paintBranchLength( g, node, to_pdf, to_graphics_file );
- }
- if ( !getControlPanel().isShowInternalData() && !node.isExternal() && !node.isCollapse() ) {
- 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( getTreeColorSet().getFoundColor() );
- }
- 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() );
- }
+ final private int paintNodeData( final Graphics2D g,
+ final PhylogenyNode node,
+ final boolean to_graphics_file,
+ final boolean to_pdf,
+ final boolean is_in_found_nodes ) {
+ if ( isNodeDataInvisible( node ) && !to_graphics_file && !to_pdf ) {
+ return 0;
+ }
+ if ( getControlPanel().isWriteBranchLengthValues()
+ && ( ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR )
+ || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED ) || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) )
+ && ( !node.isRoot() ) && ( node.getDistanceToParent() != PhylogenyDataUtil.BRANCH_LENGTH_DEFAULT ) ) {
+ paintBranchLength( g, node, to_pdf, to_graphics_file );
+ }
+ if ( !getControlPanel().isShowInternalData() && !node.isExternal() && !node.isCollapse() ) {
+ return 0;
+ }
+ _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 );