Examples of stringExtent()


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

    String lines[] = _text.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

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

    if (name == null)
      return 0;
    GC gc= new GC(control);
    try {
      gc.setFont(JFaceResources.getDialogFont());
      return gc.stringExtent(name).x + 10;
    } finally {
      gc.dispose();
    }
  }
View Full Code Here

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

        GC gc = new GC(_shell);

        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;
View Full Code Here

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

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

   */
  public static int GetStringWidth(Control control, String string)
  {
    if (control == null || string == null) return 0;
    GC gc = new GC(control);
    int width = gc.stringExtent(string).x;
    gc.dispose();
    return width;
  }

  /**
 
View Full Code Here

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

          // Does the menu command have a shortcut defined?
          if (item.getShortcut() != null)
          {
            // Find the width of the shortcut text
            dimension = gc.stringExtent(item.getShortcut().toString());
            if (dimension.x > shortCutWidth) shortCutWidth = dimension.x;
          }
        }

        // If the new cell expands past the end of the screen...
View Full Code Here

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

          if (parentMenuItem != null)
          {
            GC gc = new GC(this.holder.getShell());

            // Find size of the parent command
            Point size = gc.stringExtent(parentMenuItem.getText());

            gc.dispose();
            // Move across the submenu so it does not cover
            // the parent command
            screenPos.x += size.x;
View Full Code Here

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

    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

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

    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 listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
    int borderWidth = getBorderWidth ();
View Full Code Here

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

    GC gc = new GC(shell);

    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;
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.