Browse Source

REPORT-51958 远程环境检测及同步

feature/10.0
pengda 3 years ago
parent
commit
6be9984128
  1. 13
      designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java
  2. 14
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java
  3. 4
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java

13
designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java

@ -21,8 +21,17 @@ public class NotificationCenter {
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}
public List<Notification> getNotifications(){
return notifications;
public int getNotificationsCount(){
return notifications.size();
}
public void removeNotification(int index){
notifications.remove(index);
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}
public Notification getNotification(int index){
return notifications.get(index);
}
public void clearAllNotifications(){

14
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java

@ -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();

4
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java

@ -21,7 +21,7 @@ public class NotificationCenterPane extends BasicPane {
setLayout(new BorderLayout());
notificationCenterButton = new UIButton();
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenter.png"));
notificationCenterButton.setToolTipText(Toolkit.i18nText("显示当前通知"));
notificationCenterButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Show_Notification"));
notificationCenterButton.set4ToolbarButton();
notificationCenterButton.setRolloverEnabled(false);
this.add(notificationCenterButton);
@ -40,7 +40,7 @@ public class NotificationCenterPane extends BasicPane {
}
public void refreshButton() {
if (NotificationCenter.getInstance().getNotifications().size() > 0) {
if (NotificationCenter.getInstance().getNotificationsCount() > 0) {
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/normal.png"));
} else {
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenter.png"));

Loading…
Cancel
Save