Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.stringExtent()


    String lines[] = message.split("\n");
    Point longest = null;
    int typicalHeight = gc.stringExtent("X").y;

    for (String line : lines) {
      Point extent = gc.stringExtent(line);
      if (longest == null) {
        longest = extent;
        continue;
      }
View Full Code Here


    checkWidget ();
    int width = 0, height = 0;
    String[] items = getListItems();
    int textWidth = 0;
    GC gc = new GC (text);
    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
    }
    gc.dispose();
    Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
View Full Code Here

    String[] items = getListItems();
    int textWidth = 0;
    GC gc = new GC (text);
    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
    }
    gc.dispose();
    Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
    Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
    Point listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
View Full Code Here

    checkWidget ();
    int width = 0, height = 0;
    String[] items = list.getItems ();
    int textWidth = 0;
    GC gc = new GC (text);
    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
    }
    gc.dispose();
    Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
View Full Code Here

    String[] items = list.getItems ();
    int textWidth = 0;
    GC gc = new GC (text);
    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
    }
    gc.dispose();
    Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
    Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
    Point listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
View Full Code Here

    checkWidget ();
    int width = 0, height = 0;
    String[] items = list.getItems ();
    int textWidth = 0;
    GC gc = new GC (text);
    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
    }
    gc.dispose();
   
View Full Code Here

    String[] items = list.getItems ();
    int textWidth = 0;
    GC gc = new GC (text);
    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
    }
    gc.dispose();
   
    Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
    Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
View Full Code Here

      fIndentation= new int[fCachedNumberOfDigits + 1];

      char[] nines= new char[fCachedNumberOfDigits];
      Arrays.fill(nines, '9');
      String nineString= new String(nines);
      Point p= gc.stringExtent(nineString);
      fIndentation[0]= p.x;

      for (int i= 1; i <= fCachedNumberOfDigits; i++) {
        p= gc.stringExtent(nineString.substring(0, i));
        fIndentation[i]= fIndentation[0] - p.x;
View Full Code Here

      String nineString= new String(nines);
      Point p= gc.stringExtent(nineString);
      fIndentation[0]= p.x;

      for (int i= 1; i <= fCachedNumberOfDigits; i++) {
        p= gc.stringExtent(nineString.substring(0, i));
        fIndentation[i]= fIndentation[0] - p.x;
      }

    } finally {
      gc.dispose();
View Full Code Here

        Rectangle rect = shell.getClientArea();
        int width = 0;
        String[] items = list.getItems();
        GC gc = new GC(list);
        for (int i = 0; i < objects.length; i++) {
            width = Math.max(width, gc.stringExtent(items[i]).x);
        }
        gc.dispose();
        Point size1 = start.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        Point size2 = stop.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        Point size3 = check.computeSize(SWT.DEFAULT, SWT.DEFAULT);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.