2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
20 package jalview.appletgui;
\r
24 import jalview.jbappletgui.*;
\r
26 public class FontChooser
\r
27 extends GFontChooser
\r
31 boolean init = true;
\r
34 public FontChooser(AlignmentPanel ap, Frame frame)
\r
41 String fonts[] = Toolkit.getDefaultToolkit().getFontList();
\r
42 for (int i = 0; i < fonts.length; i++)
\r
44 fontName.addItem(fonts[i]);
\r
47 for (int i = 1; i < 31; i++)
\r
49 fontSize.addItem(i + "");
\r
52 fontStyle.addItem("plain");
\r
53 fontStyle.addItem("bold");
\r
54 fontStyle.addItem("italic");
\r
56 oldFont = ap.av.getFont();
\r
57 fontName.select(oldFont.getName());
\r
58 fontSize.select(oldFont.getSize() + "");
\r
59 fontStyle.select(oldFont.getStyle());
\r
64 protected void ok_actionPerformed()
\r
66 frame.setVisible(false);
\r
67 if (ap.getOverviewPanel() != null)
\r
69 ap.getOverviewPanel().updateOverviewImage();
\r
73 protected void cancel_actionPerformed()
\r
75 ap.av.setFont(oldFont);
\r
77 fontName.select(oldFont.getName());
\r
78 fontSize.select(oldFont.getSize() + "");
\r
79 fontStyle.select(oldFont.getStyle());
\r
81 frame.setVisible(false);
\r
86 Font newFont = new Font(fontName.getSelectedItem().toString(),
\r
87 fontStyle.getSelectedIndex(),
\r
88 Integer.parseInt(fontSize.getSelectedItem().
\r
91 ap.av.setFont(newFont);
\r
95 protected void fontName_actionPerformed()
\r
104 protected void fontSize_actionPerformed()
\r
113 protected void fontStyle_actionPerformed()
\r