java.lang.Object
org.rusherhack.client.api.ui.ElementBase
org.rusherhack.client.api.feature.window.Window
All Implemented Interfaces:
Globals, org.rusherhack.core.bind.IBindable, org.rusherhack.core.feature.IFeature, org.rusherhack.core.feature.IFeatureConfigurable, org.rusherhack.core.interfaces.IClickable, org.rusherhack.core.interfaces.IDraggable, org.rusherhack.core.interfaces.IHideable, 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, org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>, org.rusherhack.core.serialize.JsonSerializable
Direct Known Subclasses:
PinnableWindow, PopupWindow

public abstract class Window extends ElementBase implements org.rusherhack.core.feature.IFeatureConfigurable, Globals, org.rusherhack.core.interfaces.IDraggable, org.rusherhack.core.interfaces.IScrollable, org.rusherhack.core.interfaces.ITypeable, org.rusherhack.core.interfaces.ITickable, org.rusherhack.core.interfaces.IHideable, org.rusherhack.core.bind.IBindable, org.rusherhack.core.serialize.JsonSerializable
  • Field Details

    • width

      protected double width
      Window size
    • height

      protected double height
      Window size
  • Constructor Details

    • Window

      public Window(String title, double width, double height)
      Constructs a new Window with the specified title and size. The position of the window is set to (100, 100).
      Parameters:
      title - the title of the window
      width - the width of the window
      height - the height of the window
    • Window

      public Window(String title, double x, double y, double width, double height)
      Constructs a new Window with the specified title, position and size.
      Parameters:
      title - the title of the window
      x - the x-coordinate of the window's position
      y - the y-coordinate of the window's position
      width - the width of the window
      height - the height of the window
  • Method Details

    • getRootView

      public abstract WindowView getRootView()
      The root view that should contain all of this window's content
      Returns:
      the root view of this window
    • 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
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
      Specified by:
      mouseMoved in interface org.rusherhack.core.interfaces.IDraggable
    • mouseScrolled

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

      public void tick()
      Specified by:
      tick in interface org.rusherhack.core.interfaces.ITickable
    • 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
    • isHovered

      public boolean isHovered(double mouseX, double mouseY)
      Specified by:
      isHovered in interface org.rusherhack.core.interfaces.IHoverable
    • getName

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

      public String getDescription()
      Specified by:
      getDescription in interface org.rusherhack.core.feature.IFeature
    • setDescription

      public void setDescription(String description)
    • getSettings

      public List<org.rusherhack.core.setting.Setting<?>> getSettings()
      Specified by:
      getSettings in interface org.rusherhack.core.feature.IFeatureConfigurable
    • getWidth

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

      public double getHeight()
      Specified by:
      getHeight in class ElementBase
    • isHidden

      public boolean isHidden()
      Specified by:
      isHidden in interface org.rusherhack.core.interfaces.IHideable
    • setHidden

      public void setHidden(boolean hidden)
    • reset

      public boolean reset()
      Resets this window's position and visibility
      Specified by:
      reset in interface org.rusherhack.core.feature.IFeature
      Specified by:
      reset in interface org.rusherhack.core.feature.IFeatureConfigurable
      Returns:
      true if the feature was reset
    • getBindReference

      public String getBindReference()
      String representation of this bindable object
      Specified by:
      getBindReference in interface org.rusherhack.core.bind.IBindable
    • onKeybindEvent

      public void onKeybindEvent()
      Specified by:
      onKeybindEvent in interface org.rusherhack.core.bind.IBindable
    • onClose

      public void onClose()
    • isDragging

      public boolean isDragging()
      Specified by:
      isDragging in interface org.rusherhack.core.interfaces.IDraggable
    • setDragging

      public void setDragging(boolean dragging, double deltaX, double deltaY)
    • isFocused

      public boolean isFocused()
    • setFocused

      public void setFocused(boolean focused)
    • setIcon

      public void setIcon(IGraphic icon)
    • getIcon

      @Nullable public @Nullable IGraphic getIcon()
    • renderIcon

      public boolean renderIcon(double x, double y, double width, double height)
      Renders the icon of this window
      Returns:
      true if the icon was rendered, false otherwise
    • serialize

      public com.google.gson.JsonElement serialize()
      Specified by:
      serialize in interface org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
    • deserialize

      public boolean deserialize(com.google.gson.JsonElement obj)
      Specified by:
      deserialize in interface org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
    • getRenderer

      public IRenderer2D getRenderer()
    • getFontRenderer

      public IFontRenderer getFontRenderer()