1 package jalview.appletgui;
\r
3 import jalview.jbappletgui.GFontChooser;
\r
4 import jalview.appletgui.*;
\r
6 import java.awt.event.*;
\r
9 public class FontChooser extends GFontChooser
\r
13 boolean init = true;
\r
16 public FontChooser(AlignmentPanel ap, Frame frame)
\r
23 String fonts[] = Toolkit.getDefaultToolkit().getFontList();
\r
24 for(int i=0; i<fonts.length; i++)
\r
25 fontName.addItem(fonts[i]);
\r
27 for(int i=1; i<31; i++)
\r
28 fontSize.addItem(i+"");
\r
30 fontStyle.addItem("plain");
\r
31 fontStyle.addItem("bold");
\r
32 fontStyle.addItem("italic");
\r
34 oldFont = ap.av.getFont();
\r
35 fontName.select(oldFont.getName());
\r
36 fontSize.select(oldFont.getSize()+"");
\r
37 fontStyle.select(oldFont.getStyle());
\r
42 protected void ok_actionPerformed()
\r
44 frame.setVisible(false);
\r
45 if(ap.getOverviewPanel()!=null)
\r
46 ap.getOverviewPanel().updateOverviewImage();
\r
49 protected void cancel_actionPerformed()
\r
51 ap.av.setFont(oldFont);
\r
53 fontName.select(oldFont.getName());
\r
54 fontSize.select(oldFont.getSize()+"");
\r
55 fontStyle.select(oldFont.getStyle());
\r
57 frame.setVisible(false);
\r
62 Font newFont = new Font(fontName.getSelectedItem().toString(),
\r
63 fontStyle.getSelectedIndex(),
\r
64 Integer.parseInt(fontSize.getSelectedItem().toString())
\r
66 ap.av.setFont(newFont);
\r
71 protected void fontName_actionPerformed()
\r
77 protected void fontSize_actionPerformed()
\r
83 protected void fontStyle_actionPerformed()
\r