Package de.gurkenlabs.litiengine.gui
Class Slider
java.lang.Object
de.gurkenlabs.litiengine.gui.GuiComponent
de.gurkenlabs.litiengine.gui.Slider
- All Implemented Interfaces:
IRenderable
,Tweenable
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
- Direct Known Subclasses:
HorizontalSlider
,VerticalSlider
public abstract class Slider
extends GuiComponent
Field Summary
Constructor Summary
Constructors Modifier Constructor Description protected
Slider(double x, double y, double width, double height, float minValue, float maxValue, float stepSize)
Method Summary
Modifier and Type Method Description ImageComponent
getButton1()
ImageComponent
getButton2()
Spritesheet
getButtonSpritesheet()
java.util.List<java.util.function.Consumer<java.lang.Float>>
getChangeConsumer()
float
getCurrentValue()
float
getMaxValue()
float
getMinValue()
abstract java.awt.geom.Point2D
getRelativeSliderPosition()
ImageComponent
getSliderComponent()
Spritesheet
getSliderSpritesheet()
float
getStepSize()
boolean
isDragging()
void
onChange(java.util.function.Consumer<java.lang.Float> c)
protected void
setButton1(ImageComponent button1)
protected void
setButton2(ImageComponent button2)
void
setButtonSpritesheet(Spritesheet buttonSprite)
void
setCurrentValue(float newValue)
protected void
setSliderComponent(ImageComponent slider)
void
setSliderSpritesheet(Spritesheet sliderSprite)
void
setStepSize(float stepSize)
abstract void
setValueRelativeToMousePosition()
Methods inherited from class de.gurkenlabs.litiengine.gui.GuiComponent
drawTextShadow, getAppearance, getAppearanceDisabled, getAppearanceHovered, getBoundingBox, getClickConsumer, getComponentId, getComponents, getCurrentAppearance, getFont, getHeight, getHoverConsumer, getHoverSound, getLocation, getMouseDraggedConsumer, getMouseEnterConsumer, getMouseLeaveConsumer, getMouseMovedConsumer, getMousePressedConsumer, getMouseReleasedConsumer, getMouseWheelConsumer, getName, getShape, getTag, getText, getTextAlign, getTextAngle, getTextShadowColor, getTextShadowStroke, getTextToRender, getTextValign, getTextX, getTextY, getTweenValues, getWidth, getX, getY, hasAutomaticLineBreaks, hasTextAntialiasing, initializeComponents, isEnabled, isForwardMouseEvents, isHovered, isPressed, isSelected, isSuspended, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseEventShouldBeForwarded, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, onClicked, onHovered, onMouseDragged, onMouseEnter, onMouseLeave, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelScrolled, onTextChanged, prepare, render, setAutomaticLineBreaks, setDimension, setEnabled, setFont, setFontSize, setForwardMouseEvents, setHeight, setHovered, setHoverSound, setLocation, setLocation, setName, setSelected, setTag, setText, setTextAlign, setTextAngle, setTextAntialiasing, setTextShadow, setTextShadowColor, setTextShadowStroke, setTextValign, setTextX, setTextY, setTweenValues, setVisible, setWidth, setX, setY, suspend, toggleSelection, toggleSuspension
Constructor Details
Slider
protected Slider(double x, double y, double width, double height, float minValue, float maxValue, float stepSize)
Method Details
getButton1
getButton2
getButtonSpritesheet
getChangeConsumer
public java.util.List<java.util.function.Consumer<java.lang.Float>> getChangeConsumer()getCurrentValue
public float getCurrentValue()getMaxValue
public float getMaxValue()getMinValue
public float getMinValue()getRelativeSliderPosition
public abstract java.awt.geom.Point2D getRelativeSliderPosition()getSliderComponent
getSliderSpritesheet
getStepSize
public float getStepSize()isDragging
public boolean isDragging()onChange
public void onChange(java.util.function.Consumer<java.lang.Float> c)setButtonSpritesheet
setSliderSpritesheet
setCurrentValue
public void setCurrentValue(float newValue)setStepSize
public void setStepSize(float stepSize)setValueRelativeToMousePosition
public abstract void setValueRelativeToMousePosition()setButton1
setButton2
setSliderComponent