class NotificationManager extends Object
Notification
s, i.e. displays them on screen.
Don't use this class directly, but use Notification.show()
.
If multiple messages are sent in a short period of time, they are put in
a queue and displayed on after the other.
The user can stop the timer (freeze the message) by moving the mouse cursor
above the panel. As a visual cue, the background color changes from
semi-transparent to opaque while the timer is frozen.Modifier and Type | Class and Description |
---|---|
private class |
NotificationManager.HideEvent |
private class |
NotificationManager.NotificationPanel |
private class |
NotificationManager.PauseFinishedEvent |
static class |
NotificationManager.RoundedPanel
A panel with rounded edges and line border.
|
private class |
NotificationManager.UnfreezeEvent |
Modifier and Type | Field and Description |
---|---|
private Notification |
currentNotification |
private NotificationManager.NotificationPanel |
currentNotificationPanel |
(package private) static int |
defaultNotificationTime |
private long |
displayTimeStart |
private long |
elapsedTime |
private Timer |
hideTimer |
private static NotificationManager |
INSTANCE |
private Color |
PANEL_OPAQUE |
private Color |
PANEL_SEMITRANSPARENT |
private static int |
pauseTime |
private Timer |
pauseTimer |
private Queue<Notification> |
queue |
private boolean |
running |
private Timer |
unfreezeDelayTimer |
Constructor and Description |
---|
NotificationManager() |
Modifier and Type | Method and Description |
---|---|
static NotificationManager |
getInstance() |
private void |
processQueue() |
void |
showNotification(Notification note) |
private void |
startHideTimer() |
private Timer pauseTimer
private Timer unfreezeDelayTimer
private boolean running
private Notification currentNotification
private NotificationManager.NotificationPanel currentNotificationPanel
private final Queue<Notification> queue
private static int pauseTime
static int defaultNotificationTime
private long displayTimeStart
private long elapsedTime
private static NotificationManager INSTANCE
private final Color PANEL_SEMITRANSPARENT
private final Color PANEL_OPAQUE
public NotificationManager()
public static NotificationManager getInstance()
public void showNotification(Notification note)
private void processQueue()
private void startHideTimer()