@Environment(value=CLIENT) public abstract class EntryListWidget<E extends EntryListWidget.Entry<E>> extends AbstractParentElement implements Drawable
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
EntryListWidget.Entries |
static class |
EntryListWidget.Entry<E extends EntryListWidget.Entry<E>> |
static class |
EntryListWidget.MoveDirection
Represents the direction in which the selection is moved.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
bottom |
protected boolean |
centerListVertically |
private List<E> |
children |
protected MinecraftClient |
client |
private boolean |
field_26846 |
private boolean |
field_26847 |
protected int |
headerHeight |
protected int |
height |
protected int |
itemHeight |
protected int |
left |
private boolean |
renderHeader |
private boolean |
renderSelection |
protected int |
right |
private double |
scrollAmount |
private boolean |
scrolling |
private E |
selected |
protected int |
top |
protected int |
width |
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE| Constructor and Description |
|---|
EntryListWidget(MinecraftClient client,
int width,
int height,
int top,
int bottom,
int itemHeight) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
addEntry(E entry) |
protected void |
centerScrollOn(E entry) |
List<E> |
children()
Gets a list of all child GUI elements.
|
protected void |
clearEntries() |
protected void |
clickedHeader(int x,
int y) |
protected void |
ensureVisible(E entry) |
protected E |
getEntry(int index) |
protected E |
getEntryAtPosition(double x,
double y) |
E |
getFocused() |
protected int |
getItemCount() |
protected int |
getMaxPosition() |
int |
getMaxScroll() |
private int |
getRowBottom(int index) |
int |
getRowLeft() |
protected int |
getRowTop(int index) |
int |
getRowWidth() |
double |
getScrollAmount() |
protected int |
getScrollbarPositionX() |
E |
getSelected() |
protected boolean |
isFocused() |
boolean |
isMouseOver(double mouseX,
double mouseY)
Checks if the mouse position is within the bound
of the element.
|
protected boolean |
isSelectedItem(int index) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
private void |
method_29621(EntryListWidget.Entry<E> entry) |
protected void |
method_30015() |
void |
method_31322(boolean bool) |
void |
method_31323(boolean bool) |
int |
method_31383() |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
Callback for when a mouse button drag event
has been captured.
|
boolean |
mouseReleased(double mouseX,
double mouseY,
int button)
Callback for when a mouse button release event
has been captured.
|
boolean |
mouseScrolled(double mouseX,
double mouseY,
double amount)
Callback for when a mouse button scroll event
has been captured.
|
protected void |
moveSelection(EntryListWidget.MoveDirection direction) |
protected void |
moveSelectionIf(EntryListWidget.MoveDirection direction,
Predicate<E> predicate)
Moves the selection in the specified direction until the predicate returns true.
|
protected E |
remove(int index) |
protected boolean |
removeEntry(E entry) |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
protected void |
renderBackground(MatrixStack matrices) |
protected void |
renderDecorations(MatrixStack matrixStack,
int int2,
int int3) |
protected void |
renderHeader(MatrixStack matrices,
int x,
int y,
Tessellator tessellator) |
protected void |
renderList(MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY,
float delta) |
protected void |
replaceEntries(Collection<E> newEntries) |
private void |
scroll(int amount) |
void |
setLeftPos(int left) |
protected void |
setRenderHeader(boolean renderHeader,
int headerHeight) |
void |
setRenderSelection(boolean renderSelection) |
void |
setScrollAmount(double amount) |
void |
setSelected(E entry) |
protected void |
updateScrollingState(double mouseX,
double mouseY,
int button) |
void |
updateSize(int width,
int height,
int top,
int bottom) |
isDragging, setDragging, setFocuseddrawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangeFocus, charTyped, focusOn, hoveredElement, keyReleased, setInitialFocusmouseMovedprotected final MinecraftClient client
protected final int itemHeight
private final List<E extends EntryListWidget.Entry<E>> children
protected int width
protected int height
protected int top
protected int bottom
protected int right
protected int left
protected boolean centerListVertically
private double scrollAmount
private boolean renderSelection
private boolean renderHeader
protected int headerHeight
private boolean scrolling
private E extends EntryListWidget.Entry<E> selected
private boolean field_26846
private boolean field_26847
public EntryListWidget(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight)
public void setRenderSelection(boolean renderSelection)
protected void setRenderHeader(boolean renderHeader,
int headerHeight)
public int getRowWidth()
public void method_31322(boolean bool)
public void method_31323(boolean bool)
@Nullable public E getFocused()
getFocused in interface ParentElementgetFocused in class AbstractParentElementpublic final List<E> children()
children in interface ParentElementprotected final void clearEntries()
protected void replaceEntries(Collection<E> newEntries)
protected E getEntry(int index)
protected int addEntry(E entry)
protected int getItemCount()
protected boolean isSelectedItem(int index)
public void updateSize(int width,
int height,
int top,
int bottom)
public void setLeftPos(int left)
protected int getMaxPosition()
protected void clickedHeader(int x,
int y)
protected void renderHeader(MatrixStack matrices, int x, int y, Tessellator tessellator)
protected void renderBackground(MatrixStack matrices)
protected void renderDecorations(MatrixStack matrixStack, int int2, int int3)
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
protected void centerScrollOn(E entry)
protected void ensureVisible(E entry)
private void scroll(int amount)
public double getScrollAmount()
public void setScrollAmount(double amount)
public int getMaxScroll()
protected void updateScrollingState(double mouseX,
double mouseY,
int button)
protected int getScrollbarPositionX()
public boolean mouseClicked(double mouseX,
double mouseY,
int button)
GLFW class.mouseClicked in interface ElementmouseClicked in interface ParentElementmouseX - the X coordinate of the mousemouseY - the Y coordinate of the mousebutton - the mouse button numbertrue to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int),
GLFW.GLFW_MOUSE_BUTTON_1public boolean mouseReleased(double mouseX,
double mouseY,
int button)
GLFW class.mouseReleased in interface ElementmouseReleased in interface ParentElementmouseX - the X coordinate of the mousemouseY - the Y coordinate of the mousebutton - the mouse button numbertrue to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int),
GLFW.GLFW_MOUSE_BUTTON_1public boolean mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
GLFW class.mouseDragged in interface ElementmouseDragged in interface ParentElementmouseX - the current X coordinate of the mousemouseY - the current Y coordinate of the mousebutton - the mouse button numberdeltaX - the difference of the current X with the previous X coordinatedeltaY - the difference of the current Y with the previous Y coordinatetrue to indicate that the event handling is successful/validMouse.onCursorPos(long, double, double),
GLFW.GLFW_MOUSE_BUTTON_1public boolean mouseScrolled(double mouseX,
double mouseY,
double amount)
mouseScrolled in interface ElementmouseScrolled in interface ParentElementmouseX - the X coordinate of the mousemouseY - the Y coordinate of the mouseamount - value is > 1 if scrolled down, < 1 if scrolled uptrue to indicate that the event handling is successful/validMouse.onMouseScroll(long, double, double)public boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
GLFW class.keyPressed in interface ElementkeyPressed in interface ParentElementkeyCode - the named key code of the event as described in the GLFW classscanCode - the unique/platform-specific scan code of the keyboard inputmodifiers - a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int),
GLFW.GLFW_KEY_Q,
GLFWKeyCallbackI.invoke(long, int, int, int, int)protected void moveSelection(EntryListWidget.MoveDirection direction)
protected void method_30015()
protected void moveSelectionIf(EntryListWidget.MoveDirection direction, Predicate<E> predicate)
direction - the direction to move the selectionpublic boolean isMouseOver(double mouseX,
double mouseY)
isMouseOver in interface ElementmouseX - the X coordinate of the mousemouseY - the Y coordinate of the mousetrue if the mouse is within the bound of the element, otherwise falseprotected void renderList(MatrixStack matrices, int x, int y, int mouseX, int mouseY, float delta)
public int getRowLeft()
public int method_31383()
protected int getRowTop(int index)
private int getRowBottom(int index)
protected boolean isFocused()
protected E remove(int index)
protected boolean removeEntry(E entry)
private void method_29621(EntryListWidget.Entry<E> entry)