Top Description Fields Constructors Methods
com.openhtmltopdf.render

public Class InlineBox

extends Object
implements Styleable
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.layout.Styleable
Imports
java.text.BreakIterator, org.w3c.dom.Element, com.openhtmltopdf.bidi.BidiSplitter, com.openhtmltopdf.css.constants.CSSName, .IdentValue, com.openhtmltopdf.css.extend.ContentFunction, com.openhtmltopdf.css.parser.FSFunction, com.openhtmltopdf.css.style.CalculatedStyle, com.openhtmltopdf.extend.FSTextBreaker, com.openhtmltopdf.layout.Breaker, .LayoutContext, .Styleable, .TextUtil, .WhitespaceStripper

A class which represents a portion of an inline element. If an inline element does not contain any nested elements, then a single InlineBox object will contain the content for the entire element. Otherwise multiple InlineBox objects will be created corresponding to each discrete chunk of text appearing in the element. It is not rendered directly (and hence does not extend from Box), but does play an important role in layout (for example, when calculating min/max widths). Note that it does not contain children. Inline content is stored as a flat list in the layout tree. However, InlineBox does contain enough information to reconstruct the original element nesting and this is, in fact, done during inline layout.
See Also
InlineLayoutBox

Field Summary

Modifier and TypeField and Description
private ContentFunction
private Element
private boolean
private int
private BlockBox
private FSFunction
private int
private boolean
private int
private String
private String
private boolean
private boolean
private CalculatedStyle
private String
private byte

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public void
private void
calcMaxWidthFromLineLength(LayoutContext c, int cbWidth, boolean trim)

public void
calcMinMaxWidth(LayoutContext c, int cbWidth, boolean trimLeadingSpace)

private int
calcMinWidthFromWordLength(LayoutContext c, int cbWidth, boolean trimLeadingSpace, boolean includeWS)

public ContentFunction
public Element
public int
public BlockBox
public FSFunction
private int
getInlineMBP(LayoutContext c, int cbWidth)

private int
public int
public int
public String
public int
public CalculatedStyle
public String
private String
getText(boolean trimLeadingSpace)

public byte

Returns:

either LTR or RTL from BidiSplitter interface.
getTextDirection
()

private int
public int
public boolean
public boolean
public boolean
isEndsHere()

The opposite of isStartsHere()

public boolean
public boolean
isStartsHere()

Whether this is the first InlineBox for a box.

public void
public void
public void
setEndsHere(boolean endsHere)

See isEndsHere()

public void
setFootnote(BlockBox footnoteBody)

public void
public void
setPseudoElementOrClass(String pseudoElementOrClass)

public void
setRemovableWhitespace(boolean removeableWhitespace)

public void
setStartsHere(boolean startsHere)

See isStartsHere()

public void
public void
public void
setTextDirection(byte
either LTR or RTL from BidiSplitter interface.
direction
)

private String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_contentFunctionback to summary
private ContentFunction _contentFunction
_elementback to summary
private Element _element
_endsHereback to summary
private boolean _endsHere

See isEndsHere()

_firstLineWidthback to summary
private int _firstLineWidth
_footnoteBodyback to summary
private BlockBox _footnoteBody
_functionback to summary
private FSFunction _function
_maxWidthback to summary
private int _maxWidth
_minMaxCalculatedback to summary
private boolean _minMaxCalculated
_minWidthback to summary
private int _minWidth
_originalTextback to summary
private String _originalText
_pseudoElementOrClassback to summary
private String _pseudoElementOrClass
_removableWhitespaceback to summary
private boolean _removableWhitespace
_startsHereback to summary
private boolean _startsHere

See isStartsHere()

_styleback to summary
private CalculatedStyle _style
_textback to summary
private String _text
_textDirectionback to summary
private byte _textDirection

Constructor Detail

InlineBoxback to summary
public InlineBox(String text)

Method Detail

