Package org.gwt.mosaic.core.client

Examples of org.gwt.mosaic.core.client.FontMetrics.stringBoxSize()


   * @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);
  }

  // Helper Code ************************************************************
 
View Full Code Here


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

  /**
   * Describes if this Size can be compressed, if container space gets scarce.
   * Used by the FormLayout size computations in <code>#compressedSizes</code>
View Full Code Here

   * @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);
  }

  // Helper Code ************************************************************
 
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.