Class ActiveCell

java.lang.Object
org.apache.fop.layoutmgr.table.ActiveCell

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

    • log

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

      private PrimaryGridUnit pgu
    • elementList

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

      private 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
    • previousStep

      private ActiveCell.Step previousStep
    • nextStep

      private ActiveCell.Step nextStep
    • afterNextStep

      private ActiveCell.Step afterNextStep
      The step following nextStep. Computing it early allows to calculate ActiveCell.Step.condBeforeContentLength, thus to easily determine the remaining length. That also helps for increaseCurrentStep(int).
  • Constructor Details

  • Method Details

    • 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.
    • getPrimaryGridUnit

      PrimaryGridUnit getPrimaryGridUnit()
    • 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

      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
    • signalRowLastStep

      void signalRowLastStep(int lastStep)
    • 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()
    • signalNextStep

      int signalNextStep(int minStep)
      Signals the length of the chosen next step, so that this cell determines whether its own step may be included or not.
      Parameters:
      minStep - length of the chosen next step
      Returns:
      the break class of the step, if any. One of Constants.EN_AUTO, Constants.EN_COLUMN, Constants.EN_PAGE, Constants.EN_EVEN_PAGE, Constants.EN_ODD_PAGE. EN_AUTO if this cell's step is not included in the next step.
    • 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(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 String toString()
      Overrides:
      toString in class Object