Examples of stringExtent()


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

      label.setText(WorkbenchMessages.BundleSigningTray_Signing_Date);
      GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
      date = new Text(content, SWT.READ_ONLY);
      GC gc = new GC(date);
      gc.setFont(JFaceResources.getDialogFont());
      Point size = gc.stringExtent(DateFormat.getDateTimeInstance().format(new Date()));
      data.widthHint = size.x;
      gc.dispose();
      date.setText(WorkbenchMessages.BundleSigningTray_Working);
      date.setLayoutData(data);
      date.setBackground(backgroundColor);
View Full Code Here

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

            titleHeight = Math.max(toggleHeight + (2 * vMargin), titleHeight);
        }
        titleHeight = Math.max(gc.getFontMetrics().getHeight() + (2 * titleTextMargin)
                               + (2 * vMargin), titleHeight);

        textWidth = gc.stringExtent(getGroup().getText()).x;

        fontHeight = gc.getFontMetrics().getHeight();

        gc.dispose();
    }
View Full Code Here

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

            titleHeight += (2 * lineMargin);
        }

        fontHeight = gc.getFontMetrics().getHeight();

        textWidth = gc.stringExtent(getGroup().getText()).x;

        gc.dispose();

    }

View Full Code Here

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

            titleHeight = Math.max(toggleHeight + (2 * vMargin), titleHeight);
        }

        fontHeight = gc.getFontMetrics().getHeight();

        textWidth = gc.stringExtent(getGroup().getText()).x;

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

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

    if (!hasText(item)) {
      return new Point(0, 0);
    }
   
    GC gc = new GC(this);
    Point textSize = gc.stringExtent(item.getText());
    gc.dispose();
    return textSize;
  }
 
  public Rectangle getTextBounds(StripItem item) {
View Full Code Here

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

    Point size = new Point(0, 0);
   
    if (hasText(item)) {
      String text = item.getText();
      GC gc = new GC(this);
      size = gc.stringExtent(text);
      gc.dispose();
    }
   
    return size;
  }
View Full Code Here

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

    Point size = new Point(0, 0);
   
    if (hasText()) {
      String text = getText();
      GC gc = new GC(parent);
      size = gc.stringExtent(text);
      gc.dispose();
    }
   
    return size;
  }
View Full Code Here

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

        return null;
      }
     
      Display display = Display.getDefault();
      GC gc = new GC(display);
      Point textSize = gc.stringExtent(text);
      gc.dispose();
      return textSize;
    }
   
    public Rectangle getTextBounds() {
View Full Code Here

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

    OIPoint size = new OIPoint(0, 0);
   
    if (hasText()) {
      String text = getText();
      GC gc = new GC(parent);
      size.setValues(gc.stringExtent(text), false);
      UI.dispose(gc);
    }
   
    return size;
  }
View Full Code Here

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

      if (item.getImage() != null) {
        bounds.height = Math.max(bounds.height, item.getImage().getBounds().height);
      }
     
      if (item.getText() != null && !item.getText().isEmpty()) {
        bounds.height = Math.max(bounds.height, gc.stringExtent(item.getText()).y);
      }
     
      bounds.height = Math.max(bounds.height, closeButtonImage.getBounds().height);
    }
   
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.