appendPositioningInfoback to summary
protected void appendPositioningInfo(StringBuilder result)
applyTextTransformback to summary
public void applyTextTransform()
calcMaxWidthFromLineLengthback to summary
private void calcMaxWidthFromLineLength(LayoutContext c, int cbWidth, boolean trim)
calcMinMaxWidthback to summary
public void calcMinMaxWidth(LayoutContext c, int cbWidth, boolean trimLeadingSpace)
calcMinWidthFromWordLengthback to summary
private int calcMinWidthFromWordLength(LayoutContext c, int cbWidth, boolean trimLeadingSpace, boolean includeWS)
getContentFunctionback to summary
public ContentFunction getContentFunction()
getElementback to summary
public Element getElement()

Implements com.openhtmltopdf.layout.Styleable.getElement.

Annotations
@Override
getFirstLineWidthback to summary
public int getFirstLineWidth()
getFootnoteBodyback to summary
public BlockBox getFootnoteBody()
getFunctionback to summary
public FSFunction getFunction()
getInlineMBPback to summary
private int getInlineMBP(LayoutContext c, int cbWidth)
getMaxCharWidthback to summary
private int getMaxCharWidth(LayoutContext c, String s)
getMaxWidthback to summary
public int getMaxWidth()
getMinWidthback to summary
public int getMinWidth()
getPseudoElementOrClassback to summary
public String getPseudoElementOrClass()

Implements com.openhtmltopdf.layout.Styleable.getPseudoElementOrClass.

Annotations
@Override
getSpaceWidthback to summary
public int getSpaceWidth(LayoutContext c)
getStyleback to summary
public CalculatedStyle getStyle()

Implements com.openhtmltopdf.layout.Styleable.getStyle.

Annotations
@Override
getTextback to summary
public String getText()
getTextback to summary
private String getText(boolean trimLeadingSpace)
getTextDirectionback to summary
public byte getTextDirection()
Returns:byte

either LTR or RTL from BidiSplitter interface.

getTextWidthback to summary
private int getTextWidth(LayoutContext c, String s)
getTrailingSpaceWidthback to summary
public int getTrailingSpaceWidth(LayoutContext c)
hasFootnoteback to summary
public boolean hasFootnote()
isDynamicFunctionback to summary
public boolean isDynamicFunction()
isEndsHereback to summary
public boolean isEndsHere()

The opposite of isStartsHere()

isRemovableWhitespaceback to summary
public boolean isRemovableWhitespace()
isStartsHereback to summary
public boolean isStartsHere()

Whether this is the first InlineBox for a box. For example: [b]one[i]two[/i]three[/b] will create three InlineBox objects and one and two will return true for isStartsHere. This is used for example to decide whether left margin needs to be applied.

setContentFunctionback to summary
public void setContentFunction(ContentFunction contentFunction)
setElementback to summary
public void setElement(Element element)

Implements com.openhtmltopdf.layout.Styleable.setElement.

Annotations
@Override
setEndsHereback to summary
public void setEndsHere(boolean endsHere)

See isEndsHere()

setFootnoteback to summary
public void setFootnote(BlockBox footnoteBody)
setFunctionback to summary
public void setFunction(FSFunction function)
setPseudoElementOrClassback to summary
public void setPseudoElementOrClass(String pseudoElementOrClass)
setRemovableWhitespaceback to summary
public void setRemovableWhitespace(boolean removeableWhitespace)
setStartsHereback to summary
public void setStartsHere(boolean startsHere)

See isStartsHere()

setStyleback to summary
public void setStyle(CalculatedStyle style)

Implements com.openhtmltopdf.layout.Styleable.setStyle.

Annotations
@Override
setTextback to summary
public void setText(String text)
setTextDirectionback to summary
public void setTextDirection(byte direction)
Parameters
direction:byte

either LTR or RTL from BidiSplitter interface.

shortTextback to summary
private String shortText()
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
truncateTextback to summary
public void truncateText()