Class AbstractStatWidget<S extends SUStat<?>>
java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.TElement
io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
io.github.thecsdev.betterstats.api.client.gui.stats.widget.AbstractStatWidget<S>
- All Implemented Interfaces:
io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
,io.github.thecsdev.tcdcommons.api.client.util.interfaces.ITooltipProvider
,io.github.thecsdev.tcdcommons.api.util.interfaces.IEnableStateProvider
,io.github.thecsdev.tcdcommons.api.util.interfaces.IEnableStateProviderSetter
- Direct Known Subclasses:
GeneralStatWidget
,ItemStatWidget
,MobStatWidget
,PlayerBadgeStatWidget
public abstract class AbstractStatWidget<S extends SUStat<?>>
extends io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
A GUI widget that displays stats information from a given
SUStat
.-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget.TClickableWidgetEvent_Clicked
Nested classes/interfaces inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
io.github.thecsdev.tcdcommons.api.client.gui.TElement.TElementEvent_ChildAR, io.github.thecsdev.tcdcommons.api.client.gui.TElement.TElementEvent_ContextMenu, io.github.thecsdev.tcdcommons.api.client.gui.TElement.TElementEvent_Moved, io.github.thecsdev.tcdcommons.api.client.gui.TElement.TElementEvent_ParentChanged, io.github.thecsdev.tcdcommons.api.client.gui.TElement.TElementEvent_Resized
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
The background fill color of theAbstractStatWidget
.protected int
The outline color used when thisAbstractStatWidget
is focused or hovered.protected int
The outline color used when thisAbstractStatWidget
is not focused or hovered.protected final S
TheSUStat
.Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
BUTTON_TEXTURE_SLICE_SIZE, BUTTON_TEXTURES, eClicked, enabled, T_WIDGETS_TEXTURE
Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
alpha, eChildAdded, eChildRemoved, eContextMenu, eMoved, eParentChanged, eResized, height, SP_ALL, SP_INVOKE_EVENT, SP_MOVE_CHILDREN, SP_RELATIVE, SP_UPDATE_TOPMOST, SS_ALL, SS_INVOKE_EVENT, SS_UPDATE_TOPMOST, tooltip, tooltipPositioner, width, x, y, zOffset
Fields inherited from interface io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
MAX_CHILD_NESTING_DEPTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
final int
final int
final S
getStat()
Returns theSUStat
associated with thisAbstractStatWidget
.boolean
input
(io.github.thecsdev.tcdcommons.api.client.gui.util.TInputContext inputContext) protected void
onClick()
void
postRender
(io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext pencil) void
render
(io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext pencil) void
setBackgroundColor
(int backgroundColor) void
setFocusOutlineColor
(int focusOutlineColor) void
setOutlineColor
(int outlineColor) Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
click, getEnabled, isFocusable, setEnabled
Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
canBeAddedTo, createContextMenu, getAlpha, getChildren, getHeight, getItemRenderer, getParent, getParentTElement, getParentTScreen, getTextRenderer, getTooltip, getTooltipPositioner, getWidth, getX, getY, getZIndex, getZOffset, isDragging, isEnabled, isEnabledAndVisible, isFocused, isFocusedOrHovered, isHoverable, isHovered, isVisible, move, moveChildren, next, previous, setAlpha, setPosition, setPosition, setSize, setSize, setTooltip, setZOffset, tick, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
addChild, addChild, clearChildren, findChild, findLastChild, findParent, findParentTElement, forEachChild, getEndX, getEndY, input, removeChild, removeChild
-
Field Details
-
stat
TheSUStat
. -
backgroundColor
protected int backgroundColorThe background fill color of theAbstractStatWidget
. -
outlineColor
protected int outlineColorThe outline color used when thisAbstractStatWidget
is not focused or hovered. -
focusOutlineColor
protected int focusOutlineColorThe outline color used when thisAbstractStatWidget
is focused or hovered.
-
-
Constructor Details
-
AbstractStatWidget
- Throws:
NullPointerException
-
-
Method Details
-
getStat
Returns theSUStat
associated with thisAbstractStatWidget
. -
getBackgroundColor
public final int getBackgroundColor() -
getOutlineColor
public final int getOutlineColor() -
getFocusOutlineColor
public final int getFocusOutlineColor() -
setBackgroundColor
public void setBackgroundColor(int backgroundColor) -
setOutlineColor
public void setOutlineColor(int outlineColor) -
setFocusOutlineColor
public void setFocusOutlineColor(int focusOutlineColor) -
onClick
protected void onClick()- Specified by:
onClick
in classio.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
-
input
public boolean input(io.github.thecsdev.tcdcommons.api.client.gui.util.TInputContext inputContext) - Specified by:
input
in interfaceio.github.thecsdev.tcdcommons.api.client.gui.TParentElement
- Overrides:
input
in classio.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
-
render
public void render(io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext pencil) - Specified by:
render
in interfaceio.github.thecsdev.tcdcommons.api.client.gui.TParentElement
- Specified by:
render
in classio.github.thecsdev.tcdcommons.api.client.gui.TElement
-
postRender
public void postRender(io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext pencil) - Overrides:
postRender
in classio.github.thecsdev.tcdcommons.api.client.gui.TElement
-