From 505756d314205e13726e9b993bc803efa31a629b Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 10 Jun 2021 16:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=9D=A2=E6=9D=BF=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/bbs/UserInfoLabel.java | 18 ++++++------------ .../fr/design/mainframe/bbs/UserInfoPane.java | 11 +++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index c9e83d5b6d..29180c09db 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -17,13 +17,9 @@ import com.fr.design.login.DesignerLoginSource; import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; -import com.fr.design.upm.event.CertificateEvent; import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; @@ -79,12 +75,16 @@ public class UserInfoLabel extends UILabel { @Override public void mouseEntered(MouseEvent e) { UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); - UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); + if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); + } } @Override public void mouseExited(MouseEvent e) { - UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); + if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); + } } @Override @@ -211,12 +211,6 @@ public class UserInfoLabel extends UILabel { DesignerLoginHelper.showLoginDialog(source); } }); - EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { - @Override - public void on(Event event, String text) { - setText(text); - } - }); } private void clearLoginInformation() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java index 1e3df83df4..e6ae079aa4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -9,6 +9,10 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; import com.fr.general.DateUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -75,6 +79,13 @@ public class UserInfoPane extends BasicPane { autoPushLoginDialog(); this.add(userInfoLabel, BorderLayout.CENTER); + + EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { + @Override + public void on(Event event, String text) { + markSignIn(text); + } + }); } public UserInfoLabel getUserInfoLabel() {