Package com.openhtmltopdf.layout
Class LayoutContext
java.lang.Object
com.openhtmltopdf.layout.LayoutContext
- All Implemented Interfaces:
CssContext
This class tracks state which changes over the course of a layout run.
Generally speaking, if possible, state information should be stored in the box
tree and not here. It also provides pass-though calls to many methods in
SharedContext
.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LinkedList
<BlockFormattingContext> private BidiReorderer
private BidiSplitterFactory
private LayoutContext.BlockBoxingState
private BreakAtLineContext
private final ContentFunctionFactory
final Map
<CalculatedStyle, CounterContext> private MarkerData
private byte
private int
private int
private StyleTracker
private StyleTracker
private FontContext
private int
private FootnoteManager
private boolean
private boolean
private LinkedList
<Layer> private boolean
private boolean
private int
private PageBox
private String
private String
private Layer
private Layer
private LayoutState
private SharedContext
private final ParagraphSplitter
private Boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
The bidi splitter is used to split text runs into LTR and RTL visual ordering.getCounterContext
(CalculatedStyle style) getCss()
byte
int
int
Returns the extra space set aside for the footers of paginated tables.int
Returns the extra space set aside for the head section of paginated tables.getFont
(FontSpecification font) float
int
The zero-based footnote index, which will likely be different from any counter used with the footnote.Gets the document's footnote manager, creating it if required.getFSFontMetrics
(FSFont font) getLayer()
float
int
getPage()
The paragraph splitter splits the document into paragraphs for the purpose of bi-directional text analysis.getUac()
float
getXHeight
(FontSpecification parentFont) boolean
boolean
Whether further footnote content is allowed.boolean
Returns true if we are laying out the footnote area rather than general content.boolean
boolean
boolean
boolean
boolean
isPrint()
void
popBFC()
void
popLayer()
void
void
void
void
pushLayerIsolated
(Box master) void
reInit
(boolean keepLayers) void
removeBoxId
(String id) void
resolveCounters
(CalculatedStyle style) void
resolveCounters
(CalculatedStyle style, Integer startIndex) void
restoreLayoutState
(LayoutState layoutState) void
restoreStateForRelayout
(LayoutState layoutState) void
setBidiReorderer
(BidiReorderer reorderer) void
The bidi splitter is used to split text runs into LTR and RTL visual ordering.void
void
setBreakAtLineContext
(BreakAtLineContext breakAtLineContext) void
setCurrentMarkerData
(MarkerData currentMarkerData) void
setDefaultTextDirection
(byte direction) void
setExtraSpaceBottom
(int extraSpaceBottom) void
setExtraSpaceTop
(int extraSpaceTop) void
setFirstLettersTracker
(StyleTracker firstLetters) void
setFirstLinesTracker
(StyleTracker firstLines) void
setFontContext
(FontContext fontContext) void
setFootnoteAllowed
(boolean allowed) SeeisFootnoteAllowed()
.void
setFootnoteIndex
(int footnoteIndex) void
setIsInFloatBottom
(boolean inFloatBottom) void
setIsPrintOverride
(Boolean isPrint) void
setLineBreakedBecauseOfNoWrap
(boolean value) void
setMayCheckKeepTogether
(boolean mayKeepTogether) void
setNoPageBreak
(int noPageBreak) void
void
setPageName
(String currentPageName) void
setPendingPageName
(String pendingPageName) void
setRootDocumentLayer
(Layer rootDocumentLayer) void
translate
(int x, int y)
-
Field Details
-
_blockBoxingState
-
_rootLayer
-
_firstLines
-
_firstLetters
-
_currentMarkerData
-
_bfcs
-
_layers
-
_fontContext
-
_contentFunctionFactory
-
_extraSpaceTop
private int _extraSpaceTop -
_extraSpaceBottom
private int _extraSpaceBottom -
_counterContextMap
-
_pendingPageName
-
_pageName
-
_noPageBreak
private int _noPageBreak -
_rootDocumentLayer
-
_page
-
_mayCheckKeepTogether
private boolean _mayCheckKeepTogether -
_lineBreakedBecauseOfNoWrap
private boolean _lineBreakedBecauseOfNoWrap -
_breakAtLineContext
-
isPrintOverride
-
_isInFloatBottom
private boolean _isInFloatBottom -
_savedLayoutState
-
_footnoteIndex
private int _footnoteIndex -
_footnoteManager
-
_isFootnoteAllowed
private boolean _isFootnoteAllowed -
_splitter
-
_bidiSplitterFactory
-
_defaultTextDirection
private byte _defaultTextDirection -
_bidiReorderer
-
-
Constructor Details
-
Method Details
-
getTextRenderer
- Specified by:
getTextRenderer
in interfaceCssContext
-
getCss
- Specified by:
getCss
in interfaceCssContext
-
getCanvas
-
getFixedRectangle
-
getNamespaceHandler
-
getParagraphSplitter
The paragraph splitter splits the document into paragraphs for the purpose of bi-directional text analysis. -
setBidiReorderer
-
getBidiReorderer
-
getBidiSplitterFactory
The bidi splitter is used to split text runs into LTR and RTL visual ordering. -
setBidiSplitterFactory
The bidi splitter is used to split text runs into LTR and RTL visual ordering. -
getDefaultTextDirection
public byte getDefaultTextDirection()- Returns:
- the default text direction for a document.
-
setDefaultTextDirection
public void setDefaultTextDirection(byte direction) - Parameters:
direction
- either BidiSplitter.LTR or BidiSplitter.RTL.
-
reInit
public void reInit(boolean keepLayers) -
captureLayoutState
-
restoreLayoutState
-
copyStateForRelayout
-
restoreStateForRelayout
-
getBlockFormattingContext
-
pushBFC
-
popBFC
public void popBFC() -
pushLayerIsolated
-
pushLayer
-
pushLayer
-
popLayer
public void popLayer() -
getLayer
-
getRootLayer
-
translate
public void translate(int x, int y) -
addBoxId
-
removeBoxId
-
isInteractive
public boolean isInteractive() -
getMmPerDot
public float getMmPerDot()- Specified by:
getMmPerDot
in interfaceCssContext
-
getDotsPerPixel
public int getDotsPerPixel()- Specified by:
getDotsPerPixel
in interfaceCssContext
-
getFontSize2D
- Specified by:
getFontSize2D
in interfaceCssContext
-
getXHeight
- Specified by:
getXHeight
in interfaceCssContext
-
getFont
- Specified by:
getFont
in interfaceCssContext
-
getUac
-
isPrint
public boolean isPrint() -
setIsPrintOverride
- Parameters:
isPrint
- true, false or null for no override.
-
getFirstLinesTracker
-
getFirstLettersTracker
-
getCurrentMarkerData
-
setCurrentMarkerData
-
getReplacedElementFactory
-
getFontContext
- Specified by:
getFontContext
in interfaceCssContext
-
setFontContext
-
getContentFunctionFactory
-
getExtraSpaceBottom
public int getExtraSpaceBottom()Returns the extra space set aside for the footers of paginated tables. -
setExtraSpaceBottom
public void setExtraSpaceBottom(int extraSpaceBottom) -
getExtraSpaceTop
public int getExtraSpaceTop()Returns the extra space set aside for the head section of paginated tables. -
setExtraSpaceTop
public void setExtraSpaceTop(int extraSpaceTop) -
resolveCounters
-
resolveCounters
-
getCounterContext
-
getFSFontMetrics
- Specified by:
getFSFontMetrics
in interfaceCssContext
-
getPageName
-
setPageName
-
getNoPageBreak
public int getNoPageBreak() -
setNoPageBreak
public void setNoPageBreak(int noPageBreak) -
isPageBreaksAllowed
public boolean isPageBreaksAllowed() -
getPendingPageName
-
setPendingPageName
-
getRootDocumentLayer
-
setRootDocumentLayer
-
getPage
-
setPage
-
isMayCheckKeepTogether
public boolean isMayCheckKeepTogether() -
setMayCheckKeepTogether
public void setMayCheckKeepTogether(boolean mayKeepTogether) -
setBlockBoxingState
-
getBlockBoxingState
-
isLineBreakedBecauseOfNoWrap
public boolean isLineBreakedBecauseOfNoWrap() -
setLineBreakedBecauseOfNoWrap
public void setLineBreakedBecauseOfNoWrap(boolean value) -
getBreakAtLineContext
-
setBreakAtLineContext
-
isFootnoteAllowed
public boolean isFootnoteAllowed()Whether further footnote content is allowed. Used to prohibit footnotes inside footnotes. -
setFootnoteAllowed
public void setFootnoteAllowed(boolean allowed) SeeisFootnoteAllowed()
. -
setIsInFloatBottom
public void setIsInFloatBottom(boolean inFloatBottom) -
isInFloatBottom
public boolean isInFloatBottom()Returns true if we are laying out the footnote area rather than general content.- Specified by:
isInFloatBottom
in interfaceCssContext
-
setFootnoteIndex
public void setFootnoteIndex(int footnoteIndex) -
getFootnoteIndex
public int getFootnoteIndex()The zero-based footnote index, which will likely be different from any counter used with the footnote. -
hasActiveFootnotes
public boolean hasActiveFootnotes() -
getFootnoteManager
Gets the document's footnote manager, creating it if required. From the footnote manager, one can add and remove footnote bodies. -
setFirstLettersTracker
-
setFirstLinesTracker
-