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
ConstructorsConstructorDescriptionModalWidget(int contentWidth, int contentHeight) Constructs a newModalWidgetwith the specified content width and height.ModalWidget(int contentWidth, int contentHeight, Widget contentPanel) Constructs a newModalWidgetwith the specified content width, height, and content panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the current modal windowGets the background color of the modal widget.Gets the content panel of the modal widget.voidrender()Renders theWidgetvoidsetBackgroundColor(NanoColor backgroundColor) Sets the background color of the modal widget.voidsetContentPanel(Widget contentPanel) Sets a new content panel for the modal widget.voidshow()Open current modal windowvoidupdate()Updates theWidgetMethods 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 newModalWidgetwith 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 newModalWidgetwith the specified content width and height. A defaultScrollPanelWidgetis 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
-