Package com.avrix.ui.widgets
Class ModalWidget
java.lang.Object
com.avrix.ui.widgets.Widget
com.avrix.ui.widgets.ModalWidget
The
ModalWidget
class represents a modal window widget that can display
a content panel in the center of the screen.-
Field Summary
-
Constructor Summary
ConstructorDescriptionModalWidget
(int contentWidth, int contentHeight) Constructs a newModalWidget
with the specified content width and height.ModalWidget
(int contentWidth, int contentHeight, Widget contentPanel) Constructs a newModalWidget
with the specified content width, height, and content panel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the current modal windowGets the background color of the modal widget.Gets the content panel of the modal widget.void
render()
Renders theWidget
void
setBackgroundColor
(NanoColor backgroundColor) Sets the background color of the modal widget.void
setContentPanel
(Widget contentPanel) Sets a new content panel for the modal widget.void
show()
Open current modal windowvoid
update()
Updates theWidget
Methods inherited from class com.avrix.ui.widgets.Widget
addChild, addToScreen, bringToTop, drawArc, drawArc, drawCircle, drawEllipse, drawImage, drawLine, drawRect, drawRectOutline, drawRoundedRect, drawRoundedRectOutline, drawText, getAbsoluteParent, getChildren, getHeight, getMaxScrollX, getMaxScrollY, getParent, getScrollSpeed, getScrollX, getScrollY, getWidth, getX, getXA, getY, getYA, intersectScissor, isAlwaysOnTop, isHovered, isPointOver, isScrollable, isScrollLock, isVisible, isVisibleWithinParent, isVisibleWithinWindow, onInitialize, onKeyPress, onKeyRelease, onKeyRepeat, onLeftMouseDown, onLeftMouseDownOutside, onLeftMouseUp, onLeftMouseUpOutside, onMouseEnter, onMouseExit, onMouseMove, onMouseMoveOutside, onMouseWheel, onRightMouseDown, onRightMouseDownOutside, onRightMouseUp, onRightMouseUpOutside, postRender, preRender, removeChild, removeFromScreen, renderChildren, setAlwaysOnTop, setHeight, setMaxScrollX, setMaxScrollY, setScrollable, setScrollLock, setScrollSpeed, setScrollX, setScrollY, setVisible, setWidth, setX, setXA, setY, setYA
-
Constructor Details
-
ModalWidget
Constructs a newModalWidget
with the specified content width, height, and content panel.- Parameters:
contentWidth
- the width of the content panelcontentHeight
- the height of the content panelcontentPanel
- the content panel to be displayed inside the modal
-
ModalWidget
public ModalWidget(int contentWidth, int contentHeight) Constructs a newModalWidget
with the specified content width and height. A defaultScrollPanelWidget
is created as the content panel.- Parameters:
contentWidth
- the width of the content panelcontentHeight
- the height of the content panel
-
-
Method Details
-
getBackgroundColor
Gets the background color of the modal widget.- Returns:
- the background color
-
setBackgroundColor
Sets the background color of the modal widget.- Parameters:
backgroundColor
- the new background color
-
getContentPanel
Gets the content panel of the modal widget.- Returns:
- the content panel
-
setContentPanel
Sets a new content panel for the modal widget. The previous content panel is removed and replaced with the new one.- Parameters:
contentPanel
- the new content panel
-
show
public void show()Open current modal window -
close
public void close()Closes the current modal window -
update
public void update()Updates theWidget
-
render
public void render()Renders theWidget
-