net.sf.jasperreports.engine.util

## Class JRTextMeasurerUtil

- java.lang.Object
- - net.sf.jasperreports.engine.util.JRTextMeasurerUtil

-     public final class JRTextMeasurerUtil
      extends java.lang.Object

  Text measurer utility class.
  Version:
    $Id: JRTextMeasurerUtil.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)
  See Also:
    `JRTextMeasurer`, `JRTextMeasurerFactory`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `JRTextMeasurerUtil.WrappingTextMeasurerFactory` Deprecated. To be removed.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PROPERTY_TEXT_MEASURER_FACTORY` Property that specifies a text measurer factory.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JRTextMeasurer` | `createTextMeasurer(JRCommonText text)` Creates a text measurer for a text object.
    `JRTextMeasurer` | `createTextMeasurer(JRCommonText text, JRPropertiesHolder propertiesHolder)` Creates a text measurer for a text object.
    `JRTextMeasurerFactory` | `getFactory(JRPropertiesHolder propertiesHolder)` Returns the text measurer factory given a set of properties.
    `static JRTextMeasurerUtil` | `getInstance(JasperReportsContext jasperReportsContext)`
    `JRTextMeasurerFactory` | `getTextMeasurerFactory(JRPropertiesHolder propertiesHolder)` Deprecated. Replaced by `getFactory(JRPropertiesHolder)`.
    `protected java.lang.String` | `getTextMeasurerFactoryClass(JRPropertiesHolder propertiesHolder)`
    `void` | `measureTextElement(JRPrintText printText)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROPERTY_TEXT_MEASURER_FACTORY

          public static final java.lang.String PROPERTY_TEXT_MEASURER_FACTORY

      Property that specifies a text measurer factory.

      This property can either hold the name of a text measurer factory class, e.g. ``

           net.sf.jasperreports.text.measurer.factory=org.me.MyTextMeasurerFactory

      or hold an alias of a text measurer factory class property, e.g. `

           net.sf.jasperreports.text.measurer.factory=myTextMeasurer
           ...
           net.sf.jasperreports.text.measurer.factory.myTextMeasurer=org.me.MyTextMeasurerFactory

      `
      See Also:
        `JRTextMeasurerFactory`, Constant Field Values

  - ### Method Detail

    - #### getInstance

          public static JRTextMeasurerUtil getInstance(JasperReportsContext jasperReportsContext)

    - #### createTextMeasurer

          public JRTextMeasurer createTextMeasurer(JRCommonText text)

      Creates a text measurer for a text object.

      If the text object is an instance of `JRPropertiesHolder`, its properties are used when determining the text measurer factory.

      Parameters:
        `text` - the text object
      Returns:
        a text measurer for the text object

    - #### createTextMeasurer

          public JRTextMeasurer createTextMeasurer(JRCommonText text,
                                          JRPropertiesHolder propertiesHolder)

      Creates a text measurer for a text object.
      Parameters:
        `text` - the text object
        `propertiesHolder` - the properties to use for determining the text measurer factory; can be `null`
      Returns:
        a text measurer for the text object

    - #### getTextMeasurerFactory

          public JRTextMeasurerFactory getTextMeasurerFactory(JRPropertiesHolder propertiesHolder)

      Deprecated. Replaced by `getFactory(JRPropertiesHolder)`.

    - #### getFactory

          public JRTextMeasurerFactory getFactory(JRPropertiesHolder propertiesHolder)

      Returns the text measurer factory given a set of properties.
      Parameters:
        `propertiesHolder` - the properties holder
      Returns:
        the text measurer factory

    - #### getTextMeasurerFactoryClass

          protected java.lang.String getTextMeasurerFactoryClass(JRPropertiesHolder propertiesHolder)

    - #### measureTextElement

          public void measureTextElement(JRPrintText printText)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com