Package net.sf.robocode.ui.editor

Examples of net.sf.robocode.ui.editor.FontStyle


    fontStyleComboBox = fontStyle == null ? null : ComboBoxUtil.createFontStyleComboBox(fontStyle);
    if (fontStyleComboBox != null) {
      fontStyleComboBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          FontStyle newStyle = ComboBoxUtil.getSelectedStyle(fontStyleComboBox);
          if (oldStyle != newStyle) {
            notifyStyleChanged(newStyle);
            oldStyle = newStyle;
          }
        }
View Full Code Here


  public static void setSelected(JComboBox comboBox, FontStyle fontStyle) {
    ComboBoxModel model = comboBox.getModel();
    for (int i = 0; i < model.getSize(); i++) {
      String name = (String) model.getElementAt(i);
      FontStyle style = FontStyle.fromName(name);
      if (style != null && style == fontStyle) {
        model.setSelectedItem(name);
        break;
      }
    }
View Full Code Here

    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
     
      FontStyle fontStyle = FontStyle.fromName((String) value);
      int styleFlags = (fontStyle == null) ? Font.PLAIN : fontStyle.getFontStyleFlags();

      Font font = new Font((String) value, styleFlags, 12);
      label.setFont(font);
      return label;
    }
View Full Code Here

TOP

Related Classes of net.sf.robocode.ui.editor.FontStyle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.