@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>> |
| Modifier and Type | Field and Description |
|---|---|
protected int |
bottom |
protected boolean |
centerListVertically |
private List<E> |
children |
protected MinecraftClient |
client |
protected int |
headerHeight |
protected int |
height |
protected int |
itemHeight |
protected int |
left |
protected boolean |
renderHeader |
protected boolean |
renderSelection |
protected int |
right |
private double |
scrollAmount |
private boolean |
scrolling |
private E |
selected |
protected int |
top |
protected int |
width |
protected int |
yDrag |
BACKGROUND_TEXTURE, GUI_ICONS_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() |
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() |
private int |
getMaxScroll() |
private int |
getRowBottom(int index) |
protected 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) |
protected boolean |
isSelectedItem(int index) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button) |
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY) |
boolean |
mouseReleased(double mouseX,
double mouseY,
int button) |
boolean |
mouseScrolled(double mouseX,
double mouseY,
double amount) |
protected void |
moveSelection(int amount) |
protected E |
remove(int index) |
protected boolean |
removeEntry(E entry) |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
protected void |
renderBackground(MatrixStack matrixStack) |
protected void |
renderDecorations(MatrixStack matrixStack,
int int2,
int int3) |
protected void |
renderHeader(MatrixStack matrixStack,
int y,
int int2,
Tessellator tessellator) |
protected void |
renderHoleBackground(int top,
int bottom,
int alphaTop,
int alphaBottom) |
protected void |
renderList(MatrixStack matrixStack,
int int2,
int int3,
int int4,
int int5,
float float2) |
protected void |
replaceEntries(Collection<E> newEntries) |
private void |
scroll(int amount) |
void |
setLeftPos(int left) |
protected void |
setRenderHeader(boolean renderHeader,
int headerHeight) |
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, drawHorizontalLine, drawSprite, drawString, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawVerticalLine, fill, fillGradient, getZOffset, method_27535, 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
protected int yDrag
private double scrollAmount
protected boolean renderSelection
protected boolean renderHeader
protected int headerHeight
private boolean scrolling
private E extends EntryListWidget.Entry<E> selected
public EntryListWidget(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight)
protected void setRenderHeader(boolean renderHeader,
int headerHeight)
public int getRowWidth()
@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 matrixStack, int y, int int2, Tessellator tessellator)
protected void renderBackground(MatrixStack matrixStack)
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)
private int getMaxScroll()
protected void updateScrollingState(double mouseX,
double mouseY,
int button)
protected int getScrollbarPositionX()
public boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface ElementmouseClicked in interface ParentElementpublic boolean mouseReleased(double mouseX,
double mouseY,
int button)
mouseReleased in interface ElementmouseReleased in interface ParentElementpublic boolean mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
mouseDragged in interface ElementmouseDragged in interface ParentElementpublic boolean mouseScrolled(double mouseX,
double mouseY,
double amount)
mouseScrolled in interface ElementmouseScrolled in interface ParentElementpublic boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
keyPressed in interface ElementkeyPressed in interface ParentElementprotected void moveSelection(int amount)
public boolean isMouseOver(double mouseX,
double mouseY)
isMouseOver in interface Elementprotected void renderList(MatrixStack matrixStack, int int2, int int3, int int4, int int5, float float2)
protected int getRowLeft()
protected int getRowTop(int index)
private int getRowBottom(int index)
protected boolean isFocused()
protected void renderHoleBackground(int top,
int bottom,
int alphaTop,
int alphaBottom)
protected E remove(int index)
protected boolean removeEntry(E entry)