Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.FontData


    public JcrCellLabelProvider(TableViewer viewer) {
        this.viewer = viewer;

        Display display = viewer.getControl().getDisplay();
       
        FontData fontData = viewer.getTable().getFont().getFontData()[0];
        italic = new Font(display, new FontData(fontData.getName(), fontData
                .getHeight(), SWT.ITALIC));
        normal = new Font(display, new FontData(fontData.getName(), fontData
                .getHeight(), SWT.NORMAL));
        bold = new Font(display, new FontData(fontData.getName(), fontData
                .getHeight(), SWT.BOLD));
        greyColor = new Color(display, 100, 100, 100);
        normalColor = viewer.getTable().getForeground();
    }
View Full Code Here


        viewer.setInput(TestTreeModel.getInstance());

        resultsLabel = new Label(parent, SWT.SINGLE);
        resultsLabel.setText("Passed: 0    Failed: 0   Skipped: 0   Canceled: 0");
        final FontData font = new FontData();
        font.setStyle(SWT.BOLD);
        resultsLabel.setFont(new Font(Display.getCurrent(), font));

    }
View Full Code Here

            final boolean strikeout, final boolean underline) {
        final String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|'
                + underline;
        Font font = m_fontMap.get(fontName);
        if (font == null) {
            final FontData fontData = new FontData(name, size, style);
            if (strikeout || underline) {
                try {
                    final Class<?> logFontClass = Class
                            .forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
                    final Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
View Full Code Here

     * @return the bold version of the given {@link Font}
     */
    public static Font getBoldFont(final Font baseFont) {
        Font font = m_fontToBoldFontMap.get(baseFont);
        if (font == null) {
            final FontData fontDatas[] = baseFont.getFontData();
            final FontData data = fontDatas[0];
            font = new Font(Display.getCurrent(), data.getName(), data.getHeight(),
                    SWT.BOLD);
            m_fontToBoldFontMap.put(baseFont, font);
        }
        return font;
    }
View Full Code Here

        int numTokens = tokenizer.countTokens();
        FontData[] fontData = new FontData[numTokens];

        for (int i = 0; i < numTokens; i++) {
            try {
                fontData[i] = new FontData(tokenizer.nextToken());
            } catch (SWTException error) {
                return FONTDATA_ARRAY_DEFAULT_DEFAULT;
            } catch (IllegalArgumentException error) {
                return FONTDATA_ARRAY_DEFAULT_DEFAULT;
            }
View Full Code Here

        data.heightHint = 30;
        data.widthHint = 370;

        Font f = label.getFont();
        FontData[] farr = f.getFontData();
        FontData fd = farr[0];
        fd.setStyle(SWT.BOLD);
        label.setFont(new Font(Display.getCurrent(), fd));

        label.setLayoutData(data);
        label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
View Full Code Here

        data.heightHint = 30;
        data.widthHint = 370;

        Font f = label.getFont();
        FontData[] farr = f.getFontData();
        FontData fd = farr[0];
        fd.setStyle(SWT.BOLD);
        label.setFont(new Font(Display.getCurrent(), fd));

        label.setLayoutData(data);
        label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
View Full Code Here

        data.heightHint = 30;
        data.widthHint = 370;

        Font f = label.getFont();
        FontData[] farr = f.getFontData();
        FontData fd = farr[0];
        fd.setStyle(SWT.BOLD);
        label.setFont(new Font(Display.getCurrent(), fd));

        label.setLayoutData(data);
        label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
View Full Code Here

   */
  protected void refreshFont() {
    FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
        NotationPackage.eINSTANCE.getFontStyle());
    if (style != null) {
      FontData fontData = new FontData(style.getFontName(), style
          .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
          | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
      setFont(fontData);
    }
  }
View Full Code Here

   */
  protected void refreshFont() {
    FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
        NotationPackage.eINSTANCE.getFontStyle());
    if (style != null) {
      FontData fontData = new FontData(style.getFontName(), style
          .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
          | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
      setFont(fontData);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.FontData

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.