output text to textbox
authoramwaterhouse <Andrew Waterhouse>
Wed, 25 May 2005 16:39:57 +0000 (16:39 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 25 May 2005 16:39:57 +0000 (16:39 +0000)
src/jalview/gui/TreePanel.java

index 3c571f8..047c1d4 100755 (executable)
@@ -7,9 +7,7 @@ import jalview.io.*;
 import java.awt.event.*;\r
 import java.util.*;\r
 import java.io.*;\r
-import jalview.util.*;\r
 import javax.swing.*;\r
-import java.awt.print.*;\r
 import java.awt.*;\r
 import java.awt.image.*;\r
 import org.jibble.epsgraphics.*;\r
@@ -17,7 +15,6 @@ import javax.imageio.*;
 \r
 \r
 \r
-\r
 public class TreePanel extends GTreePanel\r
 {\r
   SequenceI[] seq;\r
@@ -102,11 +99,32 @@ public class TreePanel extends GTreePanel
 \r
     }\r
 \r
-    public String getText(String format)\r
+\r
+    public void textbox_actionPerformed(ActionEvent e)\r
     {\r
-      return null;\r
+      CutAndPasteTransfer cap = new CutAndPasteTransfer();\r
+      JInternalFrame frame = new JInternalFrame();\r
+      frame.setContentPane(cap);\r
+\r
+      StringBuffer buffer = new StringBuffer();\r
+\r
+      if(type.equals("AV"))\r
+        buffer.append("Average distance tree using ");\r
+      else\r
+        buffer.append("Neighbour joining tree using ");\r
+\r
+      if(pwtype.equals("BL"))\r
+       buffer.append("BLOSUM62");\r
+      else\r
+        buffer.append("PID");\r
+\r
+      Desktop.addInternalFrame(frame,buffer.toString(), 500, 100);\r
+      jalview.io.NewickFile fout = new jalview.io.NewickFile(tree.getTopNode());\r
+      cap.setText(  fout.print(false,true) );\r
+\r
     }\r
 \r
+\r
     public void saveAsNewick_actionPerformed(ActionEvent e)\r
     {\r
 \r