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
public class TableBox extends BlockBox
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTableBox.AutoTableLayoutprivate static classTableBox.FixedTableLayoutprivate static classTableBox.MarginTableLayoutA specialization ofAutoTableLayoutused for laying out the tables used to approximate the margin box layout algorithm from CSS3 GCPM.private static interfaceTableBox.TableLayout-
Nested classes/interfaces inherited from class com.openhtmltopdf.render.BlockBox
BlockBox.ContentType, BlockBox.MarginCollapseResult
-
Nested classes/interfaces inherited from class com.openhtmltopdf.render.Box
Box.ChildIteratorOfType<T>
-
-
Field Summary
Fields Modifier and Type Field Description private int[]_columnPosprivate java.util.List<ColumnData>_columnsprivate ContentLimitContainer_contentLimitContainerprivate int_extraSpaceBottomprivate int_extraSpaceTopprivate boolean_marginAreaRootprivate int_pageClearanceprivate java.util.List<TableColumn>_styleColumnsprivate TableBox.TableLayout_tableLayout-
Fields inherited from class com.openhtmltopdf.render.BlockBox
NO_BASELINE, POSITION_BOTH, POSITION_HORIZONTALLY, POSITION_VERTICALLY
-
Fields inherited from class com.openhtmltopdf.render.Box
CHILDREN_FLUX, DONE, DUMP_LAYOUT, DUMP_RENDER, FLUX, LINE_SEPARATOR, NOTHING
-
-
Constructor Summary
Constructors Constructor Description TableBox()
-
Method Summary
-
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, toString
-
Methods 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 Detail
-
_columns
private final java.util.List<ColumnData> _columns
-
_columnPos
private int[] _columnPos
-
_tableLayout
private TableBox.TableLayout _tableLayout
-
_styleColumns
private java.util.List<TableColumn> _styleColumns
-
_pageClearance
private int _pageClearance
-
_marginAreaRoot
private boolean _marginAreaRoot
-
_contentLimitContainer
private ContentLimitContainer _contentLimitContainer
-
_extraSpaceTop
private int _extraSpaceTop
-
_extraSpaceBottom
private int _extraSpaceBottom
-
-
Method Detail
-
isMarginAreaRoot
public boolean isMarginAreaRoot()
- Overrides:
isMarginAreaRootin classBox
-
setMarginAreaRoot
public void setMarginAreaRoot(boolean marginAreaRoot)
-
addStyleColumn
public void addStyleColumn(TableColumn col)
-
getStyleColumns
public java.util.List<TableColumn> 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
private java.lang.Iterable<TableSectionBox> getTableSections()
-
appendColumn
public void appendColumn(int span)
-
setStyle
public void setStyle(CalculatedStyle style)
-
calcMinMaxWidth
public void calcMinMaxWidth(LayoutContext c)
- Overrides:
calcMinMaxWidthin classBlockBox
-
splitColumn
public void splitColumn(int pos, int firstSpan)
-
marginsBordersPaddingAndSpacing
public int marginsBordersPaddingAndSpacing(CssContext c, boolean ignoreAutoMargins)
-
getColumns
public java.util.List<ColumnData> getColumns()
-
recalcSections
private void recalcSections(LayoutContext c)
-
calcBorders
private void calcBorders(LayoutContext c)
-
isAllowHeightToShrink
protected boolean isAllowHeightToShrink()
- Overrides:
isAllowHeightToShrinkin classBlockBox
-
layout
public void layout(LayoutContext c)
-
resolveAutoMargins
protected void resolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border)
- Overrides:
resolveAutoMarginsin classBlockBox
-
layoutTable
private void layoutTable(LayoutContext c)
-
layoutChildren
protected void layoutChildren(LayoutContext c, int contentStart)
- Overrides:
layoutChildrenin classBlockBox
-
layoutRunningHeader
private int layoutRunningHeader(LayoutContext c)
-
layoutRunningFooter
private int layoutRunningFooter(LayoutContext c)
-
isNeedAnalyzePageBreaks
private boolean isNeedAnalyzePageBreaks()
-
analyzePageBreaks
private void analyzePageBreaks(LayoutContext c)
-
analyzePageBreaks
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container)
- Overrides:
analyzePageBreaksin classBox
-
paintBackground
public void paintBackground(RenderingContext c)
- Overrides:
paintBackgroundin classBox
-
paintBorder
public void paintBorder(RenderingContext c)
- Overrides:
paintBorderin classBox
-
getContentLimitedBorderEdge
private java.awt.Rectangle getContentLimitedBorderEdge(RenderingContext c)
-
updateHeaderFooterPosition
public void updateHeaderFooterPosition(RenderingContext c)
-
updateHeaderPosition
private void updateHeaderPosition(RenderingContext c, ContentLimit limit)
-
updateFooterPosition
private void updateFooterPosition(RenderingContext c, ContentLimit limit)
-
calcPageClearance
private void calcPageClearance(LayoutContext c)
-
calcWidth
private void calcWidth()
-
getFirstRow
public TableRowBox getFirstRow()
-
getFirstBodyRow
public TableRowBox getFirstBodyRow()
-
setCellWidths
private void setCellWidths(LayoutContext c)
-
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
public void reset(LayoutContext c)
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
protected int getCSSWidth(CssContext c)
- Overrides:
getCSSWidthin classBlockBox
-
colElement
public TableColumn colElement(int col)
-
getColumnBounds
public java.awt.Rectangle getColumnBounds(CssContext c, int col)
-
getBorder
public BorderPropertySet getBorder(CssContext cssCtx)
-
calcFixedHeightRowBottom
public int calcFixedHeightRowBottom(CssContext c)
-
isMayCollapseMarginsWithChildren
protected boolean isMayCollapseMarginsWithChildren()
- Overrides:
isMayCollapseMarginsWithChildrenin classBlockBox
-
sectionAbove
protected TableSectionBox sectionAbove(TableSectionBox section, boolean skipEmptySections)
-
sectionBelow
protected TableSectionBox sectionBelow(TableSectionBox section, boolean skipEmptySections)
-
cellAbove
protected TableCellBox cellAbove(TableCellBox cell)
-
cellBelow
protected TableCellBox cellBelow(TableCellBox cell)
-
cellLeft
protected TableCellBox cellLeft(TableCellBox cell)
-
cellRight
protected TableCellBox cellRight(TableCellBox cell)
-
calcInlineBaseline
public int calcInlineBaseline(CssContext c)
- Overrides:
calcInlineBaselinein classBlockBox
-
getPageClearance
protected int getPageClearance()
- Overrides:
getPageClearancein classBlockBox
-
setPageClearance
protected void setPageClearance(int pageClearance)
-
hasContentLimitContainer
public boolean hasContentLimitContainer()
-
isTableRenderedOnFirstPage
public boolean isTableRenderedOnFirstPage(RenderingContext context)
- 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)
-
-