From 2732a03c243a8d57c559e8e33c0e36bcd5d57624 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 10 Nov 2005 14:20:37 +0000 Subject: [PATCH] AlignSeq takes printstream as arg --- src/jalview/analysis/AlignSeq.java | 6 ++++-- src/jalview/analysis/NJTree.java | 4 ++-- src/jalview/appletgui/PairwiseAlignPanel.java | 2 +- src/jalview/gui/AlignFrame.java | 5 ----- src/jalview/gui/PairwiseAlignPanel.java | 2 +- src/jalview/gui/SeqCanvas.java | 6 ++++++ 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 9d8f008..092928f 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -406,7 +406,7 @@ public class AlignSeq /** * DOCUMENT ME! */ - public void printAlignment() + public void printAlignment(java.io.PrintStream os) { // Find the biggest id length for formatting purposes int maxid = s1.getName().length(); @@ -499,7 +499,9 @@ public class AlignSeq pid = pid / (float) (aseq1.length - count) * 100; output = output.append(new Format("Percentage ID = %2.2f\n\n").form(pid)); - System.out.println(output.toString()); + try{ + os.println(output.toString()); + }catch(Exception ex){} } /** diff --git a/src/jalview/analysis/NJTree.java b/src/jalview/analysis/NJTree.java index 46a2ced..0683265 100755 --- a/src/jalview/analysis/NJTree.java +++ b/src/jalview/analysis/NJTree.java @@ -375,7 +375,7 @@ public class NJTree public void findNewNJDistances(SequenceNode tmpi, SequenceNode tmpj, float dist) { - + tmpi.dist = ((dist + ri) - rj) / 2; tmpj.dist = (dist - tmpi.dist); @@ -658,7 +658,7 @@ public class NJTree AlignSeq as = new AlignSeq(sequence[i], sequence[j], "pep"); as.calcScoreMatrix(); as.traceAlignment(); - as.printAlignment(); + as.printAlignment(System.out); distance[i][j] = (float) as.maxscore; if (max < distance[i][j]) diff --git a/src/jalview/appletgui/PairwiseAlignPanel.java b/src/jalview/appletgui/PairwiseAlignPanel.java index d5243e3..e187663 100755 --- a/src/jalview/appletgui/PairwiseAlignPanel.java +++ b/src/jalview/appletgui/PairwiseAlignPanel.java @@ -54,7 +54,7 @@ public class PairwiseAlignPanel as.calcScoreMatrix(); as.traceAlignment(); - as.printAlignment(); + as.printAlignment(System.out); scores[i][j] = (float) as.getMaxScore() / (float) as.getASeq1().length; totscore = totscore + scores[i][j]; diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 0cef877..dcb3f44 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -162,11 +162,6 @@ public class AlignFrame } - public AlignViewport getViewport() - { - return viewport; - } - /* Added so Castor Mapping file can obtain Jalview Version diff --git a/src/jalview/gui/PairwiseAlignPanel.java b/src/jalview/gui/PairwiseAlignPanel.java index 6509063..31efd84 100755 --- a/src/jalview/gui/PairwiseAlignPanel.java +++ b/src/jalview/gui/PairwiseAlignPanel.java @@ -77,7 +77,7 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel (SequenceI) selsubset.elementAt(j), "pep"); as.calcScoreMatrix(); as.traceAlignment(); - as.printAlignment(); + as.printAlignment(System.out); scores[i][j] = (float) as.getMaxScore() / (float) as.getASeq1().length; totscore = totscore + scores[i][j]; diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index c3972ee..f86441a 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -81,6 +81,12 @@ public class SeqCanvas extends JComponent pdbViewer = pc; } + public AlignViewport getViewport() + { + return av; + } + + /** * DOCUMENT ME! * -- 1.7.10.2