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)
On button press.
|
void |
onContentUpdate(ContentUpdateEvent event) |
boolean |
onDrag(int lastX,
int lastY,
int x,
int y,
MouseButton button)
On drag.
|
boolean |
onKeyTyped(char keyChar,
int keyCode)
Called when a key is typed inside
MalisisGui. |
boolean |
onScrollWheel(int x,
int y,
int delta)
On scroll wheel.
|
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, getRenderer, 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, unregisterclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdraw, getComponentAt, getParent, setParentprotected 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()
UIComponentUIComponent.getWidth in class UIComponent<UIScrollBar>public int getHeight()
UIComponentUIComponent.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)
UIComponentUIComponent.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)
UIComponentUIComponent.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)
UIComponentonButtonPress in class UIComponent<UIScrollBar>x - the xy - the ybutton - the buttonpublic boolean onDrag(int lastX,
int lastY,
int x,
int y,
MouseButton button)
UIComponentonDrag in class UIComponent<UIScrollBar>lastX - the last xlastY - the last yx - the xy - the ybutton - the buttonpublic boolean onScrollWheel(int x,
int y,
int delta)
UIComponentonScrollWheel in interface IControlComponentonScrollWheel in class UIComponent<UIScrollBar>x - the xy - the ydelta - the deltapublic boolean onKeyTyped(char keyChar,
int keyCode)
IKeyListenerMalisisGui.onKeyTyped in interface IControlComponentonKeyTyped in interface IKeyListeneronKeyTyped in class UIComponent<UIScrollBar>keyChar - the key charkeyCode - the key codepublic java.lang.String getPropertyString()
UIComponentgetPropertyString in class UIComponent<UIScrollBar>public static UIScrollBar getScrollbar(UIComponent component, UIScrollBar.Type type)
public static void addScrollbar(UIComponent component, UIScrollBar scrollbar)