Class LineLayoutManager.LineBreakingAlgorithm

    • Field Detail

      • pageAlignment

        private final int pageAlignment
      • activePossibility

        private int activePossibility
      • addedPositions

        private int addedPositions
      • textIndent

        private final int textIndent
      • lineHeight

        private final int lineHeight
      • lead

        private final int lead
      • follow

        private final int follow
    • Constructor Detail

      • LineBreakingAlgorithm

        public LineBreakingAlgorithm​(int pageAlign,
                                     int textAlign,
                                     int textAlignLast,
                                     int indent,
                                     int fillerWidth,
                                     int lh,
                                     int ld,
                                     int fl,
                                     boolean first,
                                     int maxFlagCount,
                                     LineLayoutManager llm)
    • Method Detail

      • updateData1

        public void updateData1​(int lineCount,
                                double demerits)
        Description copied from class: BreakingAlgorithm
        Empty method, hook for subclasses. Called before determining the optimal breakpoints corresponding to a given active node.
        Specified by:
        updateData1 in class BreakingAlgorithm
        Parameters:
        lineCount - number of lines for the active node
        demerits - total demerits of the paragraph for the active node
      • updateData2

        public void updateData2​(BreakingAlgorithm.KnuthNode bestActiveNode,
                                KnuthSequence par,
                                int total)
        Description copied from class: BreakingAlgorithm
        Empty method, hook for subclasses. Called when determining the optimal breakpoints for a given active node.
        Specified by:
        updateData2 in class BreakingAlgorithm
        Parameters:
        bestActiveNode - a node in the chain of best active nodes, corresponding to one of the optimal breakpoints
        par - the corresponding paragraph
        total - the number of lines into which the paragraph will be broken
      • resetAlgorithm

        public void resetAlgorithm()
      • makeLineBreakPosition

        private LineLayoutManager.LineBreakPosition makeLineBreakPosition​(KnuthSequence par,
                                                                          int firstElementIndex,
                                                                          int lastElementIndex,
                                                                          int availableShrink,
                                                                          int availableStretch,
                                                                          int difference,
                                                                          double ratio,
                                                                          int startIndent,
                                                                          int endIndent)