Class ScrollPanel
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.neoforged.neoforge.client.gui.widget.ScrollPanel
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
ModListScreen.InfoPanel, ModMismatchDisconnectedScreen.MismatchInfoPanel
public abstract class ScrollPanel
extends AbstractContainerEventHandler
implements Renderable, NarratableEntry
Abstract scroll panel class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate final intprivate final intprivate final intprotected final intprotected final intprotected booleanprivate final Minecraftprotected final intprotected final intprotected final intprotected floatprivate booleanprotected final intprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionScrollPanel(Minecraft client, int width, int height, int top, int left) ScrollPanel(Minecraft client, int width, int height, int top, int left, int border) ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth) ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int barBgColor, int barColor, int barBorderColor) Base constructor -
Method Summary
Modifier and TypeMethodDescriptionprivate voidList<? extends GuiEventListener> children()protected booleanclickPanel(double mouseX, double mouseY, MouseButtonEvent event) protected voiddrawBackground(GuiGraphicsExtractor guiGraphics, float partialTick) Draws the background of the scroll panel.protected voiddrawGradientRect(GuiGraphicsExtractor guiGraphics, int left, int top, int right, int bottom, int color1, int color2) protected abstract voiddrawPanel(GuiGraphicsExtractor guiGraphics, int entryRight, int relativeY, int mouseX, int mouseY) Draw anything special on the screen.voidextractRenderState(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick) private intprotected abstract intprivate intprotected intbooleanisMouseOver(double mouseX, double mouseY) booleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(MouseButtonEvent event, double deltaX, double deltaY) booleanmouseReleased(MouseButtonEvent event) booleanmouseScrolled(double x, double y, double scrollX, double scrollY) Methods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyPressed, keyReleased, nextFocusPath, preeditUpdated, setFocusedMethods inherited from interface GuiEventListener
getRectangle, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface NarratableEntry
getNarratables, isActive, narrationPriorityMethods inherited from interface NarrationSupplier
updateNarrationMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
client
-
width
protected final int width -
height
protected final int height -
top
protected final int top -
bottom
protected final int bottom -
right
protected final int right -
left
protected final int left -
scrolling
private boolean scrolling -
scrollDistance
protected float scrollDistance -
captureMouse
protected boolean captureMouse -
border
protected final int border -
barWidth
private final int barWidth -
barLeft
private final int barLeft -
barBgColor
private final int barBgColor -
barColor
private final int barColor -
barBorderColor
private final int barBorderColor
-
-
Constructor Details
-
ScrollPanel
- Parameters:
client- the minecraft instance this ScrollPanel should usewidth- the widthheight- the heighttop- the offset from the top (y coord)left- the offset from the left (x coord)
-
ScrollPanel
- Parameters:
client- the minecraft instance this ScrollPanel should usewidth- the widthheight- the heighttop- the offset from the top (y coord)left- the offset from the left (x coord)border- the size of the border
-
ScrollPanel
public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth) - Parameters:
client- the minecraft instance this ScrollPanel should usewidth- the widthheight- the heighttop- the offset from the top (y coord)left- the offset from the left (x coord)border- the size of the borderbarWidth- the width of the scroll bar
-
ScrollPanel
public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int barBgColor, int barColor, int barBorderColor) Base constructor- Parameters:
client- the minecraft instance this ScrollPanel should usewidth- the widthheight- the heighttop- the offset from the top (y coord)left- the offset from the left (x coord)border- the size of the borderbarWidth- the width of the scroll barbarBgColor- the color for the scroll bar backgroundbarColor- the color for the scroll bar handlebarBorderColor- the border color for the scroll bar handle
-
-
Method Details
-
getContentHeight
protected abstract int getContentHeight() -
drawBackground
Draws the background of the scroll panel. This runs AFTER Scissors are enabled. -
drawPanel
protected abstract void drawPanel(GuiGraphicsExtractor guiGraphics, int entryRight, int relativeY, int mouseX, int mouseY) Draw anything special on the screen. Scissor (RenderSystem.enableScissor) is enabled for anything that is rendered outside the view box. Do not mess with Scissor unless you support this. -
clickPanel
-
getMaxScroll
private int getMaxScroll() -
applyScrollLimits
private void applyScrollLimits() -
mouseScrolled
public boolean mouseScrolled(double x, double y, double scrollX, double scrollY) - Specified by:
mouseScrolledin interfaceContainerEventHandler- Specified by:
mouseScrolledin interfaceGuiEventListener
-
getScrollAmount
protected int getScrollAmount() -
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) - Specified by:
isMouseOverin interfaceGuiEventListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener
-
getBarHeight
private int getBarHeight() -
mouseDragged
- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener
-
extractRenderState
public void extractRenderState(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick) - Specified by:
extractRenderStatein interfaceRenderable
-
drawGradientRect
protected void drawGradientRect(GuiGraphicsExtractor guiGraphics, int left, int top, int right, int bottom, int color1, int color2) -
children
- Specified by:
childrenin interfaceContainerEventHandler
-