Package org.openstreetmap.josm.gui
Class NotificationManager
- java.lang.Object
-
- org.openstreetmap.josm.gui.NotificationManager
-
class NotificationManager extends java.lang.Object
ManagesNotification
s, i.e. displays them on screen. Don't use this class directly, but useNotification.show()
. If multiple messages are sent in a short period of time, they are put in a queue and displayed one 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
NotificationManager.FreezeMouseListener
private static class
NotificationManager.NotificationPanel
private class
NotificationManager.PauseFinishedEvent
static class
NotificationManager.RoundedPanel
A panel with rounded edges and line border.private class
NotificationManager.UnfreezeEvent
-
Field Summary
Fields Modifier and Type Field Description private Notification
currentNotification
private NotificationManager.NotificationPanel
currentNotificationPanel
private long
displayTimeStart
private long
elapsedTime
private javax.swing.Timer
hideTimer
private static NotificationManager
instance
private static java.awt.Color
PANEL_OPAQUE
private static java.awt.Color
PANEL_SEMITRANSPARENT
private static IntegerProperty
pauseTime
private javax.swing.Timer
pauseTimer
private java.util.Deque<Notification>
queue
private boolean
running
private javax.swing.Timer
unfreezeDelayTimer
-
Constructor Summary
Constructors Constructor Description NotificationManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NotificationManager
getInstance()
private void
processQueue()
(package private) void
replaceExistingNotification(Notification oldNotification, Notification newNotification)
Show the given notification by replacing the given queued/displaying notification(package private) void
showNotification(Notification note)
Show the given notification (unless a duplicate notification is being shown at the moment or at the end of the queue)private void
startHideTimer()
private void
stopHideTimer()
-
-
-
Field Detail
-
hideTimer
private final javax.swing.Timer hideTimer
-
pauseTimer
private final javax.swing.Timer pauseTimer
-
unfreezeDelayTimer
private final javax.swing.Timer unfreezeDelayTimer
-
running
private boolean running
-
currentNotification
private Notification currentNotification
-
currentNotificationPanel
private NotificationManager.NotificationPanel currentNotificationPanel
-
queue
private final java.util.Deque<Notification> queue
-
pauseTime
private static final IntegerProperty pauseTime
-
displayTimeStart
private long displayTimeStart
-
elapsedTime
private long elapsedTime
-
instance
private static NotificationManager instance
-
PANEL_SEMITRANSPARENT
private static final java.awt.Color PANEL_SEMITRANSPARENT
-
PANEL_OPAQUE
private static final java.awt.Color PANEL_OPAQUE
-
-
Constructor Detail
-
NotificationManager
NotificationManager()
-
-
Method Detail
-
showNotification
void showNotification(Notification note)
Show the given notification (unless a duplicate notification is being shown at the moment or at the end of the queue)- Parameters:
note
- The note to show.- See Also:
Notification.show()
-
replaceExistingNotification
void replaceExistingNotification(Notification oldNotification, Notification newNotification)
Show the given notification by replacing the given queued/displaying notification- Parameters:
oldNotification
- the notification to replacenewNotification
- the notification to show
-
processQueue
private void processQueue()
-
startHideTimer
private void startHideTimer()
-
stopHideTimer
private void stopHideTimer()
-
getInstance
public static NotificationManager getInstance()
-
-