Package java.awt

Examples of java.awt.Font


    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, nullString);

    final String fontString = result.getProperty("font");
    if (fontString != null)
    {
      final Font font = (Font) new FontConverter().convertFromString(fontString, getLocator());
      element.getStyle().setStyleProperty(TextStyleKeys.BOLD, (font.isBold()) ? Boolean.TRUE : Boolean.FALSE);
      element.getStyle().setStyleProperty(TextStyleKeys.ITALIC, (font.isItalic()) ? Boolean.TRUE : Boolean.FALSE);
      element.getStyle().setStyleProperty(TextStyleKeys.FONT, font.getName());
      element.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, IntegerCache.getInteger(font.getSize()));
    }
    final String foreGround = result.getProperty("foreground");
    if (foreGround != null)
    {
      element.getStyle().setStyleProperty(ElementStyleKeys.PAINT, ColorConverter.getObject(foreGround));
View Full Code Here


      basicFontPropertiesPane.addChangeListener(new FontPropertiesHandler());
    }

    if (value != null)
    {
      final Font font = Font.decode(value);
      basicFontPropertiesPane.setFontFamily(font.getFamily());
      basicFontPropertiesPane.setFontStyle(font.getStyle());
      basicFontPropertiesPane.setFontSize(font.getSize());
    }
    return basicFontPropertiesPane;
  }
View Full Code Here

   
    protected DcLabel getLabel(String text, boolean label, int width) {
        DcLabel lbl = new DcLabel();
       
        if (label) {
            Font font = DcSettings.getFont(DcRepository.Settings.stSystemFontBold);
            lbl.setFont(new Font(font.getName(), Font.BOLD, font.getSize()));
        } else {
            lbl.setFont(DcSettings.getFont(DcRepository.Settings.stSystemFontNormal));
        }
       
        lbl.setText(text);
View Full Code Here

   
    @Override
    protected DcLabel getLabel(int field, boolean label, int width) {
        DcLabel lbl = new DcLabel();
        if (label) {
            Font font = DcSettings.getFont(DcRepository.Settings.stSystemFontBold);
            lbl.setFont(new Font(font.getName(), Font.BOLD, font.getSize()));
            lbl.setText(dco.getLabel(field));
        } else {
            lbl.setFont(DcSettings.getFont(DcRepository.Settings.stSystemFontNormal));
            lbl.setText(dco.getDisplayString(field));
        }
View Full Code Here

        }
    }   

    @Override
    public void setFont(Font font) {
        Font fontNormal = DcSettings.getFont(DcRepository.Settings.stSystemFontNormal);
        Font fontSystem = DcSettings.getFont(DcRepository.Settings.stSystemFontNormal);       
       
        super.setFont(fontNormal);
        Component component;
        Component subComponent;
        for (int i = 0; i < getComponents().length; i++) {
View Full Code Here

    int i2 = s.indexOf(',', i + 1);
    if (i2 == -1)
    {
      throw new ParseException("Malformed format");
    }
    return new Font(s.substring(0, i).trim(),
        Integer.parseInt(s.substring(i2 + 1).trim()), Integer.parseInt(s.substring(i + 1, i2).trim()));
  }
View Full Code Here

    return width;
  }

  public static void testFont ()
  {
    Font font = new Font ("Coronet", Font.ITALIC, 80); //$NON-NLS-1$
    FontRenderContext frc = new FontRenderContext(null, true, true);
    char[] chars = new char[('z' - 'a')];
    double[] charW = new double[chars.length];

    for (int i = 0; i < chars.length; i++)
    {
      chars[i] = (char) ('a' + i);
      Rectangle2D rect = font.getStringBounds("" + chars[i], frc); //$NON-NLS-1$
      charW[i] = rect.getWidth();
    }

    System.out.println(TEST_STRING);
    final char[] string = TEST_STRING.toCharArray();
View Full Code Here

  }

  protected Component createContentPane()
  {
    textArea = new JTextArea();
    textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14));
    textArea.setLineWrap(false);
    textArea.setEditable(true);

    final JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
View Full Code Here

                orgNegItemLabelPos.getRotationAnchor(), categoricalItemLabelRotation.doubleValue());
        renderer.setBaseNegativeItemLabelPosition(neg2);
      }
    }

    final Font labelFont = Font.decode(getLabelFont());


    final CategoryAxis categoryAxis = cpl.getDomainAxis();
    categoryAxis.setLabelFont(labelFont);
    categoryAxis.setTickLabelFont(labelFont);
View Full Code Here

            else if ("ITALIC".equals(S))
                style |= Font.ITALIC;
            else if ("PLAIN".equals(S))
                style |= Font.PLAIN;
        }
        return new Font(fontItems[0], style, size);
    }
View Full Code Here

TOP

Related Classes of java.awt.Font

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.