X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FTreePanel.java;h=8f8baa4e89fd759bed440cf08b3d8e9052ee0904;hb=7aa2563168935732ea6d59a3f1c6cd8bf9a4ad61;hp=a3092250afcd4f0e25d18bf21369f17e8210ba51;hpb=aafd947d5ebcf9ed3218c269f432be59781ce322;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index a309225..8f8baa4 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -100,6 +100,7 @@ import org.forester.archaeopteryx.phylogeny.data.RenderableVector; import org.forester.archaeopteryx.tools.Blast; import org.forester.archaeopteryx.tools.ImageLoader; import org.forester.io.parsers.phyloxml.PhyloXmlUtil; +import org.forester.io.writers.SequenceWriter; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; import org.forester.phylogeny.PhylogenyMethods.DESCENDANT_SORT_PRIORITY; @@ -477,8 +478,6 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee /** * Set parameters for printing the displayed tree * - * @param x - * @param y */ final void calcParametersForPainting( final int x, final int y, final boolean recalc_longest_ext_node_info ) { // updateStyle(); not needed? @@ -489,7 +488,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee if ( getOptions().isAllowFontSizeChange() ) { if ( ( getLongestExtNodeInfo() > ( x * 0.6 ) ) && ( getTreeFontSet().getLargeFont().getSize() > 2 + TreeFontSet.FONT_SIZE_CHANGE_STEP ) ) { - while ( ( getLongestExtNodeInfo() > ( x * 0.6 ) ) + while ( ( getLongestExtNodeInfo() > ( x * 0.7 ) ) && ( getTreeFontSet().getLargeFont().getSize() > 2 ) ) { getMainPanel().getTreeFontSet().decreaseFontSize( getConfiguration().getMinBaseFontSize(), true ); @@ -497,7 +496,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } } else { - while ( ( getLongestExtNodeInfo() < ( x * 0.5 ) ) + while ( ( getLongestExtNodeInfo() < ( x * 0.6 ) ) && ( getTreeFontSet().getLargeFont().getSize() <= getTreeFontSet().getLargeFontMemory() .getSize() - TreeFontSet.FONT_SIZE_CHANGE_STEP ) ) { getMainPanel().getTreeFontSet().increaseFontSize(); @@ -3229,6 +3228,8 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee return "Sequence Symbols"; case SEQUENCE_MOL_SEQ: return "Molecular Sequences"; + case SEQUENCE_MOL_SEQ_FASTA: + return "Molecular Sequences (Fasta)"; case SEQUENCE_ACC: return "Sequence Accessors"; case TAXONOMY_SCIENTIFIC_NAME: @@ -5062,6 +5063,21 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee data.add( n.getNodeData().getSequence().getMolecularSequence() ); } break; + case SEQUENCE_MOL_SEQ_FASTA: + final StringBuilder sb = new StringBuilder(); + if ( n.getNodeData().isHasSequence() + && !ForesterUtil.isEmpty( n.getNodeData().getSequence().getMolecularSequence() ) ) { + if ( !ForesterUtil.isEmpty( n.getNodeData().getSequence().getName() ) ) { + sb.append( SequenceWriter.toFasta( n.getNodeData().getSequence().getName(), n.getNodeData() + .getSequence().getMolecularSequence(), 60 ) ); + } + else { + sb.append( SequenceWriter.toFasta( n.getName(), n.getNodeData().getSequence() + .getMolecularSequence(), 60 ) ); + } + data.add( sb.toString() ); + } + break; case SEQUENCE_ACC: if ( n.getNodeData().isHasSequence() && ( n.getNodeData().getSequence().getAccession() != null ) && !ForesterUtil.isEmpty( n.getNodeData().getSequence().getAccession().toString() ) ) {