Class ScrollPanel
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraftforge.client.gui.widget.ScrollPanel
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,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 net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate 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 intFields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATIONFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
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 bgColor) ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColorFrom, int bgColorTo) ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColorFrom, int bgColorTo, int barBgColor, int barColor, int barBorderColor) Base constructor -
Method Summary
Modifier and TypeMethodDescriptionprivate voidList<? extends GuiEventListener>children()protected booleanclickPanel(double mouseX, double mouseY, int button) protected voiddrawBackground(PoseStack matrix, Tesselator tess, float partialTick) Draws the background of the scroll panel.protected voiddrawGradientRect(PoseStack poseStack, int left, int top, int right, int bottom, int color1, int color2) protected abstract voiddrawPanel(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY) Draw anything special on the screen.private intprotected abstract intprivate intprotected intbooleanisMouseOver(double mouseX, double mouseY) booleanmouseClicked(double mouseX, double mouseY, int button) booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) booleanmouseReleased(double mouseX, double mouseY, int button) booleanmouseScrolled(double mouseX, double mouseY, double scroll) voidMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
changeFocus, charTyped, getChildAt, keyPressed, keyReleased, magicalSpecialHackyFocus, setInitialFocusMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
isActive, narrationPriorityMethods inherited from interface net.minecraft.client.gui.narration.NarrationSupplier
updateNarration
-
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 -
bgColorFrom
private final int bgColorFrom -
bgColorTo
private final int bgColorTo -
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 bgColor) - 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 barbgColor- the color for the background
-
ScrollPanel
public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColorFrom, int bgColorTo) - 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 barbgColorFrom- the start color for the background gradientbgColorTo- the end color for the background gradient
-
ScrollPanel
public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColorFrom, int bgColorTo, 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 barbgColorFrom- the start color for the background gradientbgColorTo- the end color for the background gradientbarBgColor- 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(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, 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
protected boolean clickPanel(double mouseX, double mouseY, int button) -
getMaxScroll
private int getMaxScroll() -
applyScrollLimits
private void applyScrollLimits() -
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double scroll) - 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
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) - Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener
-
getBarHeight
private int getBarHeight() -
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) - Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener
-
render
- Specified by:
renderin interfaceRenderable
-
drawGradientRect
protected void drawGradientRect(PoseStack poseStack, int left, int top, int right, int bottom, int color1, int color2) -
children
- Specified by:
childrenin interfaceContainerEventHandler
-