public final class HeaderSegment extends TextSegment
| Constructor and Description |
|---|
HeaderSegment(Segment parent,
java.lang.String text,
int level) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
computeWrapIndent(net.minecraft.client.gui.FontRenderer renderer) |
protected static boolean |
containsBreak(java.lang.String s) |
protected java.lang.String |
format() |
protected boolean |
ignoreLeadingWhitespace() |
protected static int |
indexOfFirstNonWhitespace(java.lang.String s) |
boolean |
isLast()
Utility method to check if the segment is the last on a line.
|
protected int |
maxChars(java.lang.String s,
int maxWidth,
int maxLineWidth,
net.minecraft.client.gui.FontRenderer renderer) |
Segment |
next()
Set after construction of document, used for formatting, specifically
to compute the height for last segment on a line (to force a new line).
|
int |
nextX(int indent,
int maxWidth,
net.minecraft.client.gui.FontRenderer renderer)
Get the X coordinate at which to render the next segment.
|
int |
nextY(int indent,
int maxWidth,
net.minecraft.client.gui.FontRenderer renderer)
Get the Y coordinate at which to render the next segment.
|
Segment |
root()
The root segment, i.e.
|
protected java.util.Optional<java.lang.Float> |
scale() |
void |
setNext(Segment segment) |
java.lang.String |
toString() |
color, lineHeight, parent, refine, render, stringWidth, textpublic HeaderSegment(Segment parent, java.lang.String text, int level)
protected java.util.Optional<java.lang.Float> scale()
scale in class TextSegmentprotected java.lang.String format()
format in class TextSegmentpublic java.lang.String toString()
public int nextX(int indent,
int maxWidth,
net.minecraft.client.gui.FontRenderer renderer)
SegmentFor flowing/inline segments this will be to the right of the last line this segment renders, for block segments it will be at the start of the next line below this segment.
The coordinates in this context are relative to (0,0).
public int nextY(int indent,
int maxWidth,
net.minecraft.client.gui.FontRenderer renderer)
SegmentFor flowing/inline segments this will be the same level as the last line this segment renders, unless it's the last segment on its line. For block segments and last-on-line segments this will be the next line after.
The coordinates in this context are relative to (0,0).
protected boolean ignoreLeadingWhitespace()
protected int maxChars(java.lang.String s,
int maxWidth,
int maxLineWidth,
net.minecraft.client.gui.FontRenderer renderer)
protected int computeWrapIndent(net.minecraft.client.gui.FontRenderer renderer)
protected static int indexOfFirstNonWhitespace(java.lang.String s)
protected static boolean containsBreak(java.lang.String s)
public Segment root()
Segmentpublic Segment next()
Segment