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

public class ButtonComponent extends WindowContent implements org.rusherhack.core.interfaces.INamed
TODO: create interface so that ComboContent can modify width as needed
  • Constructor Details

    • ButtonComponent

      public ButtonComponent(Window window, String label, Runnable clickAction)
    • ButtonComponent

      public ButtonComponent(Window window, String label, double width, double height, Runnable clickAction)
  • Method Details

    • renderContent

      public void renderContent(double mouseX, double mouseY, WindowView parent)
      Specified by:
      renderContent in class WindowContent
    • getWidth

      public double getWidth()
      Specified by:
      getWidth in class WindowContent
    • getHeight

      public double getHeight()
      Specified by:
      getHeight in class WindowContent
    • 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 interface org.rusherhack.core.interfaces.IClickable
    • mouseReleased

      public void mouseReleased(double mouseX, double mouseY, int button)
      Specified by:
      mouseReleased in interface org.rusherhack.core.interfaces.IClickable
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double delta)
      Specified by:
      mouseScrolled in interface org.rusherhack.core.interfaces.IScrollable
    • charTyped

      public boolean charTyped(char character)
      Specified by:
      charTyped in interface org.rusherhack.core.interfaces.ITypeable
    • keyTyped

      public boolean keyTyped(int key, int scanCode, int modifiers)
      Specified by:
      keyTyped in interface org.rusherhack.core.interfaces.ITypeable
    • getName

      public String getName()
      Specified by:
      getName in interface org.rusherhack.core.interfaces.INamed
    • setLabel

      public void setLabel(String name)
    • setAction

      public void setAction(Runnable action)
    • onClick

      public void onClick()
    • isPressed

      public boolean isPressed()
    • setPressed

      public void setPressed(boolean pressed)
    • setPredicate

      public void setPredicate(Predicate<ButtonComponent> enabledPredicate)
    • isEnabled

      public boolean isEnabled()