Class WrappedText
java.lang.Object
de.xima.fc.common.text.wrap.WrappedText
- All Implemented Interfaces:
Serializable
Represents a piece of text that has been wrapped into lines.
This class is immutable and thread-safe.
- Since:
- 8.4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWrappedText(List<WrappedLine> lines, double width, double height) Creates a new wrapped text. -
Method Summary
Modifier and TypeMethodDescriptiondoubleheight()Gets the height of the entire piece of text.lines()Gets the individual lines that make up the wrapped text.text()Returns the entire text with all lines separated by a single space when not a forced line break, or LF when a forced line break is present.Returns the entire text with all lines separated by the given newline.toString()doublewidth()Gets the width of the entire piece of text.
-
Constructor Details
-
WrappedText
Creates a new wrapped text.- Parameters:
lines- The lines of the wrapped text.width- The width of the entire piece of text.height- The height of the entire piece of text.
-
-
Method Details
-
height
public double height()Gets the height of the entire piece of text.- Returns:
- The height of the text.
-
lines
Gets the individual lines that make up the wrapped text.- Returns:
- The lines of the wrapped text.
-
text
-
text
Returns the entire text with all lines separated by a single space when not a forced line break, or LF when a forced line break is present.- Returns:
- All lines joined with a single space or LF.
-
toString
-
width
public double width()Gets the width of the entire piece of text.- Returns:
- The width of the text.
-