Class AbstractScrollArea
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
AbstractContainerWidget, AbstractTextAreaWidget
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate static final intstatic final intprivate final AbstractScrollArea.ScrollbarSettingsprivate static final Identifierprivate static final Identifierprivate booleanFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractScrollArea(int x, int y, int width, int height, Component message, AbstractScrollArea.ScrollbarSettings scrollbarSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intdefaultSettings(int scrollRate) protected booleanisOverScrollbar(double x, double y) intbooleanmouseDragged(MouseButtonEvent event, double dx, double dy) booleanmouseScrolled(double mx, double my, double scrollX, double scrollY) voidonRelease(MouseButtonEvent event) voidprotected voidrenderScrollbar(GuiGraphics graphics, int mouseX, int mouseY) protected booleandoubleintprotected intintprotected intprotected doublevoidsetScrollAmount(double scrollAmount) booleanupdateScrolling(MouseButtonEvent event) Methods inherited from class AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, playButtonClickSound, playDownSound, render, renderScrollingStringOverContents, renderWidget, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables
-
Field Details
-
SCROLLBAR_WIDTH
public static final int SCROLLBAR_WIDTH- See Also:
-
SCROLLBAR_MIN_HEIGHT
private static final int SCROLLBAR_MIN_HEIGHT- See Also:
-
SCROLLER_SPRITE
-
SCROLLER_BACKGROUND_SPRITE
-
scrollbarSettings
-
scrollAmount
private double scrollAmount -
scrolling
private boolean scrolling
-
-
Constructor Details
-
AbstractScrollArea
public AbstractScrollArea(int x, int y, int width, int height, Component message, AbstractScrollArea.ScrollbarSettings scrollbarSettings)
-
-
Method Details
-
mouseScrolled
public boolean mouseScrolled(double mx, double my, double scrollX, double scrollY) -
mouseDragged
- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractWidget
-
onRelease
- Overrides:
onReleasein classAbstractWidget
-
scrollAmount
public double scrollAmount() -
setScrollAmount
public void setScrollAmount(double scrollAmount) -
updateScrolling
-
isOverScrollbar
protected boolean isOverScrollbar(double x, double y) -
refreshScrollAmount
public void refreshScrollAmount() -
maxScrollAmount
public int maxScrollAmount() -
scrollable
protected boolean scrollable() -
scrollbarWidth
public int scrollbarWidth() -
scrollerHeight
protected int scrollerHeight() -
scrollBarX
protected int scrollBarX() -
scrollBarY
public int scrollBarY() -
renderScrollbar
-
contentHeight
protected abstract int contentHeight() -
scrollRate
protected double scrollRate() -
defaultSettings
-