Class ActiveCell


  • class ActiveCell
    extends java.lang.Object
    A cell playing in the construction of steps for a row-group.
    • Field Detail

      • log

        private static org.apache.commons.logging.Log log
      • elementList

        private java.util.List elementList
        Knuth elements for this active cell.
      • knuthIter

        private java.util.ListIterator knuthIter
        Iterator over the Knuth element list.
      • endRowIndex

        private int endRowIndex
        Number of the row where the row-span ends, zero-based.
      • remainingLength

        private int remainingLength
        Length of the Knuth elements not yet included in the steps.
      • totalLength

        private int totalLength
        Total length of this cell's content plus the lengths of the previous rows.
      • includedLength

        private int includedLength
        Length of the Knuth elements already included in the steps.
      • paddingBeforeNormal

        private int paddingBeforeNormal
      • paddingBeforeLeading

        private int paddingBeforeLeading
      • paddingAfterNormal

        private int paddingAfterNormal
      • paddingAfterTrailing

        private int paddingAfterTrailing
      • bpBeforeNormal

        private int bpBeforeNormal
      • bpBeforeLeading

        private int bpBeforeLeading
      • bpAfterNormal

        private int bpAfterNormal
      • bpAfterTrailing

        private int bpAfterTrailing
      • lastCellPart

        private boolean lastCellPart
        True if the next CellPart that will be created will be the last one for this cell.
      • keepWithNext

        private Keep keepWithNext
      • spanIndex

        private int spanIndex
    • Method Detail

      • getElementContentLength

        static int getElementContentLength​(KnuthElement el)
        Returns the actual length of the content represented by the given element. In the case where this element is used as a filler to match a row's fixed height, the value returned by the getW() method will be higher than the actual content.
        Parameters:
        el - an element
        Returns:
        the actual content length corresponding to the element
      • handleExplicitHeight

        private void handleExplicitHeight​(MinOptMax cellBPD,
                                          MinOptMax rowBPD)
        Modifies the cell's element list by putting filler elements, so that the cell's or row's explicit height is always reached. TODO this will work properly only for the first break. Then the limitation explained on http://wiki.apache.org/xmlgraphics-fop/TableLayout/KnownProblems occurs. The list of elements needs to be re-adjusted after each break.
      • endsOnRow

        boolean endsOnRow​(int rowIndex)
        Returns true if this cell ends on the given row.
        Parameters:
        rowIndex - index of a row in the row-group, zero-based
        Returns:
        true if this cell ends on the given row
      • getRemainingLength

        int getRemainingLength()
        Returns the length of this cell's content not yet included in the steps, plus the cell's borders and paddings if applicable.
        Returns:
        the remaining length, zero if the cell is finished
      • gotoNextLegalBreak

        private void gotoNextLegalBreak()
      • getFirstStep

        int getFirstStep()
        Returns the minimal step that is needed for this cell to contribute some content.
        Returns:
        the step for this cell's first legal break
      • getLastStep

        int getLastStep()
        Returns the last step for this cell. This includes the normal border- and padding-before, the whole content, the normal padding-after, and the trailing after border. Indeed, if the normal border is taken instead, and appears to be smaller than the trailing one, the last step may be smaller than the current step (see TableStepper#considerRowLastStep). This will produce a wrong infinite penalty, plus the cell's content won't be taken into account since the final step will be smaller than the current one (see signalNextStep(int)). This actually means that the content will be swallowed.
        Returns:
        the length of last step
      • increaseCurrentStep

        private void increaseCurrentStep​(int limit)
        Increases the next step up to the given limit.
        Parameters:
        limit - the length up to which the next step is allowed to increase
        See Also:
        signalRowFirstStep(int), signalRowLastStep(int)
      • signalRowFirstStep

        void signalRowFirstStep​(int firstStep)
        Gets the selected first step for the current row. If this cell's first step is smaller, then it may be able to add some more of its content, since there will be no break before the given step anyway.
        Parameters:
        firstStep - the current row's first step
      • getNextStep

        int getNextStep()
        Returns the total length up to the next legal break, not yet included in the steps.
        Returns:
        the total length up to the next legal break (-1 signals no further step)
      • includedInLastStep

        private boolean includedInLastStep()
      • nextRowStarts

        void nextRowStarts()
        Receives indication that the next row is about to start, and that (collapse) borders must be updated accordingly.
      • endRow

        void endRow​(int rowIndex)
        Receives indication that the current row is ending, and that (collapse) borders must be updated accordingly.
        Parameters:
        rowIndex - the index of the ending row
      • finishes

        boolean finishes​(int step)
        Returns true if this cell would be finished after the given step. That is, it would be included in the step and the end of its content would be reached.
        Parameters:
        step - the next step
        Returns:
        true if this cell finishes at the given step
      • createCellPart

        CellPart createCellPart()
        Creates and returns a CellPart instance for the content of this cell which is included in the next step.
        Returns:
        a CellPart instance
      • addFootnotes

        void addFootnotes​(java.util.List footnoteList)
        Adds the footnotes (if any) that are part of the next step, if this cell contributes content to the next step.
        Parameters:
        footnoteList - the list to which this cell must add its footnotes
      • getKeepWithNext

        Keep getKeepWithNext()
      • getPenaltyValue

        int getPenaltyValue()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object