Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Font


    /*
     * @see Dialog#createButtonBar(Composite)
     */
    protected Control createButtonBar(Composite parent) {
        Font font = parent.getFont();
        Composite composite = new Composite(parent, SWT.NULL);
        GridLayout layout = new GridLayout();
        if (!fStatusLineAboveButtons) {
            layout.numColumns = 2;
        }
View Full Code Here


     *
     * @param parent
     *            the parent this is being created in.
     */
    private void createUserEntryGroup(Composite parent) {
        Font font = parent.getFont();
        // destination specification group
        Composite userDefinedGroup = new Composite(parent, SWT.NONE);
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        userDefinedGroup.setLayout(layout);
View Full Code Here

        FontData descriptor = adapter.getFont(element);
        if (descriptor == null) {
            return null;
        }

        Font font = (Font) SWTResourceUtil.getFontTable().get(descriptor);
        if (font == null) {
            font = new Font(Display.getCurrent(), descriptor);
            SWTResourceUtil.getFontTable().put(descriptor, font);
        }
        return font;
    }
View Full Code Here

   * @param parent
   *            the parent composite to contain the dialog area
   * @return the dialog area control
   */
  protected Control createDialogArea(Composite parent) {
    Font font = parent.getFont();
    // create main group
    Composite contents = (Composite) super.createDialogArea(parent);
    ((GridLayout) contents.getLayout()).numColumns = 2;

    // begin the layout
View Full Code Here

   *
   * @param composite
   *            org.eclipse.swt.widgets.Composite
   */
  private void addSelectionButtons(Composite composite) {
    Font parentFont = composite.getFont();
    buttonComposite = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    buttonComposite.setLayout(layout);
    GridData data = new GridData(GridData.GRAB_HORIZONTAL);
View Full Code Here

     * Creates the screen.
     */
    @Override
    public void run() {
        display = new Display();
        monospace = new Font(display, "Courier new", 9, 0);
        shell = new Shell(display);
        shell.setText("AK Server");
        shell.setSize(500, 300);
        center(shell);
        shell.setLayout(new GridLayout(3, false));
View Full Code Here

            gridData.widthHint = 52;//set to 98 if not using any fonts
            gridData.heightHint = 200;
            asciiText.setLayoutData(gridData);

            //use a monospaced font for a better layout
            Font font = new Font(compositeHolder.getDisplay(), "Courier", 10, SWT.NORMAL);
            hexText.setFont(font);
            asciiText.setFont(font);

            final ScrollBar hexScrollBar = hexText.getVerticalBar();
            final ScrollBar asciiScrollBar = asciiText.getVerticalBar();
View Full Code Here

        }

        @Override
        public void applyStyles(TextStyle textStyle) {
            ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
            Font font = JFaceResources.getFontRegistry().getItalic(fontName);
            if (fForegroundColorName != null) {
                textStyle.foreground = colorRegistry.get(fForegroundColorName);
            }
            if (fBackgroundColorName != null) {
                textStyle.background = colorRegistry.get(fBackgroundColorName);
View Full Code Here

        }

        @Override
        public void applyStyles(TextStyle textStyle) {
            ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
            Font font = JFaceResources.getFontRegistry().getBold(fontName);
            if (fForegroundColorName != null) {
                textStyle.foreground = colorRegistry.get(fForegroundColorName);
            }
            if (fBackgroundColorName != null) {
                textStyle.background = colorRegistry.get(fBackgroundColorName);
View Full Code Here

        return new Labeling(labels);
    }

    private Iterable<Label> makeLabels(ProgressMonitor monitor, GC gc, MapInstance map, MapScheme<String> labelScheme) {
        Collection<Label> labels = new ArrayList<Label>();
        Font basefont = new Font(gc.getDevice(), LabelOverlay.ARIAL_NARROW, 12, SWT.NORMAL);
        for (Location each: map.locations()) {
            String text = labelScheme.forLocation(each.getPoint());
            if (text == null) continue;
            FontData[] fontData = basefont.getFontData();
            int height = (int) (Math.sqrt(each.getElevation()) * CodemapCore.colorScheme().getLabelHeightFactor());
            for (FontData fd: fontData) fd.setHeight(height);
            Font font = new Font(gc.getDevice(), fontData);
            gc.setFont(font);
            Point extent = gc.stringExtent(text);
            labels.add(new Label(each.px, each.py, extent, height, text, each));
            font.dispose();
        }
        basefont.dispose();
        return labels;
    }
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.