Class TextSequenceWordWrapping


  • final class TextSequenceWordWrapping
    extends java.lang.Object
    • Field Detail

      • OCCUPIED_AREA_RELAYOUT_EPS

        private static final float OCCUPIED_AREA_RELAYOUT_EPS
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextSequenceWordWrapping

        private TextSequenceWordWrapping()
    • Method Detail

      • isTextRendererAndRequiresSpecialScriptPreLayoutProcessing

        public static boolean isTextRendererAndRequiresSpecialScriptPreLayoutProcessing​(IRenderer childRenderer)
      • processSpecialScriptPreLayout

        public static void processSpecialScriptPreLayout​(LineRenderer lineRenderer,
                                                         int childPos)
        Preprocess a continuous sequence of TextRenderer containing special scripts prior to layouting the first TextRenderer in the sequence.

        In this method we preprocess a sequence containing special scripts only, skipping floating renderers as they're not part of a regular layout flow, and breaking the prelayout processing once a non-special script containing renderer occurs. Note! Even though floats are skipped during calculating correct word boundaries, floats themselves are considered as soft-wrap opportunities.

        Prelayout processing includes the following steps:

        Parameters:
        lineRenderer - line renderer containing text sequence to process
        childPos - index of the childRenderer in LineRenderer#childRenderers from which the a continuous sequence of TextRenderer containing special scripts starts
      • updateTextSequenceLayoutResults

        public static void updateTextSequenceLayoutResults​(java.util.Map<java.lang.Integer,​LayoutResult> textRendererLayoutResults,
                                                           boolean specialScripts,
                                                           IRenderer childRenderer,
                                                           int childPos,
                                                           LayoutResult childResult)
      • getIndexAndLayoutResultOfTheLastTextRendererWithNoSpecialScripts

        public static TextSequenceWordWrapping.LastFittingChildRendererData getIndexAndLayoutResultOfTheLastTextRendererWithNoSpecialScripts​(LineRenderer lineRenderer,
                                                                                                                                             int childPos,
                                                                                                                                             java.util.Map<java.lang.Integer,​LayoutResult> textSequenceLayoutResults,
                                                                                                                                             boolean wasParentsHeightClipped,
                                                                                                                                             boolean isOverflowFit,
                                                                                                                                             boolean floatsPlaced)
      • getIndexAndLayoutResultOfTheLastTextRendererContainingSpecialScripts

        public static TextSequenceWordWrapping.LastFittingChildRendererData getIndexAndLayoutResultOfTheLastTextRendererContainingSpecialScripts​(LineRenderer lineRenderer,
                                                                                                                                                 int childPos,
                                                                                                                                                 java.util.Map<java.lang.Integer,​LayoutResult> specialScriptLayoutResults,
                                                                                                                                                 boolean wasParentsHeightClipped,
                                                                                                                                                 boolean isOverflowFit)
      • preprocessTextSequenceOverflowX

        public static void preprocessTextSequenceOverflowX​(LineRenderer lineRenderer,
                                                           boolean textSequenceOverflowXProcessing,
                                                           IRenderer childRenderer,
                                                           boolean wasXOverflowChanged,
                                                           OverflowPropertyValue oldXOverflow)
        Performs some settings on LineRenderer and its child prior to layouting the child to be overflowed beyond the available area.
        Parameters:
        lineRenderer - line renderer containing text sequence to process
        textSequenceOverflowXProcessing - true if it is TextRenderer sequence processing in overflowX mode
        childRenderer - the LineRenderer's child to be preprocessed
        wasXOverflowChanged - true if value of Property.OVERFLOW_X has been changed during layouting
        oldXOverflow - the value of Property.OVERFLOW_X before it's been changed during layouting of LineRenderer or null if Property.OVERFLOW_X hasn't been changed
      • distributePossibleBreakPointsOverSequentialTextRenderers

        static void distributePossibleBreakPointsOverSequentialTextRenderers​(LineRenderer lineRenderer,
                                                                             int childPos,
                                                                             int numberOfSequentialTextRenderers,
                                                                             java.util.List<java.lang.Integer> possibleBreakPointsGlobal,
                                                                             java.util.List<java.lang.Integer> indicesOfFloating)
      • getCurWidthRelayoutedTextSequenceDecrement

        static float getCurWidthRelayoutedTextSequenceDecrement​(int childPos,
                                                                int newChildPos,
                                                                java.util.Map<java.lang.Integer,​LayoutResult> textRendererLayoutResults)
      • convertPossibleBreakPointsToGlyphLineBased

        private static java.util.List<java.lang.Integer> convertPossibleBreakPointsToGlyphLineBased​(java.util.List<java.lang.Integer> possibleBreakPoints,
                                                                                                    java.util.List<java.lang.Integer> amountOfChars,
                                                                                                    java.util.List<java.lang.Integer> indices)
      • fillActualTextChunkRelatedLists

        private static void fillActualTextChunkRelatedLists​(GlyphLine glyphLine,
                                                            java.util.List<java.lang.Integer> amountOfCharsBetweenTextStartAndActualTextChunk,
                                                            java.util.List<java.lang.Integer> glyphLineBasedIndicesOfActualTextChunkEnds)