- java.lang.Object
-
- util.misc.TextLineBreakerStringWidth
-
- Direct Known Subclasses:
TextLineBreakerFontWidth
public class TextLineBreakerStringWidth extends java.lang.Object
Breaks a text into lines.- Author:
- Til Schneider, www.murfman.de
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELLIPSIS
ellipsis used for shortened titles and descriptions
unicode character representing "..."
-
Constructor Summary
Constructors Constructor Description TextLineBreakerStringWidth()
Create the LineBreaker
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
breakLines(java.io.Reader textReader, int width)
Break a Text into separate Linesjava.lang.String[]
breakLines(java.io.Reader textReader, int width, int maxLines)
Break a Text into separate Linesint
getStringWidth(java.lang.String str)
Get the Width of a Stringstatic void
resetHyphenator()
to be used by Settings.handleChangedSettings()void
setMinusWidth(int minusWidth)
Set the Width of a Minus Charactervoid
setSpaceWidth(int spaceWidth)
Set the Width of a Space Character
-
-
-
Field Detail
-
ELLIPSIS
public static final java.lang.String ELLIPSIS
ellipsis used for shortened titles and descriptions
unicode character representing "..."- See Also:
- Constant Field Values
-
-
Method Detail
-
setSpaceWidth
public void setSpaceWidth(int spaceWidth)
Set the Width of a Space Character- Parameters:
spaceWidth
- new Space-Width
-
setMinusWidth
public void setMinusWidth(int minusWidth)
Set the Width of a Minus Character- Parameters:
minusWidth
- new Minus-Width
-
breakLines
public java.lang.String[] breakLines(java.io.Reader textReader, int width) throws java.io.IOException
Break a Text into separate Lines- Parameters:
textReader
- Text to separatewidth
- Max-Width of each Line- Returns:
- Text split in separate Lines
- Throws:
java.io.IOException
- Thrown if an IO operation went wrong.
-
breakLines
public java.lang.String[] breakLines(java.io.Reader textReader, int width, int maxLines) throws java.io.IOException
Break a Text into separate Lines- Parameters:
textReader
- Text to separatewidth
- Max-Width of each LinemaxLines
- Max. amount of Lines- Returns:
- Text split in separate Lines
- Throws:
java.io.IOException
- Thrown if an IO operation went wrong.
-
getStringWidth
public int getStringWidth(java.lang.String str)
Get the Width of a String- Parameters:
str
- get Width of this String- Returns:
- Width of this String
-
resetHyphenator
public static void resetHyphenator()
to be used by Settings.handleChangedSettings()
-
-