Package com.avrix.ui
Class WidgetManager
java.lang.Object
com.avrix.ui.WidgetManager
Manages a collection of
Widget
instances, handling rendering and updates.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds a widget to the list ofWidget
s to be managed and displayed.static void
bringWidgetToTop
(Widget widget) static NanoContext
Getting the NanoVG rendering contextGetting a list ofWidget
s registered in the managerstatic void
init()
Initializing theWidgetManager
(creating NanoVG contexts)static boolean
Returns the current keyboard input blocking state.static boolean
Checks if the mouse pointer is over a custom UI element.static void
onRender()
Renders allWidget
s and processes input events.static void
removeWidget
(Widget widget) static void
setBlockInputKeyboard
(boolean block) Sets the keyboard input blocking state.
-
Constructor Details
-
WidgetManager
public WidgetManager()
-
-
Method Details
-
init
public static void init()Initializing theWidgetManager
(creating NanoVG contexts) -
onRender
public static void onRender() -
isBlockInputKeyboard
public static boolean isBlockInputKeyboard()Returns the current keyboard input blocking state.- Returns:
true
if keyboard input is disabled, otherwisefalse
.
-
setBlockInputKeyboard
public static void setBlockInputKeyboard(boolean block) Sets the keyboard input blocking state.- Parameters:
block
-true
to block keyboard input,false
to unlock.
-
getContext
Getting the NanoVG rendering context- Returns:
- NanoVG context, if it does not exist (not initialized) returns
null
-
getWidgetList
Getting a list ofWidget
s registered in the manager- Returns:
- list of
Widget
s
-
isOverCustomUI
public static boolean isOverCustomUI()Checks if the mouse pointer is over a custom UI element.- Returns:
- true if the mouse pointer is over a custom UI element, false otherwise.
-
bringWidgetToTop
Moves the specifiedWidget
to the front of the rendering order, ensuring it is drawn above otherWidget
s.- Parameters:
widget
- theWidget
to bring to the front
-
addWidget
Adds a widget to the list ofWidget
s to be managed and displayed. TheWidget
is added only if it is not already present in the list.- Parameters:
widget
- theWidget
to be added
-
removeWidget
- Parameters:
widget
- theWidget
to be removed
-