Package de.xima.fc.common.text.wrap
Class WrappedLine
- java.lang.Object
-
- de.xima.fc.common.text.wrap.WrappedLine
-
- All Implemented Interfaces:
Serializable
public final class WrappedLine extends Object implements Serializable
Represents a single line of text that has been wrapped. Usually part of multiple lines, seeWrappedText
.- Since:
- 8.4.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WrappedLine(String text, double width, double height, boolean endsOnForcedLineBreak)
Creates a new wrapped line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
endsOnForcedLineBreak()
Whether this line was created due to forced line break.double
height()
Gets the height of this line.String
text()
Gets the text of this line.String
toString()
double
width()
Gets the width of this line.
-
-
-
Constructor Detail
-
WrappedLine
public WrappedLine(String text, double width, double height, boolean endsOnForcedLineBreak)
Creates a new wrapped line.- Parameters:
text
- The text of the line.width
- The width of the line.height
- The height of the line.endsOnForcedLineBreak
- Whether this line was created due to forced line break. If true, this line was ended due to a forced line break in the original text, such as LF or CRLF. If false, this line was ended due the layout settings, i.e. the maximum width of the line.
-
-
Method Detail
-
endsOnForcedLineBreak
public boolean endsOnForcedLineBreak()
Whether this line was created due to forced line break. If true, this line was ended due to a forced line break in the original text, such as LF or CRLF. If false, this line was ended due the layout settings, i.e. the maximum width of the line.- Returns:
- True if this line was ended due to a forced line break, false otherwise.
-
height
public double height()
Gets the height of this line.- Returns:
- The height of the line.
-
text
public String text()
Gets the text of this line.- Returns:
- The text of the line.
-
width
public double width()
Gets the width of this line.- Returns:
- The width of the line.
-
-