AlignSeq takes printstream as arg
authoramwaterhouse <Andrew Waterhouse>
Thu, 10 Nov 2005 14:20:37 +0000 (14:20 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 10 Nov 2005 14:20:37 +0000 (14:20 +0000)
src/jalview/analysis/AlignSeq.java
src/jalview/analysis/NJTree.java
src/jalview/appletgui/PairwiseAlignPanel.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/PairwiseAlignPanel.java
src/jalview/gui/SeqCanvas.java

index 9d8f008..092928f 100755 (executable)
@@ -406,7 +406,7 @@ public class AlignSeq
     /**\r
      * DOCUMENT ME!\r
      */\r
-    public void printAlignment()\r
+    public void printAlignment(java.io.PrintStream os)\r
     {\r
         // Find the biggest id length for formatting purposes\r
         int maxid = s1.getName().length();\r
@@ -499,7 +499,9 @@ public class AlignSeq
         pid = pid / (float) (aseq1.length - count) * 100;\r
         output = output.append(new Format("Percentage ID = %2.2f\n\n").form(pid));\r
 \r
-        System.out.println(output.toString());\r
+        try{\r
+          os.println(output.toString());\r
+        }catch(Exception ex){}\r
     }\r
 \r
     /**\r
index 46a2ced..0683265 100755 (executable)
@@ -375,7 +375,7 @@ public class NJTree
     public void findNewNJDistances(SequenceNode tmpi, SequenceNode tmpj,\r
         float dist)\r
     {\r
-     \r
+\r
         tmpi.dist = ((dist + ri) - rj) / 2;\r
         tmpj.dist = (dist - tmpi.dist);\r
 \r
@@ -658,7 +658,7 @@ public class NJTree
                     AlignSeq as = new AlignSeq(sequence[i], sequence[j], "pep");\r
                     as.calcScoreMatrix();\r
                     as.traceAlignment();\r
-                    as.printAlignment();\r
+                    as.printAlignment(System.out);\r
                     distance[i][j] = (float) as.maxscore;\r
 \r
                     if (max < distance[i][j])\r
index d5243e3..e187663 100755 (executable)
@@ -54,7 +54,7 @@ public class PairwiseAlignPanel
 \r
         as.calcScoreMatrix();\r
         as.traceAlignment();\r
-        as.printAlignment();\r
+        as.printAlignment(System.out);\r
         scores[i][j] = (float) as.getMaxScore() / (float) as.getASeq1().length;\r
         totscore = totscore + scores[i][j];\r
 \r
index 0cef877..dcb3f44 100755 (executable)
@@ -162,11 +162,6 @@ public class AlignFrame
 \r
   }\r
 \r
-  public AlignViewport getViewport()\r
-  {\r
-    return viewport;\r
-  }\r
-\r
 \r
   /*\r
    Added so Castor Mapping file can obtain Jalview Version\r
index 6509063..31efd84 100755 (executable)
@@ -77,7 +77,7 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel
                         (SequenceI) selsubset.elementAt(j), "pep");\r
                 as.calcScoreMatrix();\r
                 as.traceAlignment();\r
-                as.printAlignment();\r
+                as.printAlignment(System.out);\r
                 scores[i][j] = (float) as.getMaxScore() / (float) as.getASeq1().length;\r
                 totscore = totscore + scores[i][j];\r
 \r
index c3972ee..f86441a 100755 (executable)
@@ -81,6 +81,12 @@ public class SeqCanvas extends JComponent
       pdbViewer = pc;\r
     }\r
 \r
+    public AlignViewport getViewport()\r
+    {\r
+      return av;\r
+    }\r
+\r
+\r
     /**\r
      * DOCUMENT ME!\r
      *\r