Package org.fenrir.yggdrasil.ui.widget

Examples of org.fenrir.yggdrasil.ui.widget.TrayNotificationWidget


   
    private void addNotification(TrayPopupEntry entry, boolean showNotification)
    {       
        trayPopup.addEntry(entry);       
        // Icona al tray
        TrayNotificationWidget trayLabel;       
        if(trayZoneElements.containsKey(entry.getNotificationId())){
            trayLabel = trayZoneElements.get(entry.getNotificationId());
        }
        else{
            trayLabel = new TrayNotificationWidget(entry.getIcon());
            trayZone.add(trayLabel.getWidget());
            trayZoneElements.put(entry.getNotificationId(), trayLabel);
            trayLabel.addMouseListener(new MouseInputAdapter()
            {
                @Override
                public void mouseClicked(MouseEvent event)
                {
                    showMessagesPopup();                               
                }           
            });
       
        trayLabel.incrementNotificationCount();       
        trayZone.revalidate();             
        // Necessari per reflectir els canvis del contador
        trayZone.repaint();
        // Si la finestra principal de l'aplicació es visible es motrarà la notificació
        if(showNotification){
View Full Code Here


        trayZoneElements.clear();
    }
   
    public void discardNotification(TrayPopupEntry notificacionEntry)
    {       
        TrayNotificationWidget widget = trayZoneElements.get(notificacionEntry.getNotificationId());
        widget.decrementNotificationCount();
        // Només es treu la notificació del tray quan el contador del mateix tipus sigui <= 0
        if(widget.getNotificationCount()<=0){
            JComponent label = trayZoneElements.remove(notificacionEntry.getNotificationId()).getWidget();
            trayZone.remove(label);           
        }
        // Es repinta la zona per mostrar el canvi
        trayZone.revalidate();
View Full Code Here

TOP

Related Classes of org.fenrir.yggdrasil.ui.widget.TrayNotificationWidget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.