Top Description Fields Constructors Methods
com.openhtmltopdf.layout

public Class BlockFormattingContext

extends Object
Class Inheritance
Imports
java.awt.Point, com.openhtmltopdf.css.style.CssContext, com.openhtmltopdf.render.BlockBox, .Box, .LineBox

This class represents a block formatting context as defined in the CSS spec. Its main purpose is to provide BFC relative coordinates for a FloatManager. This coordinate space is used when positioning floats and calculating the amount of space floated boxes take up at a given y position

Note

The translate(int, int) method must be called when a block box in the normal flow is moved (i.e. its static position changes)

Field Summary

Modifier and TypeField and Description
private final PersistentBFC
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear(LayoutContext c, Box current)

public void
public int
getFloatDistance(CssContext cssCtx, LineBox line, int containingBlockWidth)

public FloatManager
public int
getLeftFloatDistance(CssContext cssCtx, LineBox line, int containingBlockWidth)

public int
getNextLineBoxDelta(CssContext cssCtx, LineBox line, int containingBlockWidth)

public Point
public int
getRightFloatDistance(CssContext cssCtx, LineBox line, int containingBlockWidth)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
translate(int x, int y)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_persistentBFCback to summary
private final PersistentBFC _persistentBFC
_xback to summary
private int _x
_yback to summary
private int _y

Constructor Detail

BlockFormattingContextback to summary
public BlockFormattingContext(BlockBox block, LayoutContext c)

Method Detail

clearback to summary
public void clear(LayoutContext c, Box current)
floatBoxback to summary
public void floatBox(LayoutContext c, BlockBox floated)
getFloatDistanceback to summary
public int getFloatDistance(CssContext cssCtx, LineBox line, int containingBlockWidth)
getFloatManagerback to summary
public FloatManager getFloatManager()
getLeftFloatDistanceback to summary
public int getLeftFloatDistance(CssContext cssCtx, LineBox line, int containingBlockWidth)
getNextLineBoxDeltaback to summary
public int getNextLineBoxDelta(CssContext cssCtx, LineBox line, int containingBlockWidth)
getOffsetback to summary
public Point getOffset()
getRightFloatDistanceback to summary
public int getRightFloatDistance(CssContext cssCtx, LineBox line, int containingBlockWidth)
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
translateback to summary
public void translate(int x, int y)