Package org.gwt.mosaic.core.client

Examples of org.gwt.mosaic.core.client.FontMetrics


   * Computes the global dialog base units.
   *
   * @return a DialogBaseUnits object used globally
   */
  private DialogBaseUnits computeGlobalDialogBaseUnits() {
    final FontMetrics metrics = new FontMetrics();
    DOM.setStyleAttribute(metrics.getElement(), "whiteSpace", "nowrap");
    final Dimension boxSize = metrics.stringBoxSize(averageCharWidthTestString);
    return new DialogBaseUnits(boxSize.width
        / averageCharWidthTestString.length(), boxSize.height);
  }
View Full Code Here


   *         DefaultUnitConverter}'s default dialog font
   */
  public int maximumSize(LayoutPanel layoutPanel, List<Widget> widgets,
      FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure,
      FormLayout.Measure defaultMeasure) {
    final FontMetrics metrics = new FontMetrics();
    DOM.setStyleAttribute(metrics.getElement(), "whiteSpace", "nowrap");
    return metrics.stringBoxSize(prototype).width;
  }
View Full Code Here

   * Computes the global dialog base units.
   *
   * @return a DialogBaseUnits object used globally
   */
  private DialogBaseUnits computeGlobalDialogBaseUnits() {
    final FontMetrics metrics = new FontMetrics();
    DOM.setStyleAttribute(metrics.getElement(), "whiteSpace", "nowrap");
    final Dimension boxSize = metrics.stringBoxSize(averageCharWidthTestString);
    return new DialogBaseUnits((double) boxSize.width
        / averageCharWidthTestString.length(), boxSize.height);
  }
View Full Code Here

TOP

Related Classes of org.gwt.mosaic.core.client.FontMetrics

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.