ComponentRenderer<TextBox>
, InteractableRenderer<TextBox>
, TextBox.TextBoxRenderer
public static class TextBox.DefaultTextBoxRenderer extends Object implements TextBox.TextBoxRenderer
TextBox
does not fit in the available area.Constructor | Description |
---|---|
DefaultTextBoxRenderer() |
Default constructor
|
Modifier and Type | Method | Description |
---|---|---|
void |
drawComponent(TextGUIGraphics graphics,
TextBox component) |
Using the supplied graphics object, draws the component passed in.
|
TerminalPosition |
getCursorLocation(TextBox component) |
|
TerminalSize |
getPreferredSize(TextBox component) |
Given the supplied component, how large does this renderer want the component to be?
|
TerminalPosition |
getViewTopLeft() |
|
void |
setHideScrollBars(boolean hideScrollBars) |
Controls whether scrollbars should be visible or not when a multi-line
TextBox has more content than
it can draw in the area it was assigned (default: false) |
void |
setUnusedSpaceCharacter(char unusedSpaceCharacter) |
Sets the character to represent an empty untyped space in the text box.
|
void |
setViewTopLeft(TerminalPosition position) |
public void setUnusedSpaceCharacter(char unusedSpaceCharacter)
unusedSpaceCharacter
- Character to draw in unused space of the TextBox
IllegalArgumentException
- If unusedSpaceCharacter is a double-width characterpublic TerminalPosition getViewTopLeft()
getViewTopLeft
in interface TextBox.TextBoxRenderer
public void setViewTopLeft(TerminalPosition position)
setViewTopLeft
in interface TextBox.TextBoxRenderer
public TerminalPosition getCursorLocation(TextBox component)
getCursorLocation
in interface InteractableRenderer<TextBox>
public TerminalSize getPreferredSize(TextBox component)
ComponentRenderer
getPreferredSize
in interface ComponentRenderer<TextBox>
component
- Component to calculate the preferred size ofpublic void setHideScrollBars(boolean hideScrollBars)
TextBox
has more content than
it can draw in the area it was assigned (default: false)hideScrollBars
- If true
, don't show scrollbars if the multi-line content is bigger than the
areapublic void drawComponent(TextGUIGraphics graphics, TextBox component)
ComponentRenderer
drawComponent
in interface ComponentRenderer<TextBox>
graphics
- Graphics object to use for drawingcomponent
- Component to drawCopyright © 2020. All rights reserved.