Package com.openhtmltopdf.layout
Class LineBreakContext
java.lang.Object
com.openhtmltopdf.layout.LineBreakContext
public class LineBreakContext extends Object
A bean which serves as a way for the layout code to pass information to the
line breaking code and for the line breaking code to pass instructions back
to the layout code.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLineBreakContext.LineBreakResult -
Constructor Summary
Constructors Constructor Description LineBreakContext() -
Method Summary
Modifier and Type Method Description StringgetCalculatedSubstring()intgetEnd()intgetLast()StringgetMaster()intgetNextWidth()If needs newline, returns the graphics width of the next unbreakable sequence.intgetStart()StringgetStartSubstring()intgetWidth()booleanisEndsOnNL()booleanisEndsOnSoftHyphen()booleanisEndsOnWordBreak()booleanisFinished()booleanisFinishedInCharBreakingMode()If this is true, it means we finished in char breaking mode because a word was too large.booleanisNeedsNewLine()booleanisUnbreakable()voidreset()voidresetEnd()voidsaveEnd()voidsetEnd(int end)voidsetEndsOnNL(boolean b)voidsetEndsOnSoftHyphen(boolean b)voidsetEndsOnWordBreak(boolean _endsOnWordBreak)voidsetFinishedInCharBreakingMode(boolean mode)voidsetMaster(String master)voidsetNeedsNewLine(boolean needsLineBreak)voidsetNextWidth(int nextWidth)voidsetStart(int start)voidsetUnbreakable(boolean unbreakable)voidsetWidth(int width)
-
Constructor Details
-
LineBreakContext
public LineBreakContext()
-
-
Method Details
-
getLast
public int getLast() -
reset
public void reset() -
getEnd
public int getEnd() -
setEnd
public void setEnd(int end) -
getMaster
-
setMaster
-
getStart
public int getStart() -
setStart
public void setStart(int start) -
getStartSubstring
-
getCalculatedSubstring
-
isUnbreakable
public boolean isUnbreakable() -
setUnbreakable
public void setUnbreakable(boolean unbreakable) -
isNeedsNewLine
public boolean isNeedsNewLine() -
setNeedsNewLine
public void setNeedsNewLine(boolean needsLineBreak) -
getWidth
public int getWidth() -
setWidth
public void setWidth(int width) -
isFinished
public boolean isFinished() -
resetEnd
public void resetEnd() -
saveEnd
public void saveEnd() -
isEndsOnNL
public boolean isEndsOnNL() -
setEndsOnNL
public void setEndsOnNL(boolean b) -
isEndsOnSoftHyphen
public boolean isEndsOnSoftHyphen() -
setEndsOnSoftHyphen
public void setEndsOnSoftHyphen(boolean b) -
getNextWidth
public int getNextWidth()If needs newline, returns the graphics width of the next unbreakable sequence. We use this to test if we should actually put in a newline before a long word when break-word is on. If getNextWidth would fit on an empty line we put in the new line else we split in the long word immediately. -
setNextWidth
public void setNextWidth(int nextWidth) -
isEndsOnWordBreak
public boolean isEndsOnWordBreak() -
setEndsOnWordBreak
public void setEndsOnWordBreak(boolean _endsOnWordBreak) -
setFinishedInCharBreakingMode
public void setFinishedInCharBreakingMode(boolean mode) -
isFinishedInCharBreakingMode
public boolean isFinishedInCharBreakingMode()If this is true, it means we finished in char breaking mode because a word was too large. The next line should begin in char breaking mode.
-