From 0039639a8b6fa7a9bfc131c83a493b5a696f0104 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 14 Sep 2005 11:23:10 +0000 Subject: [PATCH] use fontchooser to change fonts --- src/jalview/gui/TreePanel.java | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) 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); } /** -- 1.7.10.2