From: amwaterhouse Date: Wed, 14 Sep 2005 11:23:10 +0000 (+0000) Subject: use fontchooser to change fonts X-Git-Tag: Release_2_05b~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0039639a8b6fa7a9bfc131c83a493b5a696f0104;p=jalview.git use fontchooser to change fonts --- diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index e38e03a..603a80f 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -304,33 +304,25 @@ public class TreePanel extends GTreePanel * * @param e DOCUMENT ME! */ - public void fontSize_actionPerformed(ActionEvent e) + public void font_actionPerformed(ActionEvent e) { if (treeCanvas == null) { return; } - String size = fontSize.getText().substring(fontSize.getText().indexOf("-") + - 1); - - Object selection = JOptionPane.showInternalInputDialog(Desktop.desktop, - "Select font size", "Font size", JOptionPane.QUESTION_MESSAGE, - null, - new String[] - { - "1", "2", "4", "6", "8", "10", "12", "14", "16", "18", "20" - }, "Font Size - " + size); - - if (selection != null) - { - fontSize.setText("Font Size - " + selection); + FontChooser fontchooser = new FontChooser(this); + } - int i = Integer.parseInt(selection.toString()); - treeCanvas.setFontSize(i); - } + public Font getFont() + { + return treeCanvas.font; + } - scrollPane.setViewportView(treeCanvas); + public void setFont(Font font) + { + if(treeCanvas!=null) + treeCanvas.setFont(font); } /**