Class MultiLineEditBox
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractTextAreaWidget
net.minecraft.client.gui.components.MultiLineEditBox
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractScrollArea
AbstractScrollArea.ScrollbarSettingsNested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final intprivate static final intprivate static final intprivate final intprivate longprivate final Fontprivate final Componentprivate static final intprivate final intprivate final MultilineTextFieldprivate final booleanFields inherited from class AbstractTextAreaWidget
DEFAULT_TOTAL_PADDINGFields inherited from class AbstractScrollArea
SCROLLBAR_WIDTHFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMultiLineEditBox(Font font, int x, int y, int width, int height, Component placeholder, Component narration, int textColor, boolean textShadow, int cursorColor, boolean showBackground, boolean showDecorations) -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiLineEditBox.Builderbuilder()booleancharTyped(CharacterEvent event) intgetValue()booleankeyPressed(KeyEvent event) voidonClick(MouseButtonEvent event, boolean doubleClick) protected voidonDrag(MouseButtonEvent event, double dx, double dy) protected voidrenderContents(GuiGraphics graphics, int mouseX, int mouseY, float a) protected voidrenderDecorations(GuiGraphics graphics) private voidprivate voidseekCursorScreen(double x, double y) voidsetCharacterLimit(int characterLimit) voidsetFocused(boolean focused) Sets the focus state of the GUI element.voidsetLineLimit(int lineLimit) voidvoidvoidsetValueListener(Consumer<String> valueListener) voidMethods inherited from class AbstractTextAreaWidget
contentHeight, getInnerLeft, getInnerTop, innerPadding, isMouseOver, mouseClicked, playDownSound, renderBackground, renderBorder, renderWidget, scrollBarX, totalInnerPadding, withinContentAreaTopBottomMethods inherited from class AbstractScrollArea
defaultSettings, isOverScrollbar, maxScrollAmount, mouseDragged, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollable, scrollAmount, scrollbarWidth, scrollBarY, scrollerHeight, scrollRate, setScrollAmount, updateScrollingMethods inherited from class AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isValidClickButton, mouseReleased, narrationPriority, nextFocusPath, playButtonClickSound, render, renderScrollingStringOverContents, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GuiEventListener
getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables
-
Field Details
-
CURSOR_INSERT_WIDTH
private static final int CURSOR_INSERT_WIDTH- See Also:
-
CURSOR_COLOR
private static final int CURSOR_COLOR- See Also:
-
CURSOR_APPEND_CHARACTER
- See Also:
-
PLACEHOLDER_TEXT_COLOR
private static final int PLACEHOLDER_TEXT_COLOR -
CURSOR_BLINK_INTERVAL_MS
private static final int CURSOR_BLINK_INTERVAL_MS- See Also:
-
font
-
placeholder
-
textField
-
textColor
private final int textColor -
textShadow
private final boolean textShadow -
cursorColor
private final int cursorColor -
focusedTime
private long focusedTime
-
-
Constructor Details
-
MultiLineEditBox
-
-
Method Details
-
setCharacterLimit
public void setCharacterLimit(int characterLimit) -
setLineLimit
public void setLineLimit(int lineLimit) -
setValueListener
-
setValue
-
setValue
-
getValue
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-
onClick
- Overrides:
onClickin classAbstractWidget
-
onDrag
- Overrides:
onDragin classAbstractWidget
-
keyPressed
- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classAbstractTextAreaWidget
-
charTyped
-
renderContents
- Specified by:
renderContentsin classAbstractTextAreaWidget
-
renderDecorations
- Overrides:
renderDecorationsin classAbstractTextAreaWidget
-
getInnerHeight
public int getInnerHeight()- Specified by:
getInnerHeightin classAbstractTextAreaWidget
-
scrollToCursor
private void scrollToCursor() -
seekCursorScreen
private void seekCursorScreen(double x, double y) -
setFocused
public void setFocused(boolean focused) Description copied from interface:GuiEventListenerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
focused-trueto apply focus,falseto remove focus
-
builder
-