Class AbstractSliderButton
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage
net.minecraft.client.gui.components.AbstractSliderButton
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
AbstractOptionSliderButton, ExtendedSlider, InputControlHandlers.NumberRangeHandler.SliderImpl, RealmsSlotOptionsScreen.SettingsSlider
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final intprotected booleanprivate static final intprotected static final intprivate static final Identifierprivate static final Identifierprivate static final Identifierprivate static final Identifierprotected static final intprotected doubleFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSliderButton(int x, int y, int width, int height, Component message, double initialValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidprotected MutableComponentprotected Identifierprotected IdentifierbooleankeyPressed(KeyEvent event) voidonClick(MouseButtonEvent event, boolean doubleClick) protected voidonDrag(MouseButtonEvent event, double dx, double dy) voidonRelease(MouseButtonEvent event) voidplayDownSound(SoundManager soundManager) voidrenderWidget(GuiGraphics graphics, int mouseX, int mouseY, float a) voidsetFocused(boolean focused) Sets the focus state of the GUI element.protected voidsetValue(double newValue) private voidprotected abstract voidvoidMethods inherited from class AbstractWidget.WithInactiveMessage
defaultInactiveMessage, getMessage, setMessageMethods inherited from class AbstractWidget
clearFGColor, defaultButtonNarrationText, getAlpha, getBottom, getFGColor, getHeight, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, playButtonClickSound, render, renderScrollingStringOverContents, setAlpha, setFGColor, setHeight, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables
-
Field Details
-
SLIDER_SPRITE
-
HIGHLIGHTED_SPRITE
-
SLIDER_HANDLE_SPRITE
-
SLIDER_HANDLE_HIGHLIGHTED_SPRITE
-
TEXT_MARGIN
protected static final int TEXT_MARGIN- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
HANDLE_WIDTH
protected static final int HANDLE_WIDTH- See Also:
-
HANDLE_HALF_WIDTH
private static final int HANDLE_HALF_WIDTH- See Also:
-
value
protected double value -
canChangeValue
protected boolean canChangeValue -
dragging
protected boolean dragging
-
-
Constructor Details
-
AbstractSliderButton
public AbstractSliderButton(int x, int y, int width, int height, Component message, double initialValue)
-
-
Method Details
-
getSprite
-
getHandleSprite
-
createNarrationMessage
- Overrides:
createNarrationMessagein classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
onClick
- Overrides:
onClickin classAbstractWidget
-
setFocused
public void setFocused(boolean focused) Description copied from interface:GuiEventListenerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
focused-trueto apply focus,falseto remove focus
-
keyPressed
-
setValueFromMouse
-
setValue
protected void setValue(double newValue) -
onDrag
- Overrides:
onDragin classAbstractWidget
-
playDownSound
- Overrides:
playDownSoundin classAbstractWidget
-
onRelease
- Overrides:
onReleasein classAbstractWidget
-
updateMessage
protected abstract void updateMessage() -
applyValue
protected abstract void applyValue()
-