GUI tool for font creation heaven/hell.
| 52 | * GUI tool for font creation heaven/hell. |
| 53 | */ |
| 54 | public class CreateFont extends JFrame implements Tool { |
| 55 | Base base; |
| 56 | |
| 57 | JList<String> fontSelector; |
| 58 | JTextField sizeSelector; |
| 59 | JButton charsetButton; |
| 60 | JCheckBox smoothBox; |
| 61 | JComponent sample; |
| 62 | JButton okButton; |
| 63 | JTextField filenameField; |
| 64 | |
| 65 | String[] fontNames; |
| 66 | Map<String, Font> nameToFont; |
| 67 | |
| 68 | Font font; |
| 69 | int selection = -1; |
| 70 | boolean smooth = true; |
| 71 | |
| 72 | CharacterSelector charSelector; |
| 73 | |
| 74 | |
| 75 | public CreateFont() { |
| 76 | super(Language.text("create_font")); |
| 77 | } |
| 78 | |
| 79 | |
| 80 | public String getMenuTitle() { |
| 81 | return Language.text("menu.tools.create_font"); |
| 82 | } |
| 83 | |
| 84 | |
| 85 | public void init(Base base) { |
| 86 | this.base = base; |
| 87 | |
| 88 | Container paine = getContentPane(); |
| 89 | paine.setLayout(new BorderLayout()); //10, 10)); |
| 90 | |
| 91 | JPanel pain = new JPanel(); |
| 92 | pain.setBorder(new EmptyBorder(13, 13, 13, 13)); |
| 93 | paine.add(pain, BorderLayout.CENTER); |
| 94 | |
| 95 | pain.setLayout(new BoxLayout(pain, BoxLayout.Y_AXIS)); |
| 96 | |
| 97 | String labelText = Language.text("create_font.label"); |
| 98 | |
| 99 | JTextArea textarea = new JTextArea(labelText); |
| 100 | textarea.setBorder(new EmptyBorder(10, 10, 20, 10)); |
| 101 | textarea.setBackground(null); |
| 102 | textarea.setEditable(false); |
| 103 | textarea.setHighlighter(null); |
| 104 | textarea.setFont(new Font("Dialog", Font.PLAIN, 12)); |
| 105 | pain.add(textarea); |
| 106 | |
| 107 | |
| 108 | // getFontList is deprecated in 1.4, so this has to be used |
| 109 | //long t = System.currentTimeMillis(); |
| 110 | GraphicsEnvironment ge = |
| 111 | GraphicsEnvironment.getLocalGraphicsEnvironment(); |
nothing calls this directly
no outgoing calls
no test coverage detected