+ else {
+ final List<SequenceRelation> seqRelations = node.getNodeData().getSequence().getSequenceRelations();
+ for( final SequenceRelation seqRelation : seqRelations ) {
+ final boolean fGotRelationWithQuery = ( seqRelation.getRef0().isEqual( _query_sequence ) || seqRelation
+ .getRef1().isEqual( _query_sequence ) )
+ && seqRelation.getType().equals( getControlPanel().getSequenceRelationTypeBox()
+ .getSelectedItem() );
+ if ( fGotRelationWithQuery ) { // we will underline the text to show that this sequence is ortholog to the query
+ final double linePosX = node.getXcoord() + 2 + half_box_size;
+ final String sConfidence = ( !getControlPanel().isShowSequenceRelationConfidence() || ( seqRelation
+ .getConfidence() == null ) ) ? null : " (" + seqRelation.getConfidence().getValue()
+ + ")";
+ if ( sConfidence != null ) {
+ float confidenceX = pos_x;
+ if ( sb_str.length() > 0 ) {
+ confidenceX += new TextLayout( sb_str, g.getFont(), _frc ).getBounds().getWidth()
+ + CONFIDENCE_LEFT_MARGIN;
+ }
+ if ( confidenceX > linePosX ) { // let's only display confidence value if we are already displaying at least one of Prot/Gene Name and Taxonomy Code
+ final int confidenceWidth = ( int ) new TextLayout( sConfidence, g.getFont(), _frc )
+ .getBounds().getWidth();
+ TreePanel.drawString( sConfidence, confidenceX, pos_y, g );
+ x += CONFIDENCE_LEFT_MARGIN + confidenceWidth;
+ }
+ }
+ if ( ( x + nodeTextBoundsWidth ) > 0 ) /* we only underline if there is something displayed */
+ {
+ if ( nodeTextBoundsWidth == 0 ) {
+ nodeTextBoundsWidth -= 3; /* the gap between taxonomy code and node name should not be underlined if nothing comes after it */
+ }
+ else {
+ nodeTextBoundsWidth += 2;
+ }
+ g.drawLine( ( int ) linePosX + 1, 3 + ( int ) pos_y, ( int ) linePosX + x
+ + nodeTextBoundsWidth, 3 + ( int ) pos_y );
+ break;
+ }
+ }
+ }
+ }
+ }
+ if ( sb_str.length() > 0 ) {
+ TreePanel.drawString( sb_str, pos_x, pos_y, g );
+ }
+ // GUILHEM_END _____________
+ if ( _sb.length() > 0 ) {
+ if ( !using_visual_font && !is_in_found_nodes ) {
+ x += getFontMetricsForLargeDefaultFont().stringWidth( _sb.toString() ) + 5;
+ }
+ else {
+ x += getFontMetrics( g.getFont() ).stringWidth( _sb.toString() ) + 5;
+ }
+ }
+ if ( getControlPanel().isShowAnnotation() && node.getNodeData().isHasSequence()
+ && ( node.getNodeData().getSequence().getAnnotations() != null )
+ && ( !node.getNodeData().getSequence().getAnnotations().isEmpty() ) ) {
+ final SortedSet<Annotation> ann = node.getNodeData().getSequence().getAnnotations();
+ if ( ( to_pdf || to_graphics_file ) && getOptions().isPrintBlackAndWhite() ) {
+ g.setColor( Color.BLACK );
+ }
+ else if ( getControlPanel().isColorAccordingToAnnotation() ) {
+ g.setColor( calculateColorForAnnotation( ann ) );
+ }
+ final String ann_str = TreePanelUtil.createAnnotationString( ann, getOptions().isShowAnnotationRefSource() );
+ TreePanel.drawString( ann_str, node.getXcoord() + x + 3 + half_box_size, node.getYcoord()
+ + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ), g );
+ _sb.setLength( 0 );
+ _sb.append( ann_str );
+ if ( _sb.length() > 0 ) {
+ if ( !using_visual_font && !is_in_found_nodes ) {
+ x += getFontMetricsForLargeDefaultFont().stringWidth( _sb.toString() ) + 5;
+ }
+ else {
+ x += getFontMetrics( g.getFont() ).stringWidth( _sb.toString() ) + 5;
+ }
+ }
+ }
+ if ( ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR )
+ || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE )
+ || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED ) ) {
+ if ( ( getControlPanel().isShowBinaryCharacters() || getControlPanel().isShowBinaryCharacterCounts() )
+ && node.getNodeData().isHasBinaryCharacters() ) {
+ if ( ( to_pdf || to_graphics_file ) && getOptions().isPrintBlackAndWhite() ) {
+ g.setColor( Color.BLACK );
+ }
+ else {
+ g.setColor( getTreeColorSet().getBinaryDomainCombinationsColor() );
+ }
+ if ( getControlPanel().isShowBinaryCharacters() ) {
+ TreePanel.drawString( node.getNodeData().getBinaryCharacters().getPresentCharactersAsStringBuffer()
+ .toString(), node.getXcoord() + x + 1 + half_box_size, node.getYcoord()
+ + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ), g );
+ paintGainedAndLostCharacters( g, node, node.getNodeData().getBinaryCharacters()
+ .getGainedCharactersAsStringBuffer().toString(), node.getNodeData().getBinaryCharacters()
+ .getLostCharactersAsStringBuffer().toString() );
+ }
+ else {
+ TreePanel
+ .drawString( " " + node.getNodeData().getBinaryCharacters().getPresentCount(),
+ node.getXcoord() + x + 4 + half_box_size,
+ node.getYcoord()
+ + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ),
+ g );
+ paintGainedAndLostCharacters( g, node, "+"
+ + node.getNodeData().getBinaryCharacters().getGainedCount(), "-"
+ + node.getNodeData().getBinaryCharacters().getLostCount() );
+ }
+ }
+ }
+ return x;
+ }
+
+ final private void paintNodeDataUnrootedCirc( final Graphics2D g,
+ final PhylogenyNode node,
+ final boolean to_pdf,
+ final boolean to_graphics_file,
+ final boolean radial_labels,
+ final double ur_angle,
+ final boolean is_in_found_nodes ) {
+ if ( isNodeDataInvisibleUnrootedCirc( node ) && !to_graphics_file && !to_pdf ) {
+ return;
+ }
+ _sb.setLength( 0 );
+ _sb.append( " " );
+ if ( node.getNodeData().isHasTaxonomy()
+ && ( getControlPanel().isShowTaxonomyCode() || getControlPanel().isShowTaxonomyScientificNames() || getControlPanel()
+ .isShowTaxonomyCommonNames() ) ) {
+ final Taxonomy taxonomy = node.getNodeData().getTaxonomy();
+ 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() ) ) {
+ _sb.append( taxonomy.getScientificName() );
+ _sb.append( " (" );
+ _sb.append( taxonomy.getCommonName() );
+ _sb.append( ") " );
+ }
+ else if ( !ForesterUtil.isEmpty( taxonomy.getScientificName() ) ) {
+ _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() ) ) {
+ _sb.append( taxonomy.getScientificName() );
+ _sb.append( " " );
+ }
+ }
+ else if ( _control_panel.isShowTaxonomyCommonNames() ) {
+ if ( !ForesterUtil.isEmpty( taxonomy.getCommonName() ) ) {
+ _sb.append( taxonomy.getCommonName() );
+ _sb.append( " " );
+ }
+ }
+ }
+ if ( node.isCollapse() && ( ( !node.isRoot() && !node.getParent().isCollapse() ) || node.isRoot() ) ) {
+ _sb.append( " [" );
+ _sb.append( node.getAllExternalDescendants().size() );
+ _sb.append( "]" );
+ }
+ if ( getControlPanel().isShowNodeNames() && ( node.getName().length() > 0 ) ) {
+ if ( _sb.length() > 0 ) {
+ _sb.append( " " );
+ }
+ _sb.append( node.getName() );
+ }
+ if ( node.getNodeData().isHasSequence() ) {
+ 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().isShowSeqNames() && ( node.getNodeData().getSequence().getName().length() > 0 ) ) {
+ if ( _sb.length() > 0 ) {
+ _sb.append( " " );
+ }
+ _sb.append( node.getNodeData().getSequence().getName() );
+ }
+ }
+ //g.setFont( getTreeFontSet().getLargeFont() );
+ //if ( is_in_found_nodes ) {
+ // g.setFont( getTreeFontSet().getLargeFont().deriveFont( Font.BOLD ) );
+ // }
+ if ( _sb.length() > 1 ) {
+ setColor( g, node, to_graphics_file, to_pdf, is_in_found_nodes, getTreeColorSet().getSequenceColor() );
+ final boolean using_visual_font = setFont( g, node, is_in_found_nodes );
+ final String sb_str = _sb.toString();
+ double m = 0;
+ if ( _graphics_type == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) {
+ m = _urt_nodeid_angle_map.get( node.getId() ) % TWO_PI;
+ }
+ else {
+ m = ( float ) ( ur_angle % TWO_PI );
+ }
+ _at = g.getTransform();
+ boolean need_to_reset = false;
+ final float x_coord = node.getXcoord();
+ float y_coord;
+ if ( !using_visual_font ) {
+ y_coord = node.getYcoord() + ( getFontMetricsForLargeDefaultFont().getAscent() / 3.0f );
+ }
+ else {
+ y_coord = node.getYcoord() + ( getFontMetrics( g.getFont() ).getAscent() / 3.0f );
+ }
+ if ( radial_labels ) {
+ need_to_reset = true;
+ boolean left = false;
+ if ( ( m > HALF_PI ) && ( m < ONEHALF_PI ) ) {
+ m -= PI;
+ left = true;
+ }
+ g.rotate( m, x_coord, node.getYcoord() );
+ if ( left ) {
+ if ( !using_visual_font ) {
+ g.translate( -( getFontMetricsForLargeDefaultFont().getStringBounds( sb_str, g ).getWidth() ),
+ 0 );
+ }
+ else {
+ g.translate( -( getFontMetrics( g.getFont() ).getStringBounds( sb_str, g ).getWidth() ), 0 );
+ }
+ }
+ }
+ else {
+ if ( ( m > HALF_PI ) && ( m < ONEHALF_PI ) ) {
+ need_to_reset = true;
+ if ( !using_visual_font ) {
+ g.translate( -getFontMetricsForLargeDefaultFont().getStringBounds( sb_str, g ).getWidth(), 0 );
+ }
+ else {
+ g.translate( -getFontMetrics( g.getFont() ).getStringBounds( sb_str, g ).getWidth(), 0 );
+ }
+ }
+ }
+ TreePanel.drawString( sb_str, x_coord, y_coord, g );
+ if ( need_to_reset ) {
+ g.setTransform( _at );
+ }
+ }
+ }
+
+ final private void paintNodeLite( final Graphics2D g, final PhylogenyNode node ) {
+ if ( node.isCollapse() ) {
+ if ( !node.isRoot() && !node.getParent().isCollapse() ) {
+ paintCollapsedNode( g, node, false, false, false );
+ }
+ return;
+ }
+ if ( isInFoundNodes( node ) || isInCurrentExternalNodes( node ) ) {
+ g.setColor( getColorForFoundNode( node ) );
+ drawRectFilled( node.getXSecondary() - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, node.getYSecondary()
+ - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, OVERVIEW_FOUND_NODE_BOX_SIZE, OVERVIEW_FOUND_NODE_BOX_SIZE, g );
+ }
+ float new_x = 0;
+ if ( !node.isExternal() && !node.isCollapse() ) {
+ boolean first_child = true;
+ float y2 = 0.0f;
+ final int parent_max_branch_to_leaf = getMaxBranchesToLeaf( node );
+ for( int i = 0; i < node.getNumberOfDescendants(); ++i ) {
+ final PhylogenyNode child_node = node.getChildNode( i );
+ int factor_x;
+ if ( !isUniformBranchLengthsForCladogram() ) {
+ factor_x = node.getNumberOfExternalNodes() - child_node.getNumberOfExternalNodes();
+ }
+ else {
+ factor_x = parent_max_branch_to_leaf - getMaxBranchesToLeaf( child_node );
+ }
+ if ( first_child ) {
+ first_child = false;
+ y2 = node.getYSecondary()
+ - ( getOvYDistance() * ( node.getNumberOfExternalNodes() - child_node
+ .getNumberOfExternalNodes() ) );
+ }
+ else {
+ y2 += getOvYDistance() * child_node.getNumberOfExternalNodes();
+ }
+ final float x2 = calculateOvBranchLengthToParent( child_node, factor_x );
+ new_x = x2 + node.getXSecondary();
+ final float diff_y = node.getYSecondary() - y2;
+ final float diff_x = node.getXSecondary() - new_x;
+ if ( ( diff_y > 2 ) || ( diff_y < -2 ) || ( diff_x > 2 ) || ( diff_x < -2 ) ) {
+ paintBranchLite( g, node.getXSecondary(), new_x, node.getYSecondary(), y2, child_node );
+ }
+ child_node.setXSecondary( new_x );
+ child_node.setYSecondary( y2 );
+ y2 += getOvYDistance() * child_node.getNumberOfExternalNodes();
+ }
+ }
+ }
+
+ final private void paintNodeRectangular( final Graphics2D g,
+ final PhylogenyNode node,
+ final boolean to_pdf,
+ final boolean dynamically_hide,
+ final int dynamic_hiding_factor,
+ final boolean to_graphics_file,
+ final boolean disallow_shortcutting ) {
+ final boolean is_in_found_nodes = isInFoundNodes( node ) || isInCurrentExternalNodes( node );
+ if ( node.isCollapse() ) {
+ if ( ( !node.isRoot() && !node.getParent().isCollapse() ) ) {
+ paintCollapsedNode( g, node, to_graphics_file, to_pdf, is_in_found_nodes );
+ }
+ return;
+ }
+ if ( node.isExternal() ) {
+ ++_external_node_index;
+ }
+ // Confidence values
+ if ( getControlPanel().isShowConfidenceValues()
+ && !node.isExternal()
+ && !node.isRoot()
+ && ( ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED )
+ || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ) || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) )
+ && node.getBranchData().isHasConfidences() ) {
+ paintConfidenceValues( g, node, to_pdf, to_graphics_file );
+ }
+ // Draw a line to root:
+ if ( node.isRoot() && _phylogeny.isRooted() ) {
+ paintRootBranch( g, node.getXcoord(), node.getYcoord(), node, to_pdf, to_graphics_file );
+ }
+ float new_x = 0;
+ float new_x_min = Float.MAX_VALUE;
+ float min_dist = 1.5f;
+ if ( !disallow_shortcutting ) {
+ if ( dynamic_hiding_factor > 4000 ) {
+ min_dist = 4;
+ }
+ else if ( dynamic_hiding_factor > 1000 ) {
+ min_dist = 3;
+ }
+ else if ( dynamic_hiding_factor > 100 ) {
+ min_dist = 2;
+ }
+ }
+ if ( !node.isExternal() && !node.isCollapse() ) {
+ boolean first_child = true;
+ float y2 = 0.0f;
+ final int parent_max_branch_to_leaf = getMaxBranchesToLeaf( node );
+ for( int i = 0; i < node.getNumberOfDescendants(); ++i ) {
+ final PhylogenyNode child_node = node.getChildNode( i );
+ int factor_x;
+ if ( !isUniformBranchLengthsForCladogram() ) {
+ factor_x = node.getNumberOfExternalNodes() - child_node.getNumberOfExternalNodes();
+ }
+ else {
+ factor_x = parent_max_branch_to_leaf - getMaxBranchesToLeaf( child_node );
+ }
+ if ( first_child ) {
+ first_child = false;
+ y2 = node.getYcoord()
+ - ( _y_distance * ( node.getNumberOfExternalNodes() - child_node.getNumberOfExternalNodes() ) );
+ }
+ else {
+ y2 += _y_distance * child_node.getNumberOfExternalNodes();
+ }
+ final float x2 = calculateBranchLengthToParent( child_node, factor_x );
+ new_x = x2 + node.getXcoord();
+ if ( dynamically_hide && ( x2 < new_x_min ) ) {
+ new_x_min = x2;
+ }
+ final float diff_y = node.getYcoord() - y2;
+ final float diff_x = node.getXcoord() - new_x;
+ if ( disallow_shortcutting || ( diff_y > min_dist ) || ( diff_y < -min_dist ) || ( diff_x > min_dist )
+ || ( diff_x < -min_dist ) ) {
+ paintBranchRectangular( g,
+ node.getXcoord(),
+ new_x,
+ node.getYcoord(),
+ y2,
+ child_node,
+ to_pdf,
+ to_graphics_file );
+ }
+ child_node.setXcoord( new_x );
+ child_node.setYcoord( y2 );
+ y2 += _y_distance * child_node.getNumberOfExternalNodes();
+ }
+ paintNodeBox( node.getXcoord(), node.getYcoord(), node, g, to_pdf, to_graphics_file );
+ }
+ if ( getControlPanel().isShowMolSequences() && ( node.getNodeData().isHasSequence() )
+ && ( node.getNodeData().getSequence().isMolecularSequenceAligned() )
+ && ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) ) {
+ paintMolecularSequences( g, node, to_pdf );
+ }
+ if ( dynamically_hide
+ && !is_in_found_nodes
+ && ( ( node.isExternal() && ( ( _external_node_index % dynamic_hiding_factor ) != 1 ) ) || ( !node
+ .isExternal() && ( ( new_x_min < 20 ) || ( ( _y_distance * node.getNumberOfExternalNodes() ) < getFontMetricsForLargeDefaultFont()
+ .getHeight() ) ) ) ) ) {
+ return;
+ }
+ final int x = paintNodeData( g, node, to_graphics_file, to_pdf, is_in_found_nodes );
+ paintNodeWithRenderableData( x, g, node, to_graphics_file, to_pdf );
+ }
+
+ final private void paintNodeWithRenderableData( final int x,
+ final Graphics2D g,
+ final PhylogenyNode node,
+ final boolean to_graphics_file,
+ final boolean to_pdf ) {
+ if ( isNodeDataInvisible( node ) && !( to_graphics_file || to_pdf ) ) {
+ return;
+ }
+ if ( ( !getControlPanel().isShowInternalData() && !node.isExternal() ) ) {
+ return;
+ }
+ if ( getControlPanel().isShowDomainArchitectures() && node.getNodeData().isHasSequence()
+ && ( node.getNodeData().getSequence().getDomainArchitecture() != null )
+ && ( node.getNodeData().getSequence().getDomainArchitecture() instanceof RenderableDomainArchitecture ) ) {
+ RenderableDomainArchitecture rds = null;
+ try {
+ rds = ( RenderableDomainArchitecture ) node.getNodeData().getSequence().getDomainArchitecture();
+ }
+ catch ( final ClassCastException cce ) {
+ cce.printStackTrace();
+ }
+ if ( rds != null ) {
+ final int default_height = 7;
+ float y = getYdistance();
+ if ( getControlPanel().isDynamicallyHideData() ) {
+ y = getTreeFontSet().getFontMetricsLarge().getHeight();
+ }
+ final int h = y < default_height ? ForesterUtil.roundToInt( y ) : default_height;
+ rds.setRenderingHeight( h > 1 ? h : 2 );
+ if ( getControlPanel().isDrawPhylogram() ) {
+ if ( getOptions().isLineUpRendarableNodeData() ) {
+ if ( getOptions().isRightLineUpDomains() ) {
+ rds.render( ( float ) ( ( getMaxDistanceToRoot() * getXcorrectionFactor() )
+ + _length_of_longest_text + ( ( _longest_domain - rds.getTotalLength() ) * rds
+ .getRenderingFactorWidth() ) ), node.getYcoord() - ( h / 2.0f ), g, this, to_pdf );
+ }
+ else {
+ rds.render( ( float ) ( ( getMaxDistanceToRoot() * getXcorrectionFactor() ) + _length_of_longest_text ),
+ node.getYcoord() - ( h / 2.0f ),
+ g,
+ this,
+ to_pdf );
+ }
+ }
+ else {
+ rds.render( node.getXcoord() + x, node.getYcoord() - ( h / 2.0f ), g, this, to_pdf );
+ }
+ }
+ else {
+ if ( getOptions().isRightLineUpDomains() ) {
+ rds.render( ( ( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text ) - 20 )
+ + ( ( _longest_domain - rds.getTotalLength() ) * rds
+ .getRenderingFactorWidth() ),
+ node.getYcoord() - ( h / 2.0f ),
+ g,
+ this,
+ to_pdf );
+ }
+ else {
+ rds.render( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text,
+ node.getYcoord() - ( h / 2.0f ),
+ g,
+ this,
+ to_pdf );
+ }
+ }
+ }
+ }
+ if ( getControlPanel().isShowVectorData() && ( node.getNodeData().getVector() != null )
+ && ( node.getNodeData().getVector().size() > 0 ) && ( getStatisticsForExpressionValues() != null ) ) {
+ final RenderableVector rv = RenderableVector.createInstance( node.getNodeData().getVector(),
+ getStatisticsForExpressionValues(),
+ getConfiguration() );
+ if ( rv != null ) {
+ double domain_add = 0;
+ if ( getControlPanel().isShowDomainArchitectures() && node.getNodeData().isHasSequence()
+ && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {
+ domain_add = _domain_structure_width + 10;
+ }
+ if ( getControlPanel().isDrawPhylogram() ) {
+ rv.render( ( float ) ( node.getXcoord() + x + domain_add ), node.getYcoord() - 3, g, this, to_pdf );
+ }
+ else {
+ rv.render( ( float ) ( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text + domain_add ),
+ node.getYcoord() - 3,
+ g,
+ this,
+ to_pdf );
+ }
+ }
+ }
+ //if ( getControlPanel().isShowMolSequences() && ( node.getNodeData().isHasSequence() )
+ // && ( node.getNodeData().getSequence().isMolecularSequenceAligned() )
+ // && ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) ) {
+ // paintMolecularSequences( g, node, to_pdf );
+ //}
+ }
+
+ final private void paintOvRectangle( final Graphics2D g ) {
+ final float w_ratio = ( ( float ) getWidth() ) / getVisibleRect().width;
+ final float h_ratio = ( ( float ) getHeight() ) / getVisibleRect().height;
+ final float x_ratio = ( ( float ) getWidth() ) / getVisibleRect().x;
+ final float y_ratio = ( ( float ) getHeight() ) / getVisibleRect().y;
+ final float width = getOvMaxWidth() / w_ratio;
+ final float height = getOvMaxHeight() / h_ratio;
+ final float x = getVisibleRect().x + getOvXPosition() + ( getOvMaxWidth() / x_ratio );
+ final float y = getVisibleRect().y + getOvYPosition() + ( getOvMaxHeight() / y_ratio );
+ g.setColor( getTreeColorSet().getFoundColor0() );
+ getOvRectangle().setRect( x, y, width, height );
+ final Stroke s = g.getStroke();
+ g.setStroke( STROKE_1 );
+ if ( ( width < 6 ) && ( height < 6 ) ) {
+ drawRectFilled( x, y, 6, 6, g );
+ getOvVirtualRectangle().setRect( x, y, 6, 6 );
+ }
+ else if ( width < 6 ) {
+ drawRectFilled( x, y, 6, height, g );
+ getOvVirtualRectangle().setRect( x, y, 6, height );
+ }
+ else if ( height < 6 ) {
+ drawRectFilled( x, y, width, 6, g );
+ getOvVirtualRectangle().setRect( x, y, width, 6 );
+ }
+ else {
+ drawRect( x, y, width, height, g );
+ if ( isInOvRect() ) {
+ drawRect( x + 1, y + 1, width - 2, height - 2, g );
+ }
+ getOvVirtualRectangle().setRect( x, y, width, height );
+ }
+ g.setStroke( s );
+ }
+
+ final private void paintPhylogenyLite( final Graphics2D g ) {
+ _phylogeny
+ .getRoot()
+ .setXSecondary( ( float ) ( getVisibleRect().x + getOvXPosition() + ( MOVE / ( getVisibleRect().width / getOvRectangle()
+ .getWidth() ) ) ) );
+ _phylogeny.getRoot().setYSecondary( ( getVisibleRect().y + getOvYStart() ) );
+ final Stroke s = g.getStroke();
+ g.setStroke( STROKE_05 );
+ for( final PhylogenyNode element : _nodes_in_preorder ) {
+ paintNodeLite( g, element );
+ }
+ g.setStroke( s );
+ paintOvRectangle( g );