public class UICheckBox extends UIComponent<UICheckBox>
Modifier and Type | Class and Description |
---|---|
static class |
UICheckBox.CheckEvent
Event fired when a
UICheckBox is checked or unchecked. |
ITransformable.Alpha, ITransformable.Brightness, ITransformable.Color, ITransformable.Position<T>, ITransformable.Rotate, ITransformable.Scale, ITransformable.Size<T>, ITransformable.Translate
Modifier and Type | Field and Description |
---|---|
protected GuiIcon |
bgIcon |
protected GuiIcon |
bgIconDisabled |
protected GuiIcon |
cbChecked |
protected GuiIcon |
cbDisabled |
protected GuiIcon |
cbHovered |
Constructor and Description |
---|
UICheckBox(MalisisGui gui) |
UICheckBox(MalisisGui gui,
java.lang.String label) |
Modifier and Type | Method and Description |
---|---|
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 . |
boolean |
isChecked() |
boolean |
onClick(int x,
int y) |
boolean |
onKeyTyped(char keyChar,
int keyCode)
Called when a key is typed while this
UIComponent is focused or hovered. |
UICheckBox |
setChecked(boolean checked)
Sets the state for this
UICheckBox . |
java.lang.String |
toString() |
addControlComponent, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getGui, getHeight, getName, getParent, getPropertyString, getRawHeight, getRawWidth, getTooltip, getWidth, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onButtonPress, onButtonRelease, onDoubleClick, onDrag, onMouseMove, onRightClick, onScrollWheel, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setTooltip, setVisible, setZIndex, unregister
protected GuiIcon bgIcon
protected GuiIcon bgIconDisabled
protected GuiIcon cbDisabled
protected GuiIcon cbChecked
protected GuiIcon cbHovered
public UICheckBox(MalisisGui gui, java.lang.String label)
public UICheckBox(MalisisGui gui)
public boolean isChecked()
UICheckBox
is checked or not.public UICheckBox setChecked(boolean checked)
UICheckBox
. Does not fire CheckEvent.checked
- true if checkedUIComponent
public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponent
UIComponent
.drawBackground
in class UIComponent<UICheckBox>
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<UICheckBox>
renderer
- the renderermouseX
- the mouse xmouseY
- the mouse ypartialTick
- the partial tickpublic boolean onClick(int x, int y)
onClick
in class UIComponent<UICheckBox>
public boolean onKeyTyped(char keyChar, int keyCode)
UIComponent
UIComponent
is focused or hovered.onKeyTyped
in class UIComponent<UICheckBox>
keyChar
- the key charkeyCode
- the key codepublic java.lang.String toString()
toString
in class UIComponent<UICheckBox>