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
(package private) static enum
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<FloatManager.BoxOffset> private final Box
private final List
<FloatManager.BoxOffset> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
alignToLastFloat
(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction direction) private void
alignToLastOpposingFloat
(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction 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, FloatManager.Direction direction) private List
<FloatManager.BoxOffset> getFloats
(FloatManager.Direction direction) int
getLeftFloatDistance
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) int
getNextLineBoxDelta
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) private @Nullable Point
getOffset
(BlockBox floater, List<FloatManager.BoxOffset> floats) private List
<FloatManager.BoxOffset> getOpposingFloats
(FloatManager.Direction direction) int
getRightFloatDistance
(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) private void
moveAllTheWayOver
(BlockBox current, FloatManager.Direction 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, FloatManager.Direction direction) void
removeFloat
(BlockBox floater) private void
removeFloat
(BlockBox floater, List<FloatManager.BoxOffset> floats) private void
save
(BlockBox current, Layer layer, BlockFormattingContext bfc, FloatManager.Direction direction)
-
Field Details
-
_leftFloats
-
_rightFloats
-
_master
-
-
Constructor Details
-
FloatManager
-
-
Method Details
-
floatBox
-
clear
-
save
private void save(BlockBox current, Layer layer, BlockFormattingContext bfc, FloatManager.Direction direction) -
position
private void position(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction direction) -
getFloats
-
getOpposingFloats
-
alignToLastFloat
private void alignToLastFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction direction) -
alignToLastOpposingFloat
private void alignToLastOpposingFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction 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, FloatManager.Direction direction) -
getMaster
-
getOffset
-
getOffset
@CheckReturnValue private @Nullable Point getOffset(BlockBox floater, List<FloatManager.BoxOffset> floats) -
performFloatOperation
private void performFloatOperation(FloatManager.FloatOperation op, List<FloatManager.BoxOffset> floats) -
performFloatOperation
-