Class TextAdapter

  • All Implemented Interfaces:
    ITextMetrics

    public class TextAdapter
    extends java.lang.Object
    implements ITextMetrics
    A no-op adapter implementation for the ITextMetricsinterface definition.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextAdapter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Perform a cleanup when this object is not required anymore
      double getDescent()
      Returns the descent of a single line of text using the font defined in the contained label
      double getFullHeight()
      Returns the full height of all lines of text using the font defined in the contained label
      double getFullHeight​(double fontHeight)  
      double getFullWidth()
      Returns the max width of the widest line of text using the font defined in the contained label
      double getHeight()
      Returns the height of a single line of text using the font defined in the contained label
      java.lang.String getLine​(int iIndex)
      The text associated with a line index for multi-line text
      int getLineCount()
      Returns the number of lines of text associated with the label to be rendered
      java.util.Locale getLocale()
      Returns the locale associated with the text metrics implementer
      com.ibm.icu.util.ULocale getULocale()
      Returns the locale associated with the text metrics implementer
      double getWidth​(int iIndex)
      The text's width of associated with a line index.
      void reuse​(Label la)
      Permits reuse of the text metrics instance for a new label with new attributes.
      void reuse​(Label la, double forceWrappingSize)
      Permits reuse of the text metrics instance for a new label with new attributes and a forcing wrapping size.
      void setLocale​(com.ibm.icu.util.ULocale lcl)
      Sets current locale.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextAdapter

        public TextAdapter()
    • Method Detail

      • reuse

        public void reuse​(Label la)
        Description copied from interface: ITextMetrics
        Permits reuse of the text metrics instance for a new label with new attributes.
        Specified by:
        reuse in interface ITextMetrics
      • reuse

        public void reuse​(Label la,
                          double forceWrappingSize)
        Description copied from interface: ITextMetrics
        Permits reuse of the text metrics instance for a new label with new attributes and a forcing wrapping size.
        Specified by:
        reuse in interface ITextMetrics
      • getHeight

        public double getHeight()
        Description copied from interface: ITextMetrics
        Returns the height of a single line of text using the font defined in the contained label
        Specified by:
        getHeight in interface ITextMetrics
        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: ITextMetrics
        Returns the descent of a single line of text using the font defined in the contained label
        Specified by:
        getDescent in interface ITextMetrics
        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: ITextMetrics
        Returns the full height of all lines of text using the font defined in the contained label
        Specified by:
        getFullHeight in interface ITextMetrics
        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: ITextMetrics
        Returns the max width of the widest line of text using the font defined in the contained label
        Specified by:
        getFullWidth in interface ITextMetrics
        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: ITextMetrics
        Returns the number of lines of text associated with the label to be rendered
        Specified by:
        getLineCount in interface ITextMetrics
        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: ITextMetrics
        The text associated with a line index for multi-line text
        Specified by:
        getLine in interface ITextMetrics
        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: ITextMetrics
        Perform a cleanup when this object is not required anymore
        Specified by:
        dispose in interface ITextMetrics
      • getLocale

        public final java.util.Locale getLocale()
        Description copied from interface: ITextMetrics
        Returns the locale associated with the text metrics implementer
        Specified by:
        getLocale in interface ITextMetrics
        Returns:
        The locale
      • getULocale

        public final com.ibm.icu.util.ULocale getULocale()
        Description copied from interface: ITextMetrics
        Returns the locale associated with the text metrics implementer
        Specified by:
        getULocale in interface ITextMetrics
        Returns:
        The locale
      • setLocale

        public final void setLocale​(com.ibm.icu.util.ULocale lcl)
        Sets current locale.
        Parameters:
        lcl -
      • getWidth

        public double getWidth​(int iIndex)
        Description copied from interface: ITextMetrics
        The text's width of associated with a line index.
        Specified by:
        getWidth in interface ITextMetrics
        Returns: