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 MutableComponentvoidextractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) protected Identifierprotected Identifierprotected voidhandleCursor(GuiGraphicsExtractor graphics) booleankeyPressed(KeyEvent event) voidonClick(MouseButtonEvent event, boolean doubleClick) protected voidonDrag(MouseButtonEvent event, double dx, double dy) voidonRelease(MouseButtonEvent event) voidplayDownSound(SoundManager soundManager) voidsetFocused(boolean focused) protected voidsetValue(double newValue) private voidprotected abstract voidvoidMethods inherited from class AbstractWidget.WithInactiveMessage
defaultInactiveMessage, getMessage, setMessageMethods inherited from class AbstractWidget
clearFGColor, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, getAlpha, getBottom, getFGColor, getHeight, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, playButtonClickSound, 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, preeditUpdated, 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
-
extractWidgetRenderState
public void extractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) - Specified by:
extractWidgetRenderStatein classAbstractWidget
-
handleCursor
- Overrides:
handleCursorin classAbstractWidget
-
onClick
- Overrides:
onClickin classAbstractWidget
-
setFocused
public void setFocused(boolean focused) - Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget
-
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()
-