Package com.openhtmltopdf.newtable
Class TableBox
java.lang.Object
com.openhtmltopdf.render.Box
com.openhtmltopdf.render.BlockBox
com.openhtmltopdf.newtable.TableBox
- All Implemented Interfaces:
InlinePaintable,Styleable,DisplayListItem
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classA specialization ofAutoTableLayoutused for laying out the tables used to approximate the margin box layout algorithm from CSS3 GCPM.private static interfaceNested classes/interfaces inherited from class com.openhtmltopdf.render.BlockBox
BlockBox.ContentType, BlockBox.MarginCollapseResultNested classes/interfaces inherited from class com.openhtmltopdf.render.Box
Box.ChildIteratorOfType<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]private final List<ColumnData> private ContentLimitContainerprivate intprivate intprivate booleanprivate intprivate List<TableColumn> private TableBox.TableLayoutFields inherited from class com.openhtmltopdf.render.BlockBox
NO_BASELINE, POSITION_BOTH, POSITION_HORIZONTALLY, POSITION_VERTICALLYFields inherited from class com.openhtmltopdf.render.Box
CHILDREN_FLUX, DONE, DUMP_LAYOUT, DUMP_RENDER, FLUX, LINE_SEPARATOR, NOTHING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate voidvoidanalyzePageBreaks(LayoutContext c, ContentLimitContainer container) voidappendColumn(int span) private voidintintprotected voidcalcLayoutHeight(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding) Oh oh! Up to this method height is used to track content height.voidprivate voidprivate voidprotected TableCellBoxcellAbove(TableCellBox cell) protected TableCellBoxcellBelow(TableCellBox cell) protected TableCellBoxcellLeft(TableCellBox cell) protected TableCellBoxcellRight(TableCellBox cell) colElement(int col) intcolToEffCol(int col) copyOf()inteffColToCol(int effCol) getBorder(CssContext cssCtx) getColumnBounds(CssContext c, int col) int[]private Rectangleprotected intintintprotected intprivate Iterable<TableSectionBox> booleanprotected booleanbooleanprotected booleanprivate booleanbooleanvoidprotected voidlayoutChildren(LayoutContext c, int contentStart) private intprivate intprivate voidintmarginsBordersPaddingAndSpacing(CssContext c, boolean ignoreAutoMargins) intvoidvoidprivate voidvoidResponsible for resetting the state of the box before a repeat call toBlockBox.layout(LayoutContext)or other layout methods.protected voidresolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) protected TableSectionBoxsectionAbove(TableSectionBox section, boolean skipEmptySections) protected TableSectionBoxsectionBelow(TableSectionBox section, boolean skipEmptySections) private voidprivate voidsetColumnPos(int[] columnPos) voidsetExtraSpaceBottom(int extraSpaceBottom) voidsetExtraSpaceTop(int extraSpaceTop) voidsetMarginAreaRoot(boolean marginAreaRoot) protected voidsetPageClearance(int pageClearance) voidsetStyle(CalculatedStyle style) intspanOfEffCol(int effCol) voidsplitColumn(int pos, int firstSpan) private voidupdateFooterPosition(RenderingContext c, ContentLimit limit) voidprivate voidupdateHeaderPosition(RenderingContext c, ContentLimit limit) Methods inherited from class com.openhtmltopdf.render.BlockBox
addBoxID, appendPositioningInfo, calcBaseline, calcBreakAtLineContext, calcCanvasLocation, calcChildLocations, calcChildPaintingInfo, calcDimensions, calcDimensions, calcInitialBreakAtLine, calcInitialFloatedCanvasLocation, checkPageContext, checkPopBfc, checkPushBfc, checkPushLayer, collapseMargins, createMarkerData, dump, ensureChildren, findLastNthLineBox, findOffset, getAvailableWidth, getChildrenContentType, getChildrenHeight, getCSSFitToWidth, getCSSHeight, getCSSWidth, getDocumentParent, getExtraBoxDescription, getFirstLetterStyle, getFirstLineStyle, getFloatedBoxData, getInlineContent, getLineBox, getListCounter, getMarkerData, getMaxWidth, getMinWidth, getNextCollapsableSibling, getPaintingClipEdge, getPersistentBFC, getReplacedElement, getStaticEquivalent, initStaticPos, isAutoHeight, isBottomMarginCalculated, isContainsInlineContent, isCurrentBreakAtLineContext, isFixedWidthAdvisoryOnly, isFloated, isFromCaptionedTable, isInline, isInlineBlock, isInMainFlow, isListItem, isMinMaxCalculated, isNeedPageClear, isNeedsClipOnPaint, isNeedsKeepWithInline, isPageBreakNeededBecauseOfMinHeight, isReplaced, isSkipWhenCollapsingMargins, isTopMarginCalculated, layout, layoutInlineChildren, paintDebugOutline, paintInline, paintListMarker, positionAbsolute, positionAbsoluteOnPage, propagateExtraSpace, setBottomMarginCalculated, setChildrenContentType, setChildrenHeight, setDimensionsCalculated, setElement, setFirstLetterStyle, setFirstLineStyle, setFloatedBoxData, setFromCaptionedTable, setInlineContent, setListCounter, setMarkerData, setMaxWidth, setMinMaxCalculated, setMinWidth, setNeedPageClear, setNeedShrinkToFitCalculatation, setPersistentBFC, setReplacedElement, setStaticEquivalent, setTopMarginCalculated, shouldBeReplaced, styleText, styleText, toStringMethods inherited from class com.openhtmltopdf.render.Box
addAllChildren, addChild, addChildForLayout, ancestors, ancestorsWhile, calcPaintingInfo, collectText, connectChildrenToCurrentLayer, crossesPageBreak, detach, dumpBoxes, exportPageBoxText, exportText, find, findAncestor, findColumnBreakOpportunities, forcePageBreakAfter, forcePageBreakBefore, forcePageBreakBefore, getAbsoluteClipBox, getAbsX, getAbsY, getAccessibilityObject, getBorderBox, getBorderBoxHeight, getBorderBoxWidth, getBorderEdge, getBorderSides, getBoxDimensions, getChild, getChildCount, getChildIterator, getChildIteratorOfType, getChildren, getChildrenClipEdge, getClipBox, getContainingBlock, getContainingBlockWidth, getContainingLayer, getContentAreaEdge, getContentWidth, getEffBackgroundColor, getEffectiveWidth, getElement, getElementBoxes, getHeight, getIndex, getLayer, getLeftMBP, getMargin, getMarginBorderPadding, getMarginEdge, getMarginEdge, getNext, getNextSibling, getPadding, getPaddingEdge, getPaddingWidth, getPaintingBorderEdge, getPaintingInfo, getPaintingPaddingEdge, getParent, getParentClipBox, getPrevious, getPreviousSibling, getPseudoElementOrClass, getRelativeOffset, getRightMBP, getState, getStyle, getStyleMargin, getStyleMargin, getTx, getTy, getWidth, getX, getY, hasNonTextContent, hasRootElementBackground, initContainingLayer, intersects, isAnonymous, isBody, isContainedInMarginBox, isFirstChild, isInDocumentFlow, isInitialContainingBlock, isRoot, isStyled, isTerminalColumnBreak, moveIfGreater, paintRootElementBackground, positionRelative, removeAllChildren, removeChild, removeChild, resetChildren, resetChildren, resetTopMargin, rootBox, setAbsX, setAbsY, setAccessiblityObject, setAnonymous, setBorderBoxHeight, setBorderBoxWidth, setBoxDimensions, setContainingBlock, setContainingLayer, setContentWidth, setHeight, setIndex, setLayer, setLeftMBP, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setParent, setPseudoElementOrClass, setRelativeOffset, setRightMBP, setState, setTx, setTy, setX, setY, stateToString
-
Field Details
-
_columns
-
_columnPos
private int[] _columnPos -
_tableLayout
-
_styleColumns
-
_pageClearance
private int _pageClearance -
_marginAreaRoot
private boolean _marginAreaRoot -
_contentLimitContainer
-
_extraSpaceTop
private int _extraSpaceTop -
_extraSpaceBottom
private int _extraSpaceBottom
-
-
Constructor Details
-
TableBox
public TableBox()
-
-
Method Details
-
isMarginAreaRoot
public boolean isMarginAreaRoot()- Overrides:
isMarginAreaRootin classBox
-
setMarginAreaRoot
public void setMarginAreaRoot(boolean marginAreaRoot) -
copyOf
-
addStyleColumn
-
getStyleColumns
-
getColumnPos
public int[] getColumnPos() -
setColumnPos
private void setColumnPos(int[] columnPos) -
numEffCols
public int numEffCols() -
spanOfEffCol
public int spanOfEffCol(int effCol) -
colToEffCol
public int colToEffCol(int col) -
effColToCol
public int effColToCol(int effCol) -
getTableSections
-
appendColumn
public void appendColumn(int span) -
setStyle
-
calcMinMaxWidth
- Overrides:
calcMinMaxWidthin classBlockBox
-
splitColumn
public void splitColumn(int pos, int firstSpan) -
marginsBordersPaddingAndSpacing
-
getColumns
-
recalcSections
-
calcBorders
-
isAllowHeightToShrink
protected boolean isAllowHeightToShrink()- Overrides:
isAllowHeightToShrinkin classBlockBox
-
layout
-
resolveAutoMargins
protected void resolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) - Overrides:
resolveAutoMarginsin classBlockBox
-
layoutTable
-
layoutChildren
- Overrides:
layoutChildrenin classBlockBox
-
layoutRunningHeader
-
isNeedAnalyzePageBreaks
private boolean isNeedAnalyzePageBreaks() -
analyzePageBreaks
-
analyzePageBreaks
- Overrides:
analyzePageBreaksin classBox
-
paintBackground
- Overrides:
paintBackgroundin classBox
-
paintBorder
- Overrides:
paintBorderin classBox
-
getContentLimitedBorderEdge
-
updateHeaderPosition
-
calcPageClearance
-
calcWidth
private void calcWidth() -
getFirstRow
-
getFirstBodyRow
-
setCellWidths
-
calcLayoutHeight
protected void calcLayoutHeight(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding) Description copied from class:BlockBoxOh oh! Up to this method height is used to track content height. After this method it is used to track total layout height!- Overrides:
calcLayoutHeightin classBlockBox
-
reset
Description copied from class:BoxResponsible for resetting the state of the box before a repeat call toBlockBox.layout(LayoutContext)or other layout methods.
Any layout operation that is not idempotent MUST be reset in this method. Layout may be called several times on the one box. -
getCSSWidth
- Overrides:
getCSSWidthin classBlockBox
-
colElement
-
getColumnBounds
-
getBorder
-
calcFixedHeightRowBottom
-
isMayCollapseMarginsWithChildren
protected boolean isMayCollapseMarginsWithChildren()- Overrides:
isMayCollapseMarginsWithChildrenin classBlockBox
-
sectionAbove
-
sectionBelow
-
cellAbove
-
cellBelow
-
cellLeft
-
cellRight
-
calcInlineBaseline
- Overrides:
calcInlineBaselinein classBlockBox
-
getPageClearance
protected int getPageClearance()- Overrides:
getPageClearancein classBlockBox
-
setPageClearance
protected void setPageClearance(int pageClearance) -
hasContentLimitContainer
public boolean hasContentLimitContainer() -
isTableRenderedOnFirstPage
- Returns:
- true if the table is rendered on its first page. false if the table is rendered after a page break
-
getExtraSpaceTop
public int getExtraSpaceTop() -
setExtraSpaceTop
public void setExtraSpaceTop(int extraSpaceTop) -
getExtraSpaceBottom
public int getExtraSpaceBottom() -
setExtraSpaceBottom
public void setExtraSpaceBottom(int extraSpaceBottom)
-