use fontchooser to change fonts
authoramwaterhouse <Andrew Waterhouse>
Wed, 14 Sep 2005 11:23:10 +0000 (11:23 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 14 Sep 2005 11:23:10 +0000 (11:23 +0000)
src/jalview/gui/TreePanel.java

index e38e03a..603a80f 100755 (executable)
@@ -304,33 +304,25 @@ public class TreePanel extends GTreePanel
      *\r
      * @param e DOCUMENT ME!\r
      */\r
-    public void fontSize_actionPerformed(ActionEvent e)\r
+    public void font_actionPerformed(ActionEvent e)\r
     {\r
         if (treeCanvas == null)\r
         {\r
             return;\r
         }\r
 \r
-        String size = fontSize.getText().substring(fontSize.getText().indexOf("-") +\r
-                1);\r
-\r
-        Object selection = JOptionPane.showInternalInputDialog(Desktop.desktop,\r
-                "Select font size", "Font size", JOptionPane.QUESTION_MESSAGE,\r
-                null,\r
-                new String[]\r
-                {\r
-                    "1", "2", "4", "6", "8", "10", "12", "14", "16", "18", "20"\r
-                }, "Font Size - " + size);\r
-\r
-        if (selection != null)\r
-        {\r
-            fontSize.setText("Font Size - " + selection);\r
+        FontChooser fontchooser = new FontChooser(this);\r
+    }\r
 \r
-            int i = Integer.parseInt(selection.toString());\r
-            treeCanvas.setFontSize(i);\r
-        }\r
+    public Font getFont()\r
+    {\r
+      return treeCanvas.font;\r
+    }\r
 \r
-        scrollPane.setViewportView(treeCanvas);\r
+    public void setFont(Font font)\r
+    {\r
+      if(treeCanvas!=null)\r
+      treeCanvas.setFont(font);\r
     }\r
 \r
     /**\r