Top Description Inners Fields Constructors Methods
com.openhtmltopdf.layout

public Class FloatManager

extends Object
Class Inheritance
Imports
java.awt.Point, .Rectangle, java.util.ArrayList, .Collections, .Iterator, .List, java.util.stream.Stream, com.openhtmltopdf.css.style.CssContext, com.openhtmltopdf.css.style.derived.RectPropertySet, com.openhtmltopdf.render.BlockBox, .Box, .LineBox

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 and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class
public static enum
public static interface

Field Summary

Modifier and TypeField and Description
private List<FloatManager.BoxOffset>
private final Box
private List<FloatManager.BoxOffset>

Constructor Summary

AccessConstructor and Description
public
FloatManager(Box master)

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private int
public void
private void
public void
private int
private boolean
public void
private List<FloatManager.BoxOffset>
public int
getClearDelta(CssContext cssCtx, int bfcRelativeY)

private FloatManager.BoxDistance
getFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth, List<FloatManager.BoxOffset> floatsList, FloatManager.FloatDirection direction)

public List<FloatManager.BoxOffset>
public Stream<FloatManager.BoxOffset>
public int
getLeftFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth)

public Box
public int
getNextLineBoxDelta(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth)

public Point
private Point
private List<FloatManager.BoxOffset>
public int
getRightFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth)

private void
private void
private void
private boolean
private void
public void
private void
public void
private void
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_leftFloatsback to summary
private List<FloatManager.BoxOffset> _leftFloats
_masterback to summary
private final Box _master
_rightFloatsback to summary
private List<FloatManager.BoxOffset> _rightFloats

Constructor Detail

FloatManagerback to summary
public FloatManager(Box master)

Method Detail

alignToLastFloatback to summary
private void alignToLastFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.FloatDirection direction)
alignToLastOpposingFloatback to summary
private void alignToLastOpposingFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.FloatDirection direction)
applyLineHeightHackback to summary
private void applyLineHeightHack(CssContext cssCtx, Box line, Rectangle bounds)
calcDeltaback to summary
private int calcDelta(CssContext cssCtx, LineBox line, FloatManager.BoxDistance boxDistance)
calcFloatLocationsback to summary
public void calcFloatLocations()
calcFloatLocationsback to summary
private void calcFloatLocations(List<FloatManager.BoxOffset> floats)
clearback to summary
public void clear(CssContext cssCtx, BlockFormattingContext bfc, Box box)
findLowestYback to summary
private int findLowestY(CssContext cssCtx, List<FloatManager.BoxOffset> floats)
fitsInContainingBlockback to summary
private boolean fitsInContainingBlock(BlockBox current)
floatBoxback to summary
public void floatBox(LayoutContext c, Layer layer, BlockFormattingContext bfc, BlockBox box)
getAddableFloatsback to summary
private List<FloatManager.BoxOffset> getAddableFloats(FloatManager.FloatDirection direction)
getClearDeltaback to summary
public int getClearDelta(CssContext cssCtx, int bfcRelativeY)
getFloatDistanceback to summary
private FloatManager.BoxDistance getFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth, List<FloatManager.BoxOffset> floatsList, FloatManager.FloatDirection direction)
getFloatsback to summary
public List<FloatManager.BoxOffset> getFloats(FloatManager.FloatDirection direction)
getFloatStreamback to summary
public Stream<FloatManager.BoxOffset> getFloatStream(FloatManager.FloatDirection direction)
getLeftFloatDistanceback to summary
public int getLeftFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth)
getMasterback to summary
public Box getMaster()
getNextLineBoxDeltaback to summary
public int getNextLineBoxDelta(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth)
getOffsetback to summary
public Point getOffset(BlockBox floater)
getOffsetback to summary
private Point getOffset(BlockBox floater, Stream<FloatManager.BoxOffset> floats)
getOpposingFloatsback to summary
private List<FloatManager.BoxOffset> getOpposingFloats(FloatManager.FloatDirection direction)
getRightFloatDistanceback to summary
public int getRightFloatDistance(CssContext cssCtx, BlockFormattingContext bfc, LineBox line, int containingBlockContentWidth)
moveAllTheWayOverback to summary
private void moveAllTheWayOver(BlockBox current, FloatManager.FloatDirection direction)
moveClearback to summary
private void moveClear(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats)
moveFloatBelowback to summary
private void moveFloatBelow(CssContext cssCtx, BlockFormattingContext bfc, Box current, List<FloatManager.BoxOffset> floats)
overlapsback to summary
private boolean overlaps(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, List<FloatManager.BoxOffset> floats)
performFloatOperationback to summary
private void performFloatOperation(FloatManager.FloatOperation op, List<FloatManager.BoxOffset> floats)
performFloatOperationback to summary
public void performFloatOperation(FloatManager.FloatOperation op)
positionback to summary
private void position(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, FloatManager.FloatDirection direction)
removeFloatback to summary
public void removeFloat(BlockBox floater)
removeFloatback to summary
private void removeFloat(BlockBox floater, List<FloatManager.BoxOffset> floats)
saveback to summary
private void save(BlockBox current, Layer layer, BlockFormattingContext bfc, FloatManager.FloatDirection direction)
setFloatsback to summary
private void setFloats(FloatManager.FloatDirection direction, List<FloatManager.BoxOffset> list)
com.openhtmltopdf.layout back to summary

private Class FloatManager.BoxDistance

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BlockBox
private final int

Constructor Summary

AccessConstructor and Description
public
BoxDistance(BlockBox box, int distance)

Method Summary

Modifier and TypeMethod and Description
pack-priv BlockBox
pack-priv int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_boxback to summary
private final BlockBox _box
_distanceback to summary
private final int _distance

Constructor Detail

BoxDistanceback to summary
public BoxDistance(BlockBox box, int distance)

Method Detail

getBoxback to summary
pack-priv BlockBox getBox()
getDistanceback to summary
pack-priv int getDistance()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
com.openhtmltopdf.layout back to summary

public Class FloatManager.BoxOffset

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BlockBox
private final int
private final int

Constructor Summary

AccessConstructor and Description
public
BoxOffset(BlockBox box, int x, int y)

Method Summary

Modifier and TypeMethod and Description
public BlockBox
public int
getX()

public int
getY()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_boxback to summary
private final BlockBox _box
_xback to summary
private final int _x
_yback to summary
private final int _y

Constructor Detail

BoxOffsetback to summary
public BoxOffset(BlockBox box, int x, int y)

Method Detail

getBoxback to summary
public BlockBox getBox()
getXback to summary
public int getX()
getYback to summary
public int getY()
com.openhtmltopdf.layout back to summary

public final Enum FloatManager.FloatDirection

extends Enum<FloatManager.FloatDirection>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final FloatManager.FloatDirection
public static final FloatManager.FloatDirection

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static FloatManager.FloatDirection
public static FloatManager.FloatDirection[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LEFTback to summary
public static final FloatManager.FloatDirection LEFT
RIGHTback to summary
public static final FloatManager.FloatDirection RIGHT

Constructor Detail

FloatDirectionback to summary
private FloatDirection()

Method Detail

valueOfback to summary
public static FloatManager.FloatDirection valueOf(String name)
valuesback to summary
public static FloatManager.FloatDirection[] values()
com.openhtmltopdf.layout back to summary

public Interface FloatManager.FloatOperation

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
operate(Box floater)

Method Detail

operateback to summary
public void operate(Box floater)