inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / TreePanel.java
index a309225..8f8baa4 100644 (file)
@@ -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() ) ) {