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
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.rusherhack.client.api.ui.ElementHandlerBase
positionsInitialized
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
charTyped
(char character) protected boolean
consumeElementMouseClick
(Window window, double mouseX, double mouseY, int button) protected boolean
consumeElementMouseRelease
(Window window, double mouseX, double mouseY, int button) protected boolean
consumeMouseClick
(double mouseX, double mouseY, int button) protected void
consumeMouseMove
(double mouseX, double mouseY) abstract WindowContentHandlerBase
Returns the content handler of this window handler.abstract int
Returns the frame padding of a side of a window.abstract WindowViewHandlerBase
Returns the view handler of this window handler.getWindowColor
(Window window) Returns the primary color of a window.void
Initialize all of the elementsboolean
isElementHovered
(Window window, double mouseX, double mouseY) Checks if a window is hovered.boolean
keyTyped
(int key, int scanCode, int modifiers) void
moveElementToTop
(Window element) Moves the element to the topvoid
renderElements
(RenderContext context, double mouseX, double mouseY) void
renderWindow
(Window window, RenderContext context, double mouseX, double mouseY) abstract void
renderWindowFrame
(Window window, double mouseX, double mouseY) Renders the frame of a window.void
Sets the default positions of the elementsMethods inherited from class org.rusherhack.client.api.ui.ElementHandlerBase
consumeElementCharTyped, consumeElementKeyTyped, consumeElementMouseMove, consumeElementMouseScroll, consumeMouseRelease, consumeMouseScroll, deserialize, getElement, getScale, isEnabled, isHovered, mouseClicked, mouseMoved, mouseReleased, mouseScrolled, render, serialize, shouldSerialize, tick
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.IDraggable
isDragging
Methods inherited from interface org.rusherhack.client.api.render.IRenderable2D
getFontRenderer, getRenderer, render
Methods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave
-
Constructor Details
-
WindowHandlerBase
public WindowHandlerBase()
-
-
Method Details
-
getViewHandler
Returns the view handler of this window handler.- Returns:
- the view handler of this window handler
-
getContentHandler
Returns the content handler of this window handler.- Returns:
- the content handler of this window handler
-
renderWindowFrame
Renders the frame of a window.- Parameters:
window
- the windowmouseX
- the x-coordinate of the mousemouseY
- the y-coordinate of the mouse
-
getFramePadding
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
Description copied from class:ElementHandlerBase
Moves the element to the top- Specified by:
moveElementToTop
in classElementHandlerBase<Window>
- Parameters:
element
- element to move to the top
-
getElements
- Specified by:
getElements
in classElementHandlerBase<Window>
- Returns:
- elements to be handled by this handler
-
renderElements
- Overrides:
renderElements
in classElementHandlerBase<Window>
-
renderWindow
-
consumeMouseClick
protected boolean consumeMouseClick(double mouseX, double mouseY, int button) - Overrides:
consumeMouseClick
in classElementHandlerBase<Window>
-
consumeElementMouseClick
- Overrides:
consumeElementMouseClick
in classElementHandlerBase<Window>
-
consumeElementMouseRelease
protected boolean consumeElementMouseRelease(Window window, double mouseX, double mouseY, int button) - Overrides:
consumeElementMouseRelease
in classElementHandlerBase<Window>
-
consumeMouseMove
protected void consumeMouseMove(double mouseX, double mouseY) - Overrides:
consumeMouseMove
in classElementHandlerBase<Window>
-
charTyped
public boolean charTyped(char character) - Specified by:
charTyped
in interfaceorg.rusherhack.core.interfaces.ITypeable
- Overrides:
charTyped
in classElementHandlerBase<Window>
-
keyTyped
public boolean keyTyped(int key, int scanCode, int modifiers) - Specified by:
keyTyped
in interfaceorg.rusherhack.core.interfaces.ITypeable
- Overrides:
keyTyped
in classElementHandlerBase<Window>
-
isElementHovered
Checks if a window is hovered. Can be overridden to change the hover behavior.- Overrides:
isElementHovered
in classElementHandlerBase<Window>
- Parameters:
window
- the windowmouseX
- the x-coordinate of the mousemouseY
- the y-coordinate of the mouse- Returns:
- true if the window is hovered
-
getWindowColor
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 classElementHandlerBase<Window>
-
setDefaultPositions
public void setDefaultPositions()Description copied from class:ElementHandlerBase
Sets the default positions of the elements- Specified by:
setDefaultPositions
in classElementHandlerBase<Window>
-