diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 0a464aa6d9..0f577d852f 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -1,6 +1,7 @@ package com.fr.design; import com.fr.common.report.ReportState; +import com.fr.design.env.processor.RemoteDesignerWorkspaceInfoProcessor; import com.fr.design.mainframe.manager.clip.TemplateTreeClipboard; import com.fr.design.plugin.remind.PluginErrorDesignReminder; import com.fr.design.data.DesignTableDataManager; @@ -101,6 +102,29 @@ public class EnvChangeEntrance { } } + /** + * 插件进行用户名转换 + * + * @param workspaceInfo 环境信息 + */ + private DesignerWorkspaceInfo customUserName(DesignerWorkspaceInfo workspaceInfo) { + //本地环境直接返回 + if (workspaceInfo == null || workspaceInfo.getType() == DesignerWorkspaceType.Local) { + return workspaceInfo; + } + RemoteDesignerWorkspaceInfoProcessor processor = ExtraDesignClassManager.getInstance().getSingle(RemoteDesignerWorkspaceInfoProcessor.XML_TAG); + if (processor == null) { + return workspaceInfo; + } + try { + WorkspaceConnectionInfo workspaceConnectionInfo = processor.customUserName(workspaceInfo.getConnection()); + return (RemoteDesignerWorkspaceInfo) ((RemoteDesignerWorkspaceInfo) workspaceInfo).cloneWithConnectionInfo(workspaceConnectionInfo); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return workspaceInfo; + } + } + /** * 切换到新环境 * @@ -109,7 +133,7 @@ public class EnvChangeEntrance { */ private boolean switch2Env(final String envName, PopTipStrategy strategy) { DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); + DesignerWorkspaceInfo selectedEnv = customUserName(envManager.getWorkspaceInfo(envName)); DesignerWorkspaceInfoContext.setWorkspaceInfo(selectedEnv); WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java index 1d8d99266e..aeab19aca3 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java @@ -4,10 +4,21 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.general.IOUtils; - - -import javax.swing.*; -import java.awt.*; +import com.fr.general.locale.image.I18nImage; + +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.LayoutManager; +import java.awt.Rectangle; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -23,8 +34,10 @@ public class RemindPane extends JPanel { private Icon checkIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/check.png"); private Icon unCheckIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/uncheck.png"); private Icon closeIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind_close.png"); - private Icon labelIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind.png"); - private Icon openIcon = IOUtils.readIcon("com/fr/design/mainframe/alphafine/images/open.png"); + private static final String REMIND_IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/open/open.png"; + private Icon labelIcon = new ImageIcon(I18nImage.getImage(REMIND_IMAGE_URL)); + private static final String OPEN_IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/open/open.png"; + private final Icon openIcon = new ImageIcon(I18nImage.getImage(OPEN_IMAGE_URL)); private static final int WIDTH = 600; private static final int HEIGHT = 400; diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index 920a13dbfb..39abe75cfb 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -6,6 +6,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.security.SecurityToolbox; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.fun.mark.Immutable; import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; @@ -166,6 +167,15 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { return object; } + /** + * clone一个自定义连接信息的RemoteDesignerWorkspaceInfo + */ + public Object cloneWithConnectionInfo(WorkspaceConnectionInfo workspaceConnectionInfo) throws CloneNotSupportedException { + RemoteDesignerWorkspaceInfo object = (RemoteDesignerWorkspaceInfo) super.clone(); + object.connection = workspaceConnectionInfo; + return object; + } + @Override public boolean checkValid() throws Exception { diff --git a/designer-base/src/main/java/com/fr/design/env/processor/AbstractRemoteDesignerWorkspaceInfoProcessor.java b/designer-base/src/main/java/com/fr/design/env/processor/AbstractRemoteDesignerWorkspaceInfoProcessor.java new file mode 100644 index 0000000000..6917f1745f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/env/processor/AbstractRemoteDesignerWorkspaceInfoProcessor.java @@ -0,0 +1,24 @@ +package com.fr.design.env.processor; + +import com.fr.stable.fun.mark.API; + + +/** + * 远程设计自定义用户名接口实现抽象类 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/5/17 + */ +@API(level = RemoteDesignerWorkspaceInfoProcessor.CURRENT_LEVEL) +public abstract class AbstractRemoteDesignerWorkspaceInfoProcessor implements RemoteDesignerWorkspaceInfoProcessor { + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/env/processor/RemoteDesignerWorkspaceInfoProcessor.java b/designer-base/src/main/java/com/fr/design/env/processor/RemoteDesignerWorkspaceInfoProcessor.java new file mode 100644 index 0000000000..b74d21159f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/env/processor/RemoteDesignerWorkspaceInfoProcessor.java @@ -0,0 +1,25 @@ +package com.fr.design.env.processor; + +import com.fr.stable.fun.mark.Immutable; +import com.fr.workspace.connect.WorkspaceConnectionInfo; + +/** + * 远程设计自定义用户名接口 + * px:为了二开插件开的接口,不建议实现,后面可能会变动 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/5/17 + */ +public interface RemoteDesignerWorkspaceInfoProcessor extends Immutable { + + String XML_TAG = "RemoteDesignerWorkspaceInfoProcessor"; + + int CURRENT_LEVEL = 1; + + /** + * 根据链接信息自定义用户名 + */ + WorkspaceConnectionInfo customUserName(WorkspaceConnectionInfo workspaceInfo); + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java index ea649033ea..7ff83c7b19 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java @@ -11,6 +11,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; import com.fr.general.IOUtils; +import com.fr.general.locale.image.I18nImage; import com.fr.stable.Constants; import com.fr.stable.StringUtils; @@ -26,7 +27,6 @@ import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.RenderingHints; -import java.awt.Toolkit; import java.awt.Window; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -209,7 +209,8 @@ public class TemplateThemeBlock extends JPanel { } private static class ThumbnailPane extends JPanel { - private static final Image LOADING_IMAGE = Toolkit.getDefaultToolkit().createImage(ThumbnailPane.class.getResource("/com/fr/design/images/mainframe/loading.gif")); + private static final String LOADING_IMAGE_URL = "/com/fr/design/images/mainframe/loading/loading.gif"; + private static final Image LOADING_IMAGE = I18nImage.getImage(LOADING_IMAGE_URL); private Image thumbnail = null; @Override diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 31bdaa979b..7be733b2b5 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -5,6 +5,7 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.border.UITitledBorder; import com.fr.design.env.RemoteDesignerWorkspaceInfo; +import com.fr.design.env.processor.RemoteDesignerWorkspaceInfoProcessor; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -579,8 +580,14 @@ public class RemoteEnvPane extends BasicBeanPane { private void tryConnectRemoteEnv() { final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); - final WorkspaceConnectionInfo connection = remoteEnv.getConnection(); - + WorkspaceConnectionInfo originalConnection = remoteEnv.getConnection(); + final WorkspaceConnectionInfo connection; + RemoteDesignerWorkspaceInfoProcessor processor = ExtraDesignClassManager.getInstance().getSingle(RemoteDesignerWorkspaceInfoProcessor.XML_TAG); + if (processor != null) { + connection = processor.customUserName(originalConnection); + } else { + connection = originalConnection; + } final SwingWorker worker = new SwingWorker() { @Override diff --git a/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading.gif b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading.gif new file mode 100644 index 0000000000..ce2172ba41 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading.gif differ diff --git a/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_en.gif b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_en.gif new file mode 100644 index 0000000000..26870d749c Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_en.gif differ diff --git a/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_zh.gif b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_zh.gif new file mode 100644 index 0000000000..c77b4fe100 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_zh.gif differ diff --git a/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_zh_TW.gif b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_zh_TW.gif new file mode 100644 index 0000000000..c78edd7a9c Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading/loading_zh_TW.gif differ diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.css b/designer-base/src/main/resources/com/fr/design/login/guide.css deleted file mode 100644 index 12af5f6c3b..0000000000 --- a/designer-base/src/main/resources/com/fr/design/login/guide.css +++ /dev/null @@ -1,57 +0,0 @@ -.background-login-close { - color: white !important; - font-weight: bold; - font-size: 14px; -} -.background-guide-close { - background: url(./img/icon_install_normal.png) no-repeat center center; - background-size: cover; - width: 20px; - height: 20px; - cursor: pointer; -} -.background-guide-close:hover { - background-color: #E8E8E9; -} -.background-login-loading { - background: url(./img/login_loading.gif) no-repeat center center; -} -.background-plugin-need-update { - background: url(./img/icon_new.png) no-repeat center center; -} -.background-plugin-cant-use { - background: url(./img/icon_cantuse.png) no-repeat center center; -} -.background-plugin-is-disable { - background: url(./img/icon_disable.png) no-repeat center center; -} -.background-plugin-is-disable-new { - background: url(./img/icon_disable-new.png) no-repeat center center; -} -.background-plugin-selected { - background: url(./img/icon_marked.png) no-repeat center center; -} -.background-shop-title-close { - background: url(./img/icon_close40x40_normal.svg) no-repeat center center; -} -.background-dialog-confirm { - background: url(./img/warning.png) no-repeat center center; - background-size: contain; -} -.background-close-button { - background: url(./img/icon_close9x9_normal.png) no-repeat center center; -} -.background-close-button:hover { - background: url(./img/icon_close9x9_hover.png) no-repeat center center; -} -.designer-login-guide { - background: url(./img/login_guide.png) no-repeat center center; - background-size: cover; -} -.designer-guide-login-button { - font-size: 14px; - color: white; - border-radius: 4px; - background-color: #3685F2; -} - diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.html b/designer-base/src/main/resources/com/fr/design/login/guide.html index aada842a10..bafec74c30 100644 --- a/designer-base/src/main/resources/com/fr/design/login/guide.html +++ b/designer-base/src/main/resources/com/fr/design/login/guide.html @@ -15,7 +15,7 @@ - +