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
Nested Classes -
Field Summary
Fields inherited from class org.rusherhack.client.api.ui.ElementHandlerBase
positionsInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(char character) protected booleanconsumeElementMouseClick(Window window, double mouseX, double mouseY, int button) protected booleanconsumeElementMouseRelease(Window window, double mouseX, double mouseY, int button) protected booleanconsumeMouseClick(double mouseX, double mouseY, int button) protected voidconsumeMouseMove(double mouseX, double mouseY) abstract WindowContentHandlerBaseReturns the content handler of this window handler.abstract intReturns the frame padding of a side of a window.abstract WindowViewHandlerBaseReturns the view handler of this window handler.getWindowColor(Window window) Returns the primary color of a window.voidInitialize all of the elementsbooleanisElementHovered(Window window, double mouseX, double mouseY) Checks if a window is hovered.booleankeyTyped(int key, int scanCode, int modifiers) voidmoveElementToTop(Window element) Moves the element to the topvoidrenderElements(RenderContext context, double mouseX, double mouseY) voidrenderWindow(Window window, RenderContext context, double mouseX, double mouseY) abstract voidrenderWindowFrame(Window window, double mouseX, double mouseY) Renders the frame of a window.voidSets 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, tickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rusherhack.core.interfaces.IDraggable
isDraggingMethods inherited from interface org.rusherhack.client.api.render.IRenderable2D
getFontRenderer, getRenderer, renderMethods 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:ElementHandlerBaseMoves the element to the top- Specified by:
moveElementToTopin classElementHandlerBase<Window>- Parameters:
element- element to move to the top
-
getElements
- Specified by:
getElementsin classElementHandlerBase<Window>- Returns:
- elements to be handled by this handler
-
renderElements
- Overrides:
renderElementsin classElementHandlerBase<Window>
-
renderWindow
-
consumeMouseClick
protected boolean consumeMouseClick(double mouseX, double mouseY, int button) - Overrides:
consumeMouseClickin classElementHandlerBase<Window>
-
consumeElementMouseClick
- Overrides:
consumeElementMouseClickin classElementHandlerBase<Window>
-
consumeElementMouseRelease
protected boolean consumeElementMouseRelease(Window window, double mouseX, double mouseY, int button) - Overrides:
consumeElementMouseReleasein classElementHandlerBase<Window>
-
consumeMouseMove
protected void consumeMouseMove(double mouseX, double mouseY) - Overrides:
consumeMouseMovein classElementHandlerBase<Window>
-
charTyped
public boolean charTyped(char character) - Specified by:
charTypedin interfaceorg.rusherhack.core.interfaces.ITypeable- Overrides:
charTypedin classElementHandlerBase<Window>
-
keyTyped
public boolean keyTyped(int key, int scanCode, int modifiers) - Specified by:
keyTypedin interfaceorg.rusherhack.core.interfaces.ITypeable- Overrides:
keyTypedin classElementHandlerBase<Window>
-
isElementHovered
Checks if a window is hovered. Can be overridden to change the hover behavior.- Overrides:
isElementHoveredin 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:ElementHandlerBaseInitialize all of the elements- Specified by:
initializein classElementHandlerBase<Window>
-
setDefaultPositions
public void setDefaultPositions()Description copied from class:ElementHandlerBaseSets the default positions of the elements- Specified by:
setDefaultPositionsin classElementHandlerBase<Window>
-