public class UIScrollBar extends UIComponent<UIScrollBar> implements IControlComponent
Modifier and Type | Class and Description |
---|---|
static class |
UIScrollBar.Type |
ITransformable.Alpha, ITransformable.Brightness, ITransformable.Color, ITransformable.Position<T>, ITransformable.Rotate, ITransformable.Scale, ITransformable.Size<T>, ITransformable.Translate
Modifier and Type | Field and Description |
---|---|
boolean |
autoHide |
protected GuiIcon |
disabledIcon |
protected GuiIcon |
horizontalDisabledIcon |
protected GuiIcon |
horizontalIcon |
protected int |
scrollHeight |
protected GuiShape |
scrollShape |
protected int |
scrollThickness |
protected UIScrollBar.Type |
type |
protected GuiIcon |
verticalDisabledIcon |
protected GuiIcon |
verticalIcon |
Constructor and Description |
---|
UIScrollBar(MalisisGui gui,
T parent,
UIScrollBar.Type type) |
Modifier and Type | Method and Description |
---|---|
static void |
addScrollbar(UIComponent component,
UIScrollBar scrollbar) |
protected void |
createShape(MalisisGui gui) |
void |
drawBackground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Called first when drawing this
UIComponent . |
void |
drawForeground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Called last when drawing this
UIComponent . |
int |
getHeight()
Gets the height of this
UIComponent . |
int |
getLength() |
float |
getOffset() |
java.lang.String |
getPropertyString()
Gets the property string.
|
protected IScrollable |
getScrollable() |
static UIScrollBar |
getScrollbar(UIComponent component,
UIScrollBar.Type type) |
int |
getWidth()
Gets the width of this
UIComponent . |
boolean |
hasVisibleOtherScrollbar() |
boolean |
isHorizontal() |
boolean |
onButtonPress(int x,
int y,
MouseButton button) |
void |
onContentUpdate(ContentUpdateEvent event) |
boolean |
onDrag(int lastX,
int lastY,
int x,
int y,
MouseButton button) |
boolean |
onKeyTyped(char keyChar,
int keyCode)
Called when a key is typed while this
UIComponent is focused or hovered. |
boolean |
onScrollWheel(int x,
int y,
int delta)
Called when the scrollwheel is used when this
IControlComponent or its parent is focused or hovered. |
void |
scrollBy(float amount) |
void |
scrollTo(float offset) |
UIScrollBar |
setAutoHide(boolean autoHide) |
UIScrollBar |
setLength(int length) |
protected void |
setPosition() |
void |
setScrollSize(int thickness,
int height)
Sets the scroll size.
|
void |
updateScrollbars() |
addControlComponent, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getGui, getName, getParent, getRawHeight, getRawWidth, getTooltip, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onButtonRelease, onClick, onDoubleClick, onMouseMove, onRightClick, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setTooltip, setVisible, setZIndex, toString, unregister
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
draw, getComponentAt, getParent, setParent
protected int scrollThickness
protected int scrollHeight
protected GuiIcon disabledIcon
protected GuiIcon verticalIcon
protected GuiIcon verticalDisabledIcon
protected GuiIcon horizontalIcon
protected GuiIcon horizontalDisabledIcon
protected UIScrollBar.Type type
public boolean autoHide
protected GuiShape scrollShape
public UIScrollBar(MalisisGui gui, T parent, UIScrollBar.Type type)
public void setScrollSize(int thickness, int height)
thickness
- the thicknessheight
- the heightprotected void setPosition()
protected void createShape(MalisisGui gui)
protected IScrollable getScrollable()
public boolean hasVisibleOtherScrollbar()
public boolean isHorizontal()
public UIScrollBar setAutoHide(boolean autoHide)
public int getWidth()
UIComponent
UIComponent
.getWidth
in class UIComponent<UIScrollBar>
public int getHeight()
UIComponent
UIComponent
.getHeight
in class UIComponent<UIScrollBar>
public int getLength()
public UIScrollBar setLength(int length)
public float getOffset()
public void scrollTo(float offset)
public void scrollBy(float amount)
public void updateScrollbars()
public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponent
UIComponent
.drawBackground
in class UIComponent<UIScrollBar>
renderer
- the renderermouseX
- the mouse xmouseY
- the mouse ypartialTick
- the partial tickpublic void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponent
UIComponent
.drawForeground
in class UIComponent<UIScrollBar>
renderer
- the renderermouseX
- the mouse xmouseY
- the mouse ypartialTick
- the partial tickpublic void onContentUpdate(ContentUpdateEvent event)
public boolean onButtonPress(int x, int y, MouseButton button)
onButtonPress
in class UIComponent<UIScrollBar>
public boolean onDrag(int lastX, int lastY, int x, int y, MouseButton button)
onDrag
in class UIComponent<UIScrollBar>
public boolean onScrollWheel(int x, int y, int delta)
IControlComponent
IControlComponent
or its parent is focused or hovered.UIComponent.onScrollWheel(int, int, int)
onScrollWheel
in interface IControlComponent
onScrollWheel
in class UIComponent<UIScrollBar>
x
- the xy
- the ydelta
- the deltapublic boolean onKeyTyped(char keyChar, int keyCode)
UIComponent
UIComponent
is focused or hovered.onKeyTyped
in interface IControlComponent
onKeyTyped
in class UIComponent<UIScrollBar>
keyChar
- the key charkeyCode
- the key codepublic java.lang.String getPropertyString()
UIComponent
getPropertyString
in class UIComponent<UIScrollBar>
public static UIScrollBar getScrollbar(UIComponent component, UIScrollBar.Type type)
public static void addScrollbar(UIComponent component, UIScrollBar scrollbar)