Package org.apache.fop.layoutmgr.table
Class ActiveCell
java.lang.Object
org.apache.fop.layoutmgr.table.ActiveCell
A cell playing in the construction of steps for a row-group.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
Auxiliary class to store all the informations related to a breaking step. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ActiveCell.Step
The step following nextStep.private int
private int
private int
private int
private List
Knuth elements for this active cell.private int
Number of the row where the row-span ends, zero-based.private int
Length of the Knuth elements already included in the steps.private Keep
private ListIterator
Iterator over the Knuth element list.private boolean
True if the next CellPart that will be created will be the last one for this cell.private static org.apache.commons.logging.Log
private ActiveCell.Step
private int
private int
private int
private int
private PrimaryGridUnit
private ActiveCell.Step
private int
Length of the Knuth elements not yet included in the steps.private int
private int
Total length of this cell's content plus the lengths of the previous rows. -
Constructor Summary
ConstructorsConstructorDescriptionActiveCell
(PrimaryGridUnit pgu, EffRow row, int rowIndex, int previousRowsLength, TableLayoutManager tableLM) -
Method Summary
Modifier and TypeMethodDescription(package private) 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.(package private) CellPart
Creates and returns a CellPart instance for the content of this cell which is included in the next step.(package private) void
endRow
(int rowIndex) Receives indication that the current row is ending, and that (collapse) borders must be updated accordingly.(package private) boolean
endsOnRow
(int rowIndex) Returns true if this cell ends on the given row.(package private) boolean
finishes
(int step) Returns true if this cell would be finished after the given step.(package private) static int
Returns the actual length of the content represented by the given element.(package private) int
Returns the minimal step that is needed for this cell to contribute some content.(package private) Keep
(package private) int
Returns the last step for this cell.(package private) int
Returns the total length up to the next legal break, not yet included in the steps.(package private) int
(package private) PrimaryGridUnit
(package private) int
Returns the length of this cell's content not yet included in the steps, plus the cell's borders and paddings if applicable.private void
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.private boolean
private void
increaseCurrentStep
(int limit) Increases the next step up to the given limit.(package private) void
Receives indication that the next row is about to start, and that (collapse) borders must be updated accordingly.(package private) 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.(package private) void
signalRowFirstStep
(int firstStep) Gets the selected first step for the current row.(package private) void
signalRowLastStep
(int lastStep) toString()
-
Field Details
-
log
private static org.apache.commons.logging.Log log -
pgu
-
elementList
Knuth elements for this active cell. -
knuthIter
Iterator over the Knuth element list. -
endRowIndex
private int endRowIndexNumber of the row where the row-span ends, zero-based. -
remainingLength
private int remainingLengthLength of the Knuth elements not yet included in the steps. -
totalLength
private int totalLengthTotal length of this cell's content plus the lengths of the previous rows. -
includedLength
private int includedLengthLength 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 lastCellPartTrue if the next CellPart that will be created will be the last one for this cell. -
keepWithNext
-
spanIndex
private int spanIndex -
previousStep
-
nextStep
-
afterNextStep
The step following nextStep. Computing it early allows to calculateActiveCell.Step.condBeforeContentLength
, thus to easily determine the remaining length. That also helps forincreaseCurrentStep(int)
.
-
-
Constructor Details
-
ActiveCell
ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex, int previousRowsLength, TableLayoutManager tableLM)
-
-
Method Details
-
getElementContentLength
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
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 (seesignalNextStep(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
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
-