public class UITab extends UIComponent<UITab>
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 boolean |
active
Whether this
UITab is currently active. |
protected int |
activeTextColor
Text color for this
UITab when active. |
protected boolean |
activeTextShadow
Text shadow for this
UITab when active. |
protected boolean |
autoHeight
|
protected boolean |
autoWidth
|
protected int |
bgColor
Background color for this
UITab . |
protected UIContainer |
container
The container this
UITab is linked to. |
protected int |
hoverTextColor
Text color for this
UITab when hovered. |
protected UIImage |
image
Image for this
UITab . |
protected java.lang.String |
label
Label for this
UITab . |
protected int |
textColor
Text color for this
UITab when not active. |
protected boolean |
textShadow
Text shadow for this
UITab when not active. |
Constructor and Description |
---|
UITab(MalisisGui gui,
java.lang.String label)
Instantiates a new
UITab . |
UITab(MalisisGui gui,
UIImage image)
Instantiates a new
UITab . |
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 . |
int |
getActiveTextColor()
|
int |
getBgColor()
Gets the background color for this
UITab . |
int |
getHoverTextColor()
Gets the text color for this
UITab when not hovered. |
java.lang.String |
getPropertyString()
Gets the property string.
|
ComponentPosition |
getTabPosition()
Gets the
ComponentPosition of this UITab . |
int |
getTextColor()
|
boolean |
isActive() |
boolean |
isActiveTextShadow()
|
boolean |
isAutoHeight()
Checks if height is calculated automatically.
|
boolean |
isAutoWidth()
Checks if the width is calculated automatically.
|
protected boolean |
isHorizontal()
Checks whether this
UITab is horizontally positioned. |
boolean |
isTextShadow()
|
boolean |
onClick(int x,
int y) |
UITab |
setActive(boolean active)
Sets this tab to be active.
|
UITab |
setActiveTextColor(int activeTextColor)
|
UITab |
setActiveTextShadow(boolean activeTextShadow)
|
UITab |
setBgColor(int color)
Sets the baground color for this
UITab . |
UITab |
setContainer(UIContainer container)
Set the
UIContainer linked with this UITab . |
UITab |
setHoveredTextColor(int hovertextColor)
Sets the text color for this
UITab when hovered. |
UITab |
setImage(UIImage image)
Sets the image
UITab . |
UITab |
setLabel(java.lang.String label)
Sets the label for this
UITab . |
UITab |
setOptions(int textColor,
int activeTextColor,
int hoverTextColor,
int bgColor,
boolean textShadow,
boolean activeTextShadow) |
void |
setParent(UIComponent parent)
Sets the parent for this
UITab . |
UITab |
setSize(int width,
int height)
Sets the size of this
UITab . |
UITab |
setTextColor(int textColor)
|
UITab |
setTextShadow(boolean textShadow)
|
addControlComponent, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getGui, getHeight, getName, getParent, getRawHeight, getRawWidth, getTooltip, getWidth, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onButtonPress, onButtonRelease, onDoubleClick, onDrag, onKeyTyped, onMouseMove, onRightClick, onScrollWheel, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setPosition, setPosition, setTooltip, setTooltip, setVisible, setZIndex, toString, unregister
protected java.lang.String label
UITab
.protected boolean autoWidth
protected boolean autoHeight
protected UIContainer container
UITab
is linked to.protected boolean active
UITab
is currently active.protected int textColor
UITab
when not active.protected int activeTextColor
UITab
when active.protected int hoverTextColor
UITab
when hovered.protected boolean textShadow
UITab
when not active.protected boolean activeTextShadow
UITab
when active.protected int bgColor
UITab
.public UITab(MalisisGui gui, java.lang.String label)
UITab
.gui
- the guilabel
- the labelpublic UITab(MalisisGui gui, UIImage image)
UITab
.gui
- the guiimage
- the imagepublic UITab setLabel(java.lang.String label)
UITab
.autoWidth
is true, the height if autoHeight
is true.label
- the labelUITab
public UITab setImage(UIImage image)
UITab
.autoWidth
is true, the height if autoHeight
is true.image
- the imageUITab
public void setParent(UIComponent parent)
UITab
.setParent
in class UIComponent<UITab>
parent
- the new parentjava.lang.IllegalArgumentException
- if the parent is not a UITabGroup
public UITab setSize(int width, int height)
UITab
.label
or image
.setSize
in interface ITransformable.Size<UITab>
setSize
in class UIComponent<UITab>
width
- the widthheight
- the heightUITab
public boolean isAutoWidth()
public boolean isAutoHeight()
public UITab setContainer(UIContainer container)
UIContainer
linked with this UITab
.container
- the containerUITab
public ComponentPosition getTabPosition()
ComponentPosition
of this UITab
.public int getTextColor()
public UITab setTextColor(int textColor)
textColor
- the text colorpublic int getActiveTextColor()
public UITab setActiveTextColor(int activeTextColor)
activeTextColor
- the active text colorUITab
public int getHoverTextColor()
UITab
when not hovered.public UITab setHoveredTextColor(int hovertextColor)
UITab
when hovered.hovertextColor
- the text colorpublic boolean isTextShadow()
public UITab setTextShadow(boolean textShadow)
textShadow
- the text shadowUITab
public boolean isActiveTextShadow()
public UITab setActiveTextShadow(boolean activeTextShadow)
activeTextShadow
- the active text shadowpublic int getBgColor()
UITab
.UITab
.public UITab setOptions(int textColor, int activeTextColor, int hoverTextColor, int bgColor, boolean textShadow, boolean activeTextShadow)
public boolean isActive()
public UITab setActive(boolean active)
active
- true if activeprotected boolean isHorizontal()
UITab
is horizontally positioned.public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponent
UIComponent
.drawBackground
in class UIComponent<UITab>
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<UITab>
renderer
- the renderermouseX
- the mouse xmouseY
- the mouse ypartialTick
- the partial tickpublic boolean onClick(int x, int y)
onClick
in class UIComponent<UITab>
public java.lang.String getPropertyString()
UIComponent
getPropertyString
in class UIComponent<UITab>