public final class RenderSegment extends java.lang.Object implements InteractiveSegment
| Modifier and Type | Field and Description |
|---|---|
protected ManualDefinitionImpl |
myManual |
| Constructor and Description |
|---|
RenderSegment(Segment parent,
java.lang.String title,
ImageRenderer imageRenderer) |
| Modifier and Type | Method and Description |
|---|---|
ManualDefinitionImpl |
getManual() |
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.
|
void |
notifyHover() |
boolean |
onMouseClick(int mouseX,
int mouseY)
Should be called by whatever is rendering the document when a left mouse
click occurs.
|
Segment |
parent()
Parent segment, i.e.
|
java.lang.Iterable<Segment> |
refine(java.util.regex.Pattern pattern,
SegmentRefiner refiner)
Used during construction, checks a segment for inner segments.
|
java.util.Optional<InteractiveSegment> |
render(int x,
int y,
int indent,
int maxWidth,
net.minecraft.client.gui.FontRenderer renderer,
int mouseX,
int mouseY)
Render the segment at the specified coordinates with the specified
properties.
|
Segment |
root()
The root segment, i.e.
|
void |
setNext(Segment segment) |
java.util.Optional<java.lang.String> |
tooltip()
The tooltip that should be displayed when this segment is being hovered.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckHoveredprotected final ManualDefinitionImpl myManual
public RenderSegment(Segment parent, java.lang.String title, ImageRenderer imageRenderer)
public Segment parent()
Segmentpublic java.util.Optional<java.lang.String> tooltip()
InteractiveSegmenttooltip in interface InteractiveSegmentpublic boolean onMouseClick(int mouseX,
int mouseY)
InteractiveSegmentThe mouse coordinates are expected to be in the same frame of reference as the document.
onMouseClick in interface InteractiveSegmentmouseX - the X coordinate of the mouse cursor.mouseY - the Y coordinate of the mouse cursor.public void notifyHover()
notifyHover in interface InteractiveSegmentpublic 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).
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 java.util.Optional<InteractiveSegment> render(int x, int y, int indent, int maxWidth, net.minecraft.client.gui.FontRenderer renderer, int mouseX, int mouseY)
Segmentrender in interface Segmentx - the x position to render at.y - the y position to render at.indent - the current indentation.maxWidth - the maximum width of the document.renderer - the font renderer to use.mouseX - the x mouse position.mouseY - the y mouse position.public java.lang.String toString()
toString in class java.lang.Objectpublic Segment root()
Segmentpublic java.lang.Iterable<Segment> refine(java.util.regex.Pattern pattern, SegmentRefiner refiner)
Segmentpublic Segment next()
Segmentpublic ManualDefinitionImpl getManual()