X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FTreePanel.java;h=38afbce942c16853aa662c5156c9cf25005747e5;hb=046e97b211db481219195ad13875ad03ddc2225d;hp=d0d6ddc1b5f0e8e62064c65d461896648302a1e7;hpb=09028c5abedb9492d6fc76b4274f6dd46bcf6cd6;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index d0d6ddc..38afbce 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -176,7 +176,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee private static final BasicStroke STROKE_2 = new BasicStroke( 2f ); private static final double TWO_PI = 2 * Math.PI; private final static int WIGGLE = 2; - private static final String SHOW_ONLY_THIS_CONF_TYPE = "posterior probability"; //TODO remove me + private static final String SHOW_ONLY_THIS_CONF_TYPE = null; //TODO remove me HashMap _nodeid_dist_to_leaf = new HashMap(); final private Arc2D _arc = new Arc2D.Double(); private AffineTransform _at; @@ -4790,6 +4790,11 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } 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 @@ -4892,33 +4897,37 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } } } - if ( getControlPanel().isShowMolSequences() && ( node.getNodeData().isHasSequence() ) - && ( node.getNodeData().getSequence().isMolecularSequenceAligned() ) - && ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) ) { - final RenderableMsaSequence rs = RenderableMsaSequence.createInstance( node.getNodeData().getSequence() - .getMolecularSequence(), node.getNodeData().getSequence().getType(), getConfiguration() ); - if ( rs != 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; - rs.setRenderingHeight( h > 1 ? h : 2 ); - if ( getControlPanel().isDrawPhylogram() ) { - rs.render( ( float ) ( ( getMaxDistanceToRoot() * getXcorrectionFactor() ) + _length_of_longest_text ), - node.getYcoord() - ( h / 2.0f ), - g, - this, - to_pdf ); - } - else { - rs.render( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text, - node.getYcoord() - ( h / 2.0f ), - 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 ); + //} + } + + private void paintMolecularSequences( final Graphics2D g, final PhylogenyNode node, final boolean to_pdf ) { + final RenderableMsaSequence rs = RenderableMsaSequence.createInstance( node.getNodeData().getSequence() + .getMolecularSequence(), node.getNodeData().getSequence().getType(), getConfiguration() ); + if ( rs != null ) { + final int default_height = 8; + float y = getYdistance(); + + final int h = ( y / 2) < default_height ? ForesterUtil.roundToInt( y * 2 ) : default_height; + rs.setRenderingHeight( h > 1 ? h : 1 ); + + if ( getControlPanel().isDrawPhylogram() ) { + rs.render( ( float ) ( ( getMaxDistanceToRoot() * getXcorrectionFactor() ) + _length_of_longest_text ), + node.getYcoord() - ( h / 2.0f ), + g, + this, + to_pdf ); + } + else { + rs.render( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text, + node.getYcoord() - ( h / 2.0f ), + g, + this, + to_pdf ); } } }