Class WindowHandlerBase

java.lang.Object
org.rusherhack.client.api.ui.ElementHandlerBase<Window>
org.rusherhack.client.api.ui.window.WindowHandlerBase
All Implemented Interfaces:
Globals, IRenderable2D, org.rusherhack.core.interfaces.IClickable, org.rusherhack.core.interfaces.IDraggable, org.rusherhack.core.interfaces.IHoverable, 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

public abstract class WindowHandlerBase extends ElementHandlerBase<Window>
  • Constructor Details

    • WindowHandlerBase

      public WindowHandlerBase()
  • Method Details

    • getViewHandler

      public abstract WindowViewHandlerBase getViewHandler()
      Returns the view handler of this window handler.
      Returns:
      the view handler of this window handler
    • getContentHandler

      public abstract WindowContentHandlerBase getContentHandler()
      Returns the content handler of this window handler.
      Returns:
      the content handler of this window handler
    • renderWindowFrame

      public abstract void renderWindowFrame(Window window, double mouseX, double mouseY)
      Renders the frame of a window.
      Parameters:
      window - the window
      mouseX - the x-coordinate of the mouse
      mouseY - the y-coordinate of the mouse
    • getFramePadding

      public abstract int getFramePadding(WindowHandlerBase.WindowSide side)
      Returns the frame padding of a side of a window.
      Parameters:
      side - the side of the window
      Returns:
      the frame padding of the side
    • moveElementToTop

      public void moveElementToTop(Window element)
      Description copied from class: ElementHandlerBase
      Moves the element to the top
      Specified by:
      moveElementToTop in class ElementHandlerBase<Window>
      Parameters:
      element - element to move to the top
    • getElements

      public List<Window> getElements()
      Specified by:
      getElements in class ElementHandlerBase<Window>
      Returns:
      elements to be handled by this handler
    • renderElements

      public void renderElements(RenderContext context, double mouseX, double mouseY)
      Overrides:
      renderElements in class ElementHandlerBase<Window>
    • renderWindow

      public void renderWindow(Window window, RenderContext context, double mouseX, double mouseY)
    • consumeMouseClick

      protected boolean consumeMouseClick(double mouseX, double mouseY, int button)
      Overrides:
      consumeMouseClick in class ElementHandlerBase<Window>
    • consumeElementMouseClick

      protected boolean consumeElementMouseClick(Window window, double mouseX, double mouseY, int button)
      Overrides:
      consumeElementMouseClick in class ElementHandlerBase<Window>
    • consumeElementMouseRelease

      protected boolean consumeElementMouseRelease(Window window, double mouseX, double mouseY, int button)
      Overrides:
      consumeElementMouseRelease in class ElementHandlerBase<Window>
    • consumeMouseMove

      protected void consumeMouseMove(double mouseX, double mouseY)
      Overrides:
      consumeMouseMove in class ElementHandlerBase<Window>
    • charTyped

      public boolean charTyped(char character)
      Specified by:
      charTyped in interface org.rusherhack.core.interfaces.ITypeable
      Overrides:
      charTyped in class ElementHandlerBase<Window>
    • keyTyped

      public boolean keyTyped(int key, int scanCode, int modifiers)
      Specified by:
      keyTyped in interface org.rusherhack.core.interfaces.ITypeable
      Overrides:
      keyTyped in class ElementHandlerBase<Window>
    • isElementHovered

      public boolean isElementHovered(Window window, double mouseX, double mouseY)
      Checks if a window is hovered. Can be overridden to change the hover behavior.
      Overrides:
      isElementHovered in class ElementHandlerBase<Window>
      Parameters:
      window - the window
      mouseX - the x-coordinate of the mouse
      mouseY - the y-coordinate of the mouse
      Returns:
      true if the window is hovered
    • getWindowColor

      public Color getWindowColor(Window window)
      Returns the primary color of a window.
      Parameters:
      window - the window
      Returns:
      the color of the window
    • initialize

      public void initialize()
      Description copied from class: ElementHandlerBase
      Initialize all of the elements
      Specified by:
      initialize in class ElementHandlerBase<Window>
    • setDefaultPositions

      public void setDefaultPositions()
      Description copied from class: ElementHandlerBase
      Sets the default positions of the elements
      Specified by:
      setDefaultPositions in class ElementHandlerBase<Window>