com.alee.managers.notification
Class NotificationManager

java.lang.Object
  extended by com.alee.managers.notification.NotificationManager
All Implemented Interfaces:
javax.swing.SwingConstants

public final class NotificationManager
extends java.lang.Object
implements javax.swing.SwingConstants

This manager allows you to display custom notification popups within the application. You can also add custom actions, set their duration, modify popup styling and use some other advanced features.

Author:
Mikle Garin
See Also:
WebNotificationPopup, DisplayType

Field Summary
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
NotificationManager()
           
 
Method Summary
static int getCascadeAmount()
          Returns amount of cascaded in a row popups.
static DisplayType getDisplayType()
          Retyrns notification display type.
static int getGap()
          Returns gap between notifications.
static int getLocation()
          Returns notifications display location.
static java.awt.Insets getMargin()
          Returns notifications side margin.
static void hideAllNotifications()
          Hides all visible notifications.
static boolean isCascade()
          Returns whether popups should be cascaded or not.
static void setCascade(boolean cascade)
          Sets whether popups should be cascaded or not.
static void setCascadeAmount(int cascadeAmount)
          Sets amount of cascaded in a row popups.
static void setDisplayType(DisplayType displayType)
          Sets notification display type.
static void setGap(int gap)
          Sets gap between notifications.
static void setLocation(int location)
          Sets notifications display location.
static void setMargin(java.awt.Insets margin)
          Sets notifications side margin.
static void setMargin(int margin)
          Sets notifications side margin.
static void setMargin(int top, int left, int bottom, int right)
          Sets notifications side margin.
static WebNotificationPopup showNotification(java.awt.Component content)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.awt.Component content)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.awt.Component content, javax.swing.Icon icon)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.awt.Component content, javax.swing.Icon icon, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.awt.Component content, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component content, javax.swing.Icon icon)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component content, javax.swing.Icon icon, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component content, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.lang.String content)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.lang.String content, javax.swing.Icon icon)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.lang.String content, javax.swing.Icon icon, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, java.lang.String content, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.awt.Component showFor, WebNotificationPopup notification)
          Displays notification on popup layer.
static WebNotificationPopup showNotification(java.lang.String content)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.lang.String content, javax.swing.Icon icon)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.lang.String content, javax.swing.Icon icon, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(java.lang.String content, NotificationOption... options)
          Returns displayed notification.
static WebNotificationPopup showNotification(WebNotificationPopup notification)
          Displays notification on popup layer.
static void updateNotificationLayouts()
          Optimized layout updates for all visible notifications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationManager

public NotificationManager()
Method Detail

getLocation

public static int getLocation()
Returns notifications display location.

Returns:
notifications display location

setLocation

public static void setLocation(int location)
Sets notifications display location.

Parameters:
location - new notifications display location

getDisplayType

public static DisplayType getDisplayType()
Retyrns notification display type.

Returns:
notification display type

setDisplayType

public static void setDisplayType(DisplayType displayType)
Sets notification display type.

Parameters:
displayType - new notification display type

getMargin

public static java.awt.Insets getMargin()
Returns notifications side margin.

Returns:
notifications side margin

setMargin

public static void setMargin(int margin)
Sets notifications side margin.

Parameters:
margin - margin

setMargin

public static void setMargin(int top,
                             int left,
                             int bottom,
                             int right)
Sets notifications side margin.

Parameters:
top - top margin
left - left margin
bottom - bottom margin
right - right margin

setMargin

public static void setMargin(java.awt.Insets margin)
Sets notifications side margin.

Parameters:
margin - new notifications side margin

getGap

public static int getGap()
Returns gap between notifications.

Returns:
gap between notifications

setGap

public static void setGap(int gap)
Sets gap between notifications.

Parameters:
gap - new gap between notifications

isCascade

public static boolean isCascade()
Returns whether popups should be cascaded or not.

Returns:
whether popups should be cascaded or not

setCascade

public static void setCascade(boolean cascade)
Sets whether popups should be cascaded or not.

Parameters:
cascade - whether popups should be cascaded or not

getCascadeAmount

public static int getCascadeAmount()
Returns amount of cascaded in a row popups.

Returns:
amount of cascaded in a row popups

setCascadeAmount

public static void setCascadeAmount(int cascadeAmount)
Sets amount of cascaded in a row popups.

Parameters:
cascadeAmount - new amount of cascaded in a row popups

updateNotificationLayouts

public static void updateNotificationLayouts()
Optimized layout updates for all visible notifications.


hideAllNotifications

public static void hideAllNotifications()
Hides all visible notifications.


showNotification

public static WebNotificationPopup showNotification(java.lang.String content)
Returns displayed notification.

Parameters:
content - notification text content
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.lang.String content,
                                                    javax.swing.Icon icon)
Returns displayed notification.

Parameters:
content - notification text content
icon - notification icon
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.lang.String content)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification text content
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.lang.String content,
                                                    javax.swing.Icon icon)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification text content
icon - notification icon
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component content)
Returns displayed notification.

Parameters:
content - notification content
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component content,
                                                    javax.swing.Icon icon)
Returns displayed notification.

Parameters:
content - notification content
icon - notification icon
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.awt.Component content)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification content
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.awt.Component content,
                                                    javax.swing.Icon icon)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification content
icon - notification icon
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.lang.String content,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
content - notification text content
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.lang.String content,
                                                    javax.swing.Icon icon,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
content - notification text content
icon - notification icon
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.lang.String content,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification text content
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.lang.String content,
                                                    javax.swing.Icon icon,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification text content
icon - notification icon
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component content,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
content - notification content
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component content,
                                                    javax.swing.Icon icon,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
content - notification content
icon - notification icon
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.awt.Component content,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification content
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    java.awt.Component content,
                                                    javax.swing.Icon icon,
                                                    NotificationOption... options)
Returns displayed notification.

Parameters:
showFor - component used to determine window where notification should be displayed
content - notification content
icon - notification icon
options - notification selectable options
Returns:
displayed notification

showNotification

public static WebNotificationPopup showNotification(WebNotificationPopup notification)
Displays notification on popup layer.

Parameters:
notification - notification to display

showNotification

public static WebNotificationPopup showNotification(java.awt.Component showFor,
                                                    WebNotificationPopup notification)
Displays notification on popup layer.

Parameters:
showFor - component used to determine window where notification should be displayed
notification - notification to display