Class ButtonComponent
java.lang.Object
org.rusherhack.client.api.ui.window.content.WindowContent
org.rusherhack.client.api.ui.window.content.component.ButtonComponent
- All Implemented Interfaces:
org.rusherhack.core.interfaces.IClickable
,org.rusherhack.core.interfaces.IHoverable
,org.rusherhack.core.interfaces.INamed
,org.rusherhack.core.interfaces.IScrollable
,org.rusherhack.core.interfaces.ITickable
,org.rusherhack.core.interfaces.ITypeable
TODO: create interface so that ComboContent can modify width as needed
-
Field Summary
Fields inherited from class org.rusherhack.client.api.ui.window.content.WindowContent
contextMenu, x, y
-
Constructor Summary
ConstructorDescriptionButtonComponent
(Window window, String label, double width, double height, Runnable clickAction) ButtonComponent
(Window window, String label, Runnable clickAction) -
Method Summary
Modifier and TypeMethodDescriptionboolean
charTyped
(char character) double
getName()
double
getWidth()
boolean
boolean
boolean
keyTyped
(int key, int scanCode, int modifiers) boolean
mouseClicked
(double mouseX, double mouseY, int button) void
mouseReleased
(double mouseX, double mouseY, int button) boolean
mouseScrolled
(double mouseX, double mouseY, double delta) void
onClick()
void
renderContent
(double mouseX, double mouseY, WindowView parent) void
void
setHeight
(double height) void
void
setPredicate
(Predicate<ButtonComponent> enabledPredicate) void
setPressed
(boolean pressed) void
setWidth
(double width) Methods inherited from class org.rusherhack.client.api.ui.window.content.WindowContent
getContextMenu, getFontRenderer, getRenderer, getWindow, getX, getY, isHovered, setContextMenu, setX, setY, unfocus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.rusherhack.core.interfaces.INamed
getAliases, getDisplayName
Methods inherited from interface org.rusherhack.core.interfaces.ITickable
tick
-
Constructor Details
-
ButtonComponent
-
ButtonComponent
-
-
Method Details
-
renderContent
- Specified by:
renderContent
in classWindowContent
-
getWidth
public double getWidth()- Specified by:
getWidth
in classWindowContent
-
getHeight
public double getHeight()- Specified by:
getHeight
in classWindowContent
-
setWidth
public void setWidth(double width) -
setHeight
public void setHeight(double height) -
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClicked
in interfaceorg.rusherhack.core.interfaces.IClickable
-
mouseReleased
public void mouseReleased(double mouseX, double mouseY, int button) - Specified by:
mouseReleased
in interfaceorg.rusherhack.core.interfaces.IClickable
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double delta) - Specified by:
mouseScrolled
in interfaceorg.rusherhack.core.interfaces.IScrollable
-
charTyped
public boolean charTyped(char character) - Specified by:
charTyped
in interfaceorg.rusherhack.core.interfaces.ITypeable
-
keyTyped
public boolean keyTyped(int key, int scanCode, int modifiers) - Specified by:
keyTyped
in interfaceorg.rusherhack.core.interfaces.ITypeable
-
getName
- Specified by:
getName
in interfaceorg.rusherhack.core.interfaces.INamed
-
setLabel
-
setAction
-
onClick
public void onClick() -
isPressed
public boolean isPressed() -
setPressed
public void setPressed(boolean pressed) -
setPredicate
-
isEnabled
public boolean isEnabled()
-