public class TextFieldWidget extends Widget implements IRenderable, IGuiEventListener
Modifier and Type | Field and Description |
---|---|
private boolean |
canLoseFocus |
private int |
cursorCounter |
private int |
cursorPosition |
private int |
disabledColor |
private boolean |
enableBackgroundDrawing |
private int |
enabledColor |
private boolean |
field_212956_h |
private FontRenderer |
fontRenderer |
private java.util.function.Consumer<java.lang.String> |
guiResponder |
private boolean |
isEnabled |
private int |
lineScrollOffset |
private int |
maxStringLength |
private int |
selectionEnd |
private java.lang.String |
suggestion |
private java.lang.String |
text |
private java.util.function.BiFunction<java.lang.String,java.lang.Integer,java.lang.String> |
textFormatter |
private java.util.function.Predicate<java.lang.String> |
validator |
active, alpha, height, isHovered, nextNarration, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, y
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
Constructor and Description |
---|
TextFieldWidget(FontRenderer fontIn,
int xIn,
int yIn,
int widthIn,
int heightIn,
java.lang.String msg) |
TextFieldWidget(FontRenderer fontIn,
int xIn,
int yIn,
int widthIn,
int heightIn,
TextFieldWidget p_i51138_6_,
java.lang.String msg) |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite() |
boolean |
changeFocus(boolean p_changeFocus_1_) |
boolean |
charTyped(char p_charTyped_1_,
int p_charTyped_2_) |
void |
clampCursorPosition(int pos) |
private void |
delete(int p_212950_1_) |
void |
deleteFromCursor(int num) |
void |
deleteWords(int num) |
private void |
drawSelectionBox(int startX,
int startY,
int endX,
int endY) |
int |
func_195611_j(int p_195611_1_) |
int |
getAdjustedWidth() |
int |
getCursorPosition() |
private boolean |
getEnableBackgroundDrawing() |
private int |
getMaxStringLength() |
protected java.lang.String |
getNarrationMessage() |
int |
getNthWordFromCursor(int numWords) |
private int |
getNthWordFromPos(int n,
int pos) |
private int |
getNthWordFromPosWS(int n,
int pos,
boolean skipWs) |
java.lang.String |
getSelectedText() |
java.lang.String |
getText() |
boolean |
getVisible() |
private boolean |
isEnabled() |
boolean |
isMouseOver(double p_isMouseOver_1_,
double p_isMouseOver_3_) |
boolean |
keyPressed(int p_keyPressed_1_,
int p_keyPressed_2_,
int p_keyPressed_3_) |
boolean |
mouseClicked(double p_mouseClicked_1_,
double p_mouseClicked_3_,
int p_mouseClicked_5_) |
void |
moveCursorBy(int num) |
protected void |
onFocusedChanged(boolean p_onFocusedChanged_1_) |
private void |
onTextChanged(java.lang.String newText) |
void |
renderButton(int p_renderButton_1_,
int p_renderButton_2_,
float p_renderButton_3_) |
void |
setCanLoseFocus(boolean canLoseFocusIn) |
void |
setCursorPosition(int pos) |
void |
setCursorPositionEnd() |
void |
setCursorPositionZero() |
void |
setDisabledTextColour(int color) |
void |
setEnableBackgroundDrawing(boolean enableBackgroundDrawingIn) |
void |
setEnabled(boolean enabled) |
void |
setFocused2(boolean isFocusedIn) |
void |
setMaxStringLength(int length) |
void |
setResponder(java.util.function.Consumer<java.lang.String> rssponderIn) |
void |
setSelectionPos(int position) |
void |
setSuggestion(java.lang.String p_195612_1_) |
void |
setText(java.lang.String textIn) |
void |
setTextColor(int color) |
void |
setTextFormatter(java.util.function.BiFunction<java.lang.String,java.lang.Integer,java.lang.String> textFormatterIn) |
void |
setValidator(java.util.function.Predicate<java.lang.String> validatorIn) |
void |
setVisible(boolean isVisible) |
void |
setX(int xIn) |
void |
tick() |
void |
writeText(java.lang.String textToWrite) |
clearFGColor, clicked, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isValidClickButton, mouseDragged, mouseReleased, narrate, onClick, onDrag, onRelease, playDownSound, queueNarration, render, renderBg, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidth
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fill, fillGradient, getBlitOffset, hLine, innerBlit, setBlitOffset, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
render
keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled
private final FontRenderer fontRenderer
private java.lang.String text
private int maxStringLength
private int cursorCounter
private boolean enableBackgroundDrawing
private boolean canLoseFocus
private boolean isEnabled
private boolean field_212956_h
private int lineScrollOffset
private int cursorPosition
private int selectionEnd
private int enabledColor
private int disabledColor
private java.lang.String suggestion
private java.util.function.Consumer<java.lang.String> guiResponder
private java.util.function.Predicate<java.lang.String> validator
private java.util.function.BiFunction<java.lang.String,java.lang.Integer,java.lang.String> textFormatter
public TextFieldWidget(FontRenderer fontIn, int xIn, int yIn, int widthIn, int heightIn, java.lang.String msg)
public TextFieldWidget(FontRenderer fontIn, int xIn, int yIn, int widthIn, int heightIn, @Nullable TextFieldWidget p_i51138_6_, java.lang.String msg)
public void setResponder(java.util.function.Consumer<java.lang.String> rssponderIn)
public void setTextFormatter(java.util.function.BiFunction<java.lang.String,java.lang.Integer,java.lang.String> textFormatterIn)
public void tick()
protected java.lang.String getNarrationMessage()
getNarrationMessage
in class Widget
public void setText(java.lang.String textIn)
public java.lang.String getText()
public java.lang.String getSelectedText()
public void setValidator(java.util.function.Predicate<java.lang.String> validatorIn)
public void writeText(java.lang.String textToWrite)
private void onTextChanged(java.lang.String newText)
private void delete(int p_212950_1_)
public void deleteWords(int num)
public void deleteFromCursor(int num)
public int getNthWordFromCursor(int numWords)
private int getNthWordFromPos(int n, int pos)
private int getNthWordFromPosWS(int n, int pos, boolean skipWs)
public void moveCursorBy(int num)
public void setCursorPosition(int pos)
public void clampCursorPosition(int pos)
public void setCursorPositionZero()
public void setCursorPositionEnd()
public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_)
keyPressed
in interface IGuiEventListener
public boolean canWrite()
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_)
charTyped
in interface IGuiEventListener
public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_)
mouseClicked
in interface IGuiEventListener
mouseClicked
in class Widget
public void setFocused2(boolean isFocusedIn)
public void renderButton(int p_renderButton_1_, int p_renderButton_2_, float p_renderButton_3_)
renderButton
in class Widget
private void drawSelectionBox(int startX, int startY, int endX, int endY)
public void setMaxStringLength(int length)
private int getMaxStringLength()
public int getCursorPosition()
private boolean getEnableBackgroundDrawing()
public void setEnableBackgroundDrawing(boolean enableBackgroundDrawingIn)
public void setTextColor(int color)
public void setDisabledTextColour(int color)
public boolean changeFocus(boolean p_changeFocus_1_)
changeFocus
in interface IGuiEventListener
changeFocus
in class Widget
public boolean isMouseOver(double p_isMouseOver_1_, double p_isMouseOver_3_)
isMouseOver
in interface IGuiEventListener
isMouseOver
in class Widget
protected void onFocusedChanged(boolean p_onFocusedChanged_1_)
onFocusedChanged
in class Widget
private boolean isEnabled()
public void setEnabled(boolean enabled)
public int getAdjustedWidth()
public void setSelectionPos(int position)
public void setCanLoseFocus(boolean canLoseFocusIn)
public boolean getVisible()
public void setVisible(boolean isVisible)
public void setSuggestion(@Nullable java.lang.String p_195612_1_)
public int func_195611_j(int p_195611_1_)
public void setX(int xIn)