Package net.sf.jasperreports.engine.util
Class JRTextMeasurerUtil
- java.lang.Object
-
- net.sf.jasperreports.engine.util.JRTextMeasurerUtil
-
public final class JRTextMeasurerUtil extends Object
Text measurer utility class.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
JRTextMeasurer
,JRTextMeasurerFactory
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_TEXT_MEASURER_FACTORY
Property that specifies a text measurer factory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
protected String
getTextMeasurerFactoryClass(JRPropertiesHolder propertiesHolder)
void
measureTextElement(JRPrintText printText)
-
-
-
Field Detail
-
PROPERTY_TEXT_MEASURER_FACTORY
public static final 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
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 objectpropertiesHolder
- the properties to use for determining the text measurer factory; can benull
- Returns:
- a text measurer for the text object
-
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 String getTextMeasurerFactoryClass(JRPropertiesHolder propertiesHolder)
-
measureTextElement
public void measureTextElement(JRPrintText printText)
-
-