Class SimpleTextLineWrapper

  • All Implemented Interfaces:
    TextLineWrapper

    public class SimpleTextLineWrapper
    extends java.lang.Object
    implements TextLineWrapper
    Author:
    Lucian Chirita (lucianc@users.sourceforge.net)
    • Field Detail

      • PROPERTY_MEASURE_EXACT

        public static final java.lang.String PROPERTY_MEASURE_EXACT
        See Also:
        Constant Field Values
      • PROPERTY_ELEMENT_CACHE_SIZE

        public static final java.lang.String PROPERTY_ELEMENT_CACHE_SIZE
        See Also:
        Constant Field Values
      • MEASURE_EXACT_ALWAYS

        public static final java.lang.String MEASURE_EXACT_ALWAYS
        See Also:
        Constant Field Values
      • MEASURE_EXACT_MULTILINE

        public static final java.lang.String MEASURE_EXACT_MULTILINE
        See Also:
        Constant Field Values
      • FONT_SIZE_MIN_FACTOR

        protected static final double FONT_SIZE_MIN_FACTOR
        See Also:
        Constant Field Values
      • FONT_WIDTH_CHECK_FACTOR

        protected static final double FONT_WIDTH_CHECK_FACTOR
        See Also:
        Constant Field Values
      • NEXT_BREAK_INDEX_THRESHOLD

        protected static final int NEXT_BREAK_INDEX_THRESHOLD
        See Also:
        Constant Field Values
      • FILL_CACHE_KEY_ELEMENT_FONT_INFOS

        protected static final java.lang.String FILL_CACHE_KEY_ELEMENT_FONT_INFOS
      • FILL_CACHE_KEY_GENERAL_FONT_INFOS

        protected static final java.lang.String FILL_CACHE_KEY_GENERAL_FONT_INFOS
    • Constructor Detail

      • SimpleTextLineWrapper

        public SimpleTextLineWrapper()
    • Method Detail

      • createFontInfo

        protected void createFontInfo​(java.util.Map<java.text.AttributedCharacterIterator.Attribute,​java.lang.Object> textAttributes)
      • getGeneralFontInfo

        protected SimpleTextLineWrapper.FontInfo getGeneralFontInfo​(java.util.Map<java.text.AttributedCharacterIterator.Attribute,​java.lang.Object> textAttributes)
      • loadFont

        protected java.awt.Font loadFont​(java.util.Map<java.text.AttributedCharacterIterator.Attribute,​java.lang.Object> textAttributes)
      • determineComplexLayout

        protected boolean determineComplexLayout​(java.awt.Font font)
      • determineLeading

        protected float determineLeading​(java.awt.Font font)
      • startParagraph

        public void startParagraph​(int paragraphStart,
                                   int paragraphEnd,
                                   boolean truncateAtChar)
        Specified by:
        startParagraph in interface TextLineWrapper
      • startParagraph

        protected void startParagraph​(java.lang.String text,
                                      int start,
                                      boolean truncateAtChar)
      • isLeftToRight

        protected boolean isLeftToRight​(char[] chars)
      • isParagraphMeasureExact

        protected boolean isParagraphMeasureExact​(char[] chars)
      • hasComplexLayout

        protected boolean hasComplexLayout​(char[] chars)
      • useExactLineMeasurement

        protected boolean useExactLineMeasurement()
      • measureExactLine

        protected TextLine measureExactLine​(float width,
                                            int endLimit,
                                            boolean requireWord)
      • measureExactLineBreakIndex

        protected int measureExactLineBreakIndex​(float width,
                                                 int endLimit,
                                                 boolean requireWord)
      • measureLine

        protected TextLine measureLine​(float width,
                                       boolean requireWord,
                                       int endLimit)
      • estimateBreakIndex

        protected int estimateBreakIndex​(float width,
                                         int endLimit)
      • measureParagraphFragment

        protected java.awt.geom.Rectangle2D measureParagraphFragment​(int measureIndex)
      • toTextLine

        protected TextLine toTextLine​(int measureIndex,
                                      java.awt.geom.Rectangle2D measuredBounds)
      • getLineText

        public java.lang.String getLineText​(int start,
                                            int end)
        Specified by:
        getLineText in interface TextLineWrapper