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 recordprivate static final record(package private) static enumstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<FloatManager.BoxOffset> private final Boxprivate final List<FloatManager.BoxOffset> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidalignToLastFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction direction) private voidalignToLastOpposingFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction direction) private voidapplyLineHeightHack(CssContext cssCtx, Box line, Rectangle bounds) private intcalcDelta(CssContext cssCtx, LineBox line, FloatManager.BoxDistance boxDistance) voidprivate voidcalcFloatLocations(List<FloatManager.BoxOffset> floats) voidclear(CssContext cssCtx, BlockFormattingContext bfc, Box box) private intfindLowestY(CssContext cssCtx, List<FloatManager.BoxOffset> floats) private booleanfitsInContainingBlock(BlockBox current) voidfloatBox(LayoutContext c, Layer layer, BlockFormattingContext bfc, BlockBox box) intgetClearDelta(CssContext cssCtx, int bfcRelativeY) private FloatManager.BoxDistancegetFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth, List<FloatManager.BoxOffset> floatsList, FloatManager.Direction direction) private List<FloatManager.BoxOffset> getFloats(FloatManager.Direction direction) intgetLeftFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) intgetNextLineBoxDelta(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) private @Nullable PointgetOffset(BlockBox floater, List<FloatManager.BoxOffset> floats) private List<FloatManager.BoxOffset> getOpposingFloats(FloatManager.Direction direction) intgetRightFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth) private voidmoveAllTheWayOver(BlockBox current, FloatManager.Direction direction) private voidmoveClear(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats) private voidmoveFloatBelow(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats) private booleanoverlaps(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, List<FloatManager.BoxOffset> floats) voidprivate voidprivate voidposition(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.Direction direction) voidremoveFloat(BlockBox floater) private voidremoveFloat(BlockBox floater, List<FloatManager.BoxOffset> floats) private voidsave(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
-