Package org.eclipse.birt.chart.device
Class TextAdapter
- java.lang.Object
-
- org.eclipse.birt.chart.device.TextAdapter
-
- All Implemented Interfaces:
ITextMetrics
public class TextAdapter extends java.lang.Object implements ITextMetrics
A no-op adapter implementation for theITextMetricsinterface definition.
-
-
Constructor Summary
Constructors Constructor Description TextAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Perform a cleanup when this object is not required anymoredoublegetDescent()Returns the descent of a single line of text using the font defined in the contained labeldoublegetFullHeight()Returns the full height of all lines of text using the font defined in the contained labeldoublegetFullHeight(double fontHeight)doublegetFullWidth()Returns the max width of the widest line of text using the font defined in the contained labeldoublegetHeight()Returns the height of a single line of text using the font defined in the contained labeljava.lang.StringgetLine(int iIndex)The text associated with a line index for multi-line textintgetLineCount()Returns the number of lines of text associated with the label to be renderedjava.util.LocalegetLocale()Returns the locale associated with the text metrics implementercom.ibm.icu.util.ULocalegetULocale()Returns the locale associated with the text metrics implementerdoublegetWidth(int iIndex)The text's width of associated with a line index.voidreuse(Label la)Permits reuse of the text metrics instance for a new label with new attributes.voidreuse(Label la, double forceWrappingSize)Permits reuse of the text metrics instance for a new label with new attributes and a forcing wrapping size.voidsetLocale(com.ibm.icu.util.ULocale lcl)Sets current locale.
-
-
-
Method Detail
-
reuse
public void reuse(Label la)
Description copied from interface:ITextMetricsPermits reuse of the text metrics instance for a new label with new attributes.- Specified by:
reusein interfaceITextMetrics
-
reuse
public void reuse(Label la, double forceWrappingSize)
Description copied from interface:ITextMetricsPermits reuse of the text metrics instance for a new label with new attributes and a forcing wrapping size.- Specified by:
reusein interfaceITextMetrics
-
getHeight
public double getHeight()
Description copied from interface:ITextMetricsReturns the height of a single line of text using the font defined in the contained label- Specified by:
getHeightin interfaceITextMetrics- Returns:
- The height of a single line of text using the font defined in the contained label
-
getDescent
public double getDescent()
Description copied from interface:ITextMetricsReturns the descent of a single line of text using the font defined in the contained label- Specified by:
getDescentin interfaceITextMetrics- Returns:
- The descent of a single line of text using the font defined in the contained label
-
getFullHeight
public double getFullHeight()
Description copied from interface:ITextMetricsReturns the full height of all lines of text using the font defined in the contained label- Specified by:
getFullHeightin interfaceITextMetrics- Returns:
- The full height of all lines of text using the font defined in the contained label
-
getFullWidth
public double getFullWidth()
Description copied from interface:ITextMetricsReturns the max width of the widest line of text using the font defined in the contained label- Specified by:
getFullWidthin interfaceITextMetrics- Returns:
- The max width of the widest line of text using the font defined in the contained label
-
getLineCount
public int getLineCount()
Description copied from interface:ITextMetricsReturns the number of lines of text associated with the label to be rendered- Specified by:
getLineCountin interfaceITextMetrics- Returns:
- The number of lines of text associated with the label to be rendered
-
getLine
public java.lang.String getLine(int iIndex)
Description copied from interface:ITextMetricsThe text associated with a line index for multi-line text- Specified by:
getLinein interfaceITextMetrics- Parameters:
iIndex- The line to be retrieved from multi-line text- Returns:
- A line of text (subset)
-
dispose
public void dispose()
Description copied from interface:ITextMetricsPerform a cleanup when this object is not required anymore- Specified by:
disposein interfaceITextMetrics
-
getLocale
public final java.util.Locale getLocale()
Description copied from interface:ITextMetricsReturns the locale associated with the text metrics implementer- Specified by:
getLocalein interfaceITextMetrics- Returns:
- The locale
-
getULocale
public final com.ibm.icu.util.ULocale getULocale()
Description copied from interface:ITextMetricsReturns the locale associated with the text metrics implementer- Specified by:
getULocalein interfaceITextMetrics- Returns:
- The locale
-
setLocale
public final void setLocale(com.ibm.icu.util.ULocale lcl)
Sets current locale.- Parameters:
lcl-
-
getFullHeight
public double getFullHeight(double fontHeight)
- Specified by:
getFullHeightin interfaceITextMetrics
-
getWidth
public double getWidth(int iIndex)
Description copied from interface:ITextMetricsThe text's width of associated with a line index.- Specified by:
getWidthin interfaceITextMetrics- Returns:
-
-