|
|
|
@ -42,7 +42,7 @@ public class NotificationCenterDialog extends JDialog {
|
|
|
|
|
public void initComponents() { |
|
|
|
|
centerPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); |
|
|
|
|
addNotification(); |
|
|
|
|
deleteLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotifications().size() + ")"); |
|
|
|
|
deleteLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); |
|
|
|
|
deleteLabel.setForeground(Color.BLUE); |
|
|
|
|
|
|
|
|
|
deleteLabel.addMouseListener(new MouseAdapter() { |
|
|
|
@ -52,7 +52,7 @@ public class NotificationCenterDialog extends JDialog {
|
|
|
|
|
centerPanel.removeAll(); |
|
|
|
|
addNotification(); |
|
|
|
|
pack(); |
|
|
|
|
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotifications().size() + ")"); |
|
|
|
|
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); |
|
|
|
|
if (notificationNeedShow.size() == 0) { |
|
|
|
|
hideDialog(); |
|
|
|
|
} |
|
|
|
@ -73,12 +73,12 @@ public class NotificationCenterDialog extends JDialog {
|
|
|
|
|
|
|
|
|
|
private void addNotification() { |
|
|
|
|
notificationNeedShow.clear(); |
|
|
|
|
List<Notification> notifications = NotificationCenter.getInstance().getNotifications(); |
|
|
|
|
int size = notifications.size(); |
|
|
|
|
|
|
|
|
|
int size = NotificationCenter.getInstance().getNotificationsCount(); |
|
|
|
|
for (int i = NOTIFICATIONCOUNT; i > 0; i--) { |
|
|
|
|
int j = size - i; |
|
|
|
|
if (j >= 0) { |
|
|
|
|
Notification notification = notifications.get(j); |
|
|
|
|
Notification notification = NotificationCenter.getInstance().getNotification(j); |
|
|
|
|
NotificationPane notificationPane = new NotificationPane(notification.getType(), notification.getMessage(), i, notification.getNotificationDialogAction()); |
|
|
|
|
notificationNeedShow.add(notificationPane); |
|
|
|
|
} |
|
|
|
@ -141,10 +141,10 @@ public class NotificationCenterDialog extends JDialog {
|
|
|
|
|
deleteIconPane.addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
NotificationCenter.getInstance().getNotifications().remove(NotificationCenter.getInstance().getNotifications().size() - index); |
|
|
|
|
NotificationCenter.getInstance().removeNotification(NotificationCenter.getInstance().getNotificationsCount() - index); |
|
|
|
|
centerPanel.removeAll(); |
|
|
|
|
addNotification(); |
|
|
|
|
deleteLabel.setText("清除所有消息" + "(" + NotificationCenter.getInstance().getNotifications().size() + ")"); |
|
|
|
|
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); |
|
|
|
|
pack(); |
|
|
|
|
if (notificationNeedShow.size() == 0) { |
|
|
|
|
centerWindow(); |
|
|
|
|