Examples of TextMetrics


Examples of com.alkacon.geranium.client.util.TextMetrics

        super.setText(m_originalText);

        // measure the actual text width
        Element element = getElement();
        TextMetrics tm = TextMetrics.get(element, textMetricsKey);
        String text = element.getInnerText();
        int textWidth = tm.getWidth(text);
        tm.release();

        if (labelWidth >= textWidth) {
            updateTitle(false);
            return;
        }
View Full Code Here

Examples of com.emitrom.lienzo.client.core.types.TextMetrics

     * @param context
     * @return TextMetric or null if the text is empty or null
     */
    public TextMetrics measure(Context2D context)
    {
        TextMetrics size = null;

        String text = getText();

        if ((null == text) || (text.isEmpty()))
        {
            return size;
        }
        context.save();

        context.setTextAlign(TextAlign.LEFT);

        context.setTextBaseline(TextBaseLine.ALPHABETIC);

        context.setTextFont(getFontStyle() + " " + getFontSize() + "pt " + getFontFamily());

        double width = getStrokeWidth();

        if (width == 0)
        {
            width = 1;
        }
        context.setStrokeWidth(width);

        context.transform(getAbsoluteTransform());

        size = context.measureText(text);

        double height = context.measureText("M").getWidth();

        size.setHeight(height - height / 6);

        context.restore();

        return size;
    }
View Full Code Here

Examples of com.emitrom.lienzo.client.core.types.TextMetrics

     * @param context
     * @return TextMetric or null if the text is empty or null
     */
    public TextMetrics measure(Context2D context)
    {
        TextMetrics size = null;

        String text = getText();

        if ((null == text) || (text.isEmpty()))
        {
            return size;
        }
        context.save();

        context.setTextAlign(TextAlign.LEFT);

        context.setTextBaseline(TextBaseLine.ALPHABETIC);

        context.setTextFont(getFontStyle() + " " + getFontSize() + "pt " + getFontFamily());

        double width = getStrokeWidth();

        if (width == 0)
        {
            width = 1;
        }
        context.setStrokeWidth(width);

        context.transform(getAbsoluteTransform());

        size = context.measureText(text);

        double height = context.measureText("M").getWidth();

        size.setHeight(height - height / 6);

        context.restore();

        return size;
    }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.util.TextMetrics

   *
   * @return the width
   */
  public int getTextWidth() {
    String html = getInnerHtml();
    TextMetrics metrics = TextMetrics.get();
    metrics.bind(dom);
    return metrics.getWidth(html);
  }
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.