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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Displays a critical notification with a specified lifetime.static void
Displays an error notification with a specified lifetime.static void
Displays a hint notification with a specified lifetime.static void
Displays an informational notification with a specified lifetime.static void
notify
(Notification notification) Adds aNotification
to the queue.static void
render()
Renders the notifications on the screen.static void
setBorderOffsetBottom
(int borderOffsetBottom) Sets the offset from the bottom edge of the window where notifications are displayed.static void
setBorderOffsetRight
(int borderOffsetRight) Sets the offset from the right edge of the window where notifications are displayed.static void
setMaxVisibleNotification
(int maxVisibleNotification) Sets the maximum number of notifications that can be visible at once.static void
setNotificationMargin
(int notificationMargin) Sets the margin between notifications.static void
Displays a success notification with a specified lifetime.static void
Displays a warning notification with a specified lifetime.
-
Constructor Details
-
Notify
public Notify()
-
-
Method Details
-
notify
Adds aNotification
to 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.
-