Package org.openstreetmap.josm.gui
Class NotificationManager
- java.lang.Object
-
- org.openstreetmap.josm.gui.NotificationManager
-
class NotificationManager extends java.lang.Object
ManagesNotifications, 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) classNotificationManager.FreezeMouseListenerprivate static classNotificationManager.NotificationPanelprivate classNotificationManager.PauseFinishedEventstatic classNotificationManager.RoundedPanelA panel with rounded edges and line border.private classNotificationManager.UnfreezeEvent
-
Field Summary
Fields Modifier and Type Field Description private NotificationcurrentNotificationprivate NotificationManager.NotificationPanelcurrentNotificationPanelprivate longdisplayTimeStartprivate longelapsedTimeprivate javax.swing.TimerhideTimerprivate static NotificationManagerinstanceprivate static java.awt.ColorPANEL_OPAQUEprivate static java.awt.ColorPANEL_SEMITRANSPARENTprivate static IntegerPropertypauseTimeprivate javax.swing.TimerpauseTimerprivate java.util.Deque<Notification>queueprivate booleanrunningprivate javax.swing.TimerunfreezeDelayTimer
-
Constructor Summary
Constructors Constructor Description NotificationManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NotificationManagergetInstance()private voidprocessQueue()(package private) voidreplaceExistingNotification(Notification oldNotification, Notification newNotification)Show the given notification by replacing the given queued/displaying notification(package private) voidshowNotification(Notification note)Show the given notification (unless a duplicate notification is being shown at the moment or at the end of the queue)private voidstartHideTimer()private voidstopHideTimer()
-
-
-
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()
-
-