Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Font


    Composite result = new Composite(parent, SWT.NONE);
   
    result.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
   
    Display display = result.getDisplay()
    Font font = result.getFont();
   
    if (boldFont == null) {
      FontData[] fontData = font.getFontData();
      fontData[0].setStyle(SWT.BOLD);
      fontData[0].setHeight(fontData[0].getHeight());
      boldFont = new Font(display, fontData);

      Color c1 = display.getSystemColor(SWT.COLOR_LIST_SELECTION);
      Color c2 = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
      selEdgeColor = new Color(display, (c1.getRed() + c2.getRed() * 3) / 4,
          (c1.getGreen() + c2.getGreen() * 3) / 4, (c1.getBlue() + c2.getBlue() * 3) / 4);
View Full Code Here


    FontData fd = new FontData(fontName, (int) fontSize, styleMask );
    currentFontData = fd;
    //if(fd.equals(this.fontData)) return;
    this.fontData = fd;
    disposeIfNessary(currentFont);
    currentFont = new Font(device, fd);
    gc.setFont(currentFont);
  }
View Full Code Here

            style = SWT.BOLD | SWT.ITALIC;
            break;
        }

        int height = (int)Math.round(font.size() * 72.0 / _display.getDPI().y);
        Font swt = new Font(_display, font.name(), height, style);
        return swt;
    }
View Full Code Here

            Label horizontalLine = new Label(mainControl, SWT.SEPARATOR | SWT.HORIZONTAL);
            data = new GridData(GridData.FILL_HORIZONTAL);
            horizontalLine.setLayoutData(data);
        }
       
        Font font;
        if (! JFaceResources.getFontRegistry().hasValueFor(TITLE_FONT)) {
            FontData[] fontData = JFaceResources.getFontRegistry().getBold(
                    JFaceResources.DEFAULT_FONT).getFontData();
            /* title font is 2pt larger than that used in the tabs. */ 
            fontData[0].setHeight(fontData[0].getHeight() + 2);
View Full Code Here

        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

        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

            fSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

            // Status field label
            fStatusField = new Label(composite, SWT.RIGHT);
            fStatusField.setText(statusFieldText);
            final Font font = fStatusField.getFont();
            final FontData[] fontDatas = font.getFontData();
            for (final FontData element : fontDatas) {
                element.setHeight(element.getHeight() * 9 / 10);
            }
            fStatusTextFont = new Font(fStatusField.getDisplay(), fontDatas);
            fStatusField.setFont(fStatusTextFont);
            final GridData gd2 = new GridData(GridData.FILL_VERTICAL
                    | GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING
                    | GridData.VERTICAL_ALIGN_BEGINNING);
            fStatusField.setLayoutData(gd2);
View Full Code Here

     *            the window on which to render the image
     * @return the point with the image size
     */
    protected Point computeImageSize(final Control window) {
        final GC gc = new GC(window);
        final Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
        gc.setFont(f);
        final int height = gc.getFontMetrics().getHeight();
        gc.dispose();
        final Point p = new Point(height * 3 - 6, height);
        return p;
View Full Code Here

        assertThat(preferenceStore, is(not(nullValue())));
        final IPropertyChangeListener fontChangeListener = new IPropertyChangeListener() {
            @Override
            public void propertyChange(final PropertyChangeEvent event) {
                if (PreferenceConstants.EDITOR_TEXT_FONT.equals(event.getProperty())) {
                    final Font font = JFaceResources
                            .getFont(PreferenceConstants.EDITOR_TEXT_FONT);
                    viewer.getTextWidget().setFont(font);
                }
            }
        };
View Full Code Here

        fSourceViewer.configure(new ErlangSourceViewerConfiguration(store,
                new ColorManager()));
        fSourceViewer.setEditable(false);

        final String symbolicFontName = ErlMergeViewer.class.getName();
        final Font font = JFaceResources.getFont(symbolicFontName);
        if (font != null) {
            fSourceViewer.getTextWidget().setFont(font);
        }

    }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.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.