Package org.xhtmlrenderer.layout
Class FloatManager
java.lang.Object
org.xhtmlrenderer.layout.FloatManager
A class that manages all floated boxes in a given block formatting context.
It is responsible for positioning floats and calculating clearance for
non-floated (block) boxes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final record
private static final record
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<FloatManager.BoxOffset> private Box
private final List
<FloatManager.BoxOffset> private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
alignToLastFloat
(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) private void
alignToLastOpposingFloat
(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) private void
applyLineHeightHack
(CssContext cssCtx, Box line, Rectangle bounds) private int
calcDelta
(CssContext cssCtx, LineBox line, FloatManager.BoxDistance boxDistance) void
private void
calcFloatLocations
(List<FloatManager.BoxOffset> floats) void
clear
(CssContext cssCtx, BlockFormattingContext bfc, Box box) private int
findLowestY
(CssContext cssCtx, List<FloatManager.BoxOffset> floats) private boolean
fitsInContainingBlock
(BlockBox current) void
floatBox
(LayoutContext c, Layer layer, BlockFormattingContext bfc, BlockBox box) int
getClearDelta
(CssContext cssCtx, int bfcRelativeY) private FloatManager.BoxDistance
getFloatDistance
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth, List<FloatManager.BoxOffset> floatsList, int direction) private List
<FloatManager.BoxOffset> getFloats
(int direction) int
getLeftFloatDistance
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) int
getNextLineBoxDelta
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) private Point
getOffset
(BlockBox floater, List<FloatManager.BoxOffset> floats) private List
<FloatManager.BoxOffset> getOpposingFloats
(int direction) int
getRightFloatDistance
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) private void
moveAllTheWayOver
(BlockBox current, int direction) private void
moveClear
(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats) private void
moveFloatBelow
(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats) private boolean
overlaps
(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, List<FloatManager.BoxOffset> floats) void
private void
private void
position
(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) void
removeFloat
(BlockBox floater) private void
removeFloat
(BlockBox floater, List<FloatManager.BoxOffset> floats) private void
save
(BlockBox current, Layer layer, BlockFormattingContext bfc, int direction) void
-
Field Details
-
LEFT
private static final int LEFT- See Also:
-
RIGHT
private static final int RIGHT- See Also:
-
_leftFloats
-
_rightFloats
-
_master
-
-
Constructor Details
-
FloatManager
public FloatManager()
-
-
Method Details
-
floatBox
-
clear
-
save
-
position
private void position(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) -
getFloats
-
getOpposingFloats
-
alignToLastFloat
private void alignToLastFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) -
alignToLastOpposingFloat
private void alignToLastOpposingFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) -
moveAllTheWayOver
-
fitsInContainingBlock
-
findLowestY
-
getClearDelta
-
overlaps
private boolean overlaps(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, List<FloatManager.BoxOffset> floats) -
moveFloatBelow
private void moveFloatBelow(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats) -
moveClear
private void moveClear(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats) -
removeFloat
-
removeFloat
-
calcFloatLocations
public void calcFloatLocations() -
calcFloatLocations
-
applyLineHeightHack
-
getNextLineBoxDelta
public int getNextLineBoxDelta(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) -
calcDelta
-
getLeftFloatDistance
public int getLeftFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) -
getRightFloatDistance
public int getRightFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) -
getFloatDistance
private FloatManager.BoxDistance getFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth, List<FloatManager.BoxOffset> floatsList, int direction) -
setMaster
-
getMaster
-
getOffset
-
getOffset
-
performFloatOperation
private void performFloatOperation(FloatManager.FloatOperation op, List<FloatManager.BoxOffset> floats) -
performFloatOperation
-