Package com.avrix.ui.notify
Class Notify
java.lang.Object
com.avrix.ui.notify.Notify
The
Notify class is responsible for managing and rendering notifications.
It maintains a queue of notifications and provides methods to display various types of notifications.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisplays a critical notification with a specified lifetime.static voidDisplays an error notification with a specified lifetime.static voidDisplays a hint notification with a specified lifetime.static voidDisplays an informational notification with a specified lifetime.static voidnotify(Notification notification) Adds aNotificationto the queue.static voidrender()Renders the notifications on the screen.static voidsetBorderOffsetBottom(int borderOffsetBottom) Sets the offset from the bottom edge of the window where notifications are displayed.static voidsetBorderOffsetRight(int borderOffsetRight) Sets the offset from the right edge of the window where notifications are displayed.static voidsetMaxVisibleNotification(int maxVisibleNotification) Sets the maximum number of notifications that can be visible at once.static voidsetNotificationMargin(int notificationMargin) Sets the margin between notifications.static voidDisplays a success notification with a specified lifetime.static voidDisplays a warning notification with a specified lifetime.
-
Constructor Details
-
Notify
public Notify()
-
-
Method Details
-
notify
Adds aNotificationto the queue.- Parameters:
notification- The notification to be added.
-
info
Displays an informational notification with a specified lifetime.- Parameters:
text- The notification text.lifeTime- The lifetime of the notification in seconds.
-
success
Displays a success notification with a specified lifetime.- Parameters:
text- The notification text.lifeTime- The lifetime of the notification in seconds.
-
warn
Displays a warning notification with a specified lifetime.- Parameters:
text- The notification text.lifeTime- The lifetime of the notification in seconds.
-
error
Displays an error notification with a specified lifetime.- Parameters:
text- The notification text.lifeTime- The lifetime of the notification in seconds.
-
critical
Displays a critical notification with a specified lifetime.- Parameters:
text- The notification text.lifeTime- The lifetime of the notification in seconds.
-
hint
Displays a hint notification with a specified lifetime.- Parameters:
text- The notification text.lifeTime- The lifetime of the notification in seconds.
-
setBorderOffsetRight
public static void setBorderOffsetRight(int borderOffsetRight) Sets the offset from the right edge of the window where notifications are displayed.- Parameters:
borderOffsetRight- The new offset from the right edge of the window.
-
setBorderOffsetBottom
public static void setBorderOffsetBottom(int borderOffsetBottom) Sets the offset from the bottom edge of the window where notifications are displayed.- Parameters:
borderOffsetBottom- The new offset from the bottom edge of the window.
-
setMaxVisibleNotification
public static void setMaxVisibleNotification(int maxVisibleNotification) Sets the maximum number of notifications that can be visible at once.- Parameters:
maxVisibleNotification- The new maximum number of visible notifications.
-
setNotificationMargin
public static void setNotificationMargin(int notificationMargin) Sets the margin between notifications.- Parameters:
notificationMargin- The new margin between notifications.
-
render
public static void render()Renders the notifications on the screen. Only the maximum number of visible notifications are shown. Notifications are rendered from the bottom of the screen upwards.
-