From 678c9124ce6776acc866c14f3c92bec6847dd80b Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 29 May 2019 15:55:50 +0800 Subject: [PATCH 01/25] =?UTF-8?q?REPORT-17186=20=E3=80=90=E5=86=B3?= =?UTF-8?q?=E7=AD=96=E6=8A=A5=E8=A1=A8=E3=80=91=E6=9D=A1=E4=BB=B6=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=B7=BB=E5=8A=A0=E8=B6=85=E9=93=BE=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=9C=A8=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=87=8C=E7=94=9F=E6=88=90=E4=B8=80=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/xpane/FormHyperlinkGroupPaneNoPop.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java b/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java index 313b571470..6098a2600a 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java @@ -23,4 +23,14 @@ public class FormHyperlinkGroupPaneNoPop extends FormHyperlinkGroupPane{ protected boolean isNewStyle() { return false; } + + /** + * 是否需要将条件属性中的超级链接自动保存到超级链接属性中 + * + * @return 是否需要自动保存 + */ + @Override + public boolean needAutoSave() { + return false; + } } From 8d7ff550dbb15fe949c2494e8285c4b122919ee0 Mon Sep 17 00:00:00 2001 From: Hades Date: Thu, 30 May 2019 09:40:51 +0800 Subject: [PATCH 02/25] update --- .../fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java b/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java index 6098a2600a..051c7bd494 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java @@ -24,13 +24,8 @@ public class FormHyperlinkGroupPaneNoPop extends FormHyperlinkGroupPane{ return false; } - /** - * 是否需要将条件属性中的超级链接自动保存到超级链接属性中 - * - * @return 是否需要自动保存 - */ @Override - public boolean needAutoSave() { - return false; + public void saveSettings() { + // do nothing } } From 77b716bb89cc8c8881f836c90d684d2283306810 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 30 May 2019 16:11:01 +0800 Subject: [PATCH 03/25] =?UTF-8?q?REPORT-15183=20=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=94=B9=E8=BF=9C=E7=A8=8Burl=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=A1=A5=E4=B8=80=E4=B8=8B10.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteEnvPane.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 0d4839d6da..9b97c43599 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -3,9 +3,11 @@ package com.fr.env; import com.fr.base.FRContext; import com.fr.base.ServerConfig; import com.fr.design.DesignerEnvManager; +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.fun.DesignerEnvProcessor; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; @@ -303,10 +305,17 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public RemoteDesignerWorkspaceInfo updateBean() { + String url = this.remoteWorkspaceURL.getURL(); + String username = this.usernameInput.getText(); + String password = new String(this.passwordInput.getPassword()); + DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); + if (envProcessor != null) { + url = envProcessor.changeEnvPathBeforeConnect(username, password, url); + } WorkspaceConnectionInfo connection = new WorkspaceConnectionInfo( - this.remoteWorkspaceURL.getURL(), - this.usernameInput.getText(), - new String(this.passwordInput.getPassword()), + url, + username, + password, this.certPathInput.getText(), new String(this.certSecretKeyInput.getPassword())); From 4aad0cc62d70b48aecbc3dbbfbee2b30b1d04852 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 31 May 2019 12:40:19 +0800 Subject: [PATCH 04/25] =?UTF-8?q?REPORT-17730=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index d5753ce155..5e57557e7f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -225,7 +225,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { return; } widgetPropertyPane.update(widget); - xCreator.resetCreatorName(currentWidgetName); + // 上面一行更新了组件 这里必须重新调用getWidgetName + xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetVisible(widget.isVisible()); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); return; From 10c9240e087cedd1d30a9ec15a07b667f6c53f43 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Fri, 31 May 2019 14:04:57 +0800 Subject: [PATCH 05/25] =?UTF-8?q?REPORT-17494=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=EF=BC=8C=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E7=81=B0=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/file/PreferencePane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 447e6652b8..de7e342780 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -232,8 +232,8 @@ public class PreferencePane extends BasicPane { enableVcsPanel.add(vcsEnableCheckBox); enableVcsPanel.add(remindVcsLabel); JPanel intervalPanel = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); - UILabel everyLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Every")); - UILabel delayLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Delay")); + final UILabel everyLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Every")); + final UILabel delayLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Delay")); intervalPanel.add(useIntervalCheckBox); intervalPanel.add(everyLabel); intervalPanel.add(saveIntervalEditor); @@ -246,10 +246,14 @@ public class PreferencePane extends BasicPane { saveCommitCheckBox.setEnabled(true); saveIntervalEditor.setEnabled(true); useIntervalCheckBox.setEnabled(true); + everyLabel.setEnabled(true); + delayLabel.setEnabled(true); } else { saveCommitCheckBox.setEnabled(false); saveIntervalEditor.setEnabled(false); useIntervalCheckBox.setEnabled(false); + everyLabel.setEnabled(false); + delayLabel.setEnabled(false); } } }); From f04c4cfdf916abc61645924c46a1e7bc88a23708 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 31 May 2019 16:18:59 +0800 Subject: [PATCH 06/25] =?UTF-8?q?KERNEL-582=20=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BC=9A=E8=B6=8A?= =?UTF-8?q?=E6=9D=A5=E8=B6=8A=E5=A4=9A=EF=BC=8C=E6=83=B3=E5=8A=9E=E6=B3=95?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=BF=99=E7=A7=8Dif=20else=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/community/VideoAction.java | 16 +++----- .../java/com/fr/design/i18n/ActionType.java | 32 +++++++++++++++ .../java/com/fr/design/i18n/LocaleCenter.java | 41 +++++++++++++++++++ .../com/fr/design/i18n/LocaleDifference.java | 32 +++++++++++++++ .../impl/AbstractDefaultLocaleAction.java | 41 +++++++++++++++++++ .../design/i18n/impl/ChinaLocaleAction.java | 9 ++++ .../design/i18n/impl/JapanLocaleAction.java | 21 ++++++++++ .../design/i18n/impl/KoreaLocaleAction.java | 6 +++ .../design/i18n/impl/TaiWanLocaleAction.java | 21 ++++++++++ .../fr/design/i18n/impl/USLocaleAction.java | 16 ++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 5 +-- .../start/CollectUserInformationDialog.java | 21 ++-------- .../main/java/com/fr/start/SplashContext.java | 10 +---- 13 files changed, 231 insertions(+), 40 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/i18n/ActionType.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java create mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 8e9fd5b32e..6eea8cc159 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,15 +1,15 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; +import com.fr.design.i18n.ActionType; +import com.fr.design.i18n.LocaleCenter; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; import javax.swing.*; import java.awt.event.ActionEvent; -import java.util.Locale; public class VideoAction extends UpdateAction { @@ -19,20 +19,14 @@ public class VideoAction extends UpdateAction this.setMenuKeySet(VIDEO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png")); } @Override public void actionPerformed(ActionEvent arg0) { - String url; - if (GeneralContext.getLocale().equals(Locale.US)) { - url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); - } else { - url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); - } - BrowseUtils.browser(url); + BrowseUtils.browser(LocaleCenter.getInstance().getLocaleAction(GeneralContext.getLocale()).getUrls().get(ActionType.VIDEO)); } public static final MenuKeySet VIDEO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/i18n/ActionType.java b/designer-base/src/main/java/com/fr/design/i18n/ActionType.java new file mode 100644 index 0000000000..1f6b9943a6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/ActionType.java @@ -0,0 +1,32 @@ +package com.fr.design.i18n; + +public enum ActionType { + + /** + * 视频教学 + */ + VIDEO("video"), + + /** + * 激活码 + */ + ACTIVATION_CODE("activationCode"), + + /** + * 帮助文档 + */ + HELP_DOCUMENT("helpDocument"), + + /** + * 论坛 + */ + BBS("bbs"); + + + private String description; + + ActionType(String description) { + this.description = description; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java new file mode 100644 index 0000000000..79476f15f4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java @@ -0,0 +1,41 @@ +package com.fr.design.i18n; + +import com.fr.design.i18n.impl.ChinaLocaleAction; +import com.fr.design.i18n.impl.JapanLocaleAction; +import com.fr.design.i18n.impl.KoreaLocaleAction; +import com.fr.design.i18n.impl.TaiWanLocaleAction; +import com.fr.design.i18n.impl.USLocaleAction; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class LocaleCenter { + + private Map actionMap = new HashMap(); + + private LocaleCenter() { + init(); + } + + private void init() { + actionMap.put(Locale.CHINA, new ChinaLocaleAction()); + actionMap.put(Locale.US, new USLocaleAction()); + actionMap.put(Locale.TAIWAN, new TaiWanLocaleAction()); + actionMap.put(Locale.JAPAN, new JapanLocaleAction()); + actionMap.put(Locale.KOREA, new KoreaLocaleAction()); + } + + private static class Holder { + private static final LocaleCenter INSTANCE = new LocaleCenter(); + } + + public static LocaleCenter getInstance() { + return Holder.INSTANCE; + } + + public LocaleDifference getLocaleAction(Locale locale) { + LocaleDifference localeDifference = actionMap.get(locale); + return localeDifference == null ? actionMap.get(Locale.CHINA) : localeDifference; + } +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java new file mode 100644 index 0000000000..41a7b26cee --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java @@ -0,0 +1,32 @@ +package com.fr.design.i18n; + +import java.util.List; +import java.util.Map; + +/** + * 国际化之间有不同表现的动作 + */ +public interface LocaleDifference { + + /** + * 返回该国际化所有的url + * @return url + */ + Map getUrls(); + + + /** + * 添加Action + * @param list 列表 + * @param action 对应action + */ + void addAction(List list, Object action); + + /** + * 返回设计器启动画面路径 + * @return 路径 + */ + String getSplashPath(); + + +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java new file mode 100644 index 0000000000..d190c990fc --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java @@ -0,0 +1,41 @@ +package com.fr.design.i18n.impl; + +import com.fr.design.i18n.LocaleDifference; +import com.fr.design.i18n.ActionType; +import com.fr.general.CloudCenter; + +import java.util.EnumMap; +import java.util.List; +import java.util.Map; + +public abstract class AbstractDefaultLocaleAction implements LocaleDifference { + + protected EnumMap urls = new EnumMap(ActionType.class); + + protected void init() { + urls.put(ActionType.BBS, CloudCenter.getInstance().acquireUrlByKind("bbs")); + urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video")); + urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.cn")); + urls.put(ActionType.HELP_DOCUMENT, CloudCenter.getInstance().acquireUrlByKind("help.zh_CN.10")); + } + + @Override + public Map getUrls() { + if (urls.isEmpty()) { + init(); + } + return urls; + } + + @Override + public void addAction(List list, Object action) { + // do nothing + } + + @Override + public String getSplashPath() { + return "/com/fr/design/images/splash_10_en.gif"; + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java new file mode 100644 index 0000000000..c10c9b7142 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java @@ -0,0 +1,9 @@ +package com.fr.design.i18n.impl; + +public class ChinaLocaleAction extends AbstractDefaultLocaleAction { + + @Override + public String getSplashPath() { + return "/com/fr/design/images/splash_10.gif"; + } +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java new file mode 100644 index 0000000000..8a018bee04 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java @@ -0,0 +1,21 @@ +package com.fr.design.i18n.impl; + +import com.fr.design.i18n.ActionType; +import com.fr.general.CloudCenter; + +public class JapanLocaleAction extends AbstractDefaultLocaleAction { + + @Override + protected void init() { + super.init(); + urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.jp")); + } + + + @Override + public String getSplashPath() { + return "/com/fr/design/images/splash_10_jp.gif"; + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java new file mode 100644 index 0000000000..0216ecdbdb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java @@ -0,0 +1,6 @@ +package com.fr.design.i18n.impl; + + +public class KoreaLocaleAction extends AbstractDefaultLocaleAction { + +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java new file mode 100644 index 0000000000..2985e74162 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java @@ -0,0 +1,21 @@ +package com.fr.design.i18n.impl; + +import com.fr.design.i18n.ActionType; +import com.fr.general.CloudCenter; + +import java.util.List; + +public class TaiWanLocaleAction extends AbstractDefaultLocaleAction { + + @Override + protected void init() { + super.init(); + urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_TW")); + urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.tw")); + } + + @Override + public void addAction(List list, Object action) { + list.add(action); + } +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java new file mode 100644 index 0000000000..bdd305761c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java @@ -0,0 +1,16 @@ +package com.fr.design.i18n.impl; + +import com.fr.design.i18n.ActionType; +import com.fr.general.CloudCenter; + +public class USLocaleAction extends AbstractDefaultLocaleAction { + + @Override + protected void init() { + super.init(); + urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video.en")); + urls.put(ActionType.HELP_DOCUMENT, CloudCenter.getInstance().acquireUrlByKind("help.en_US.10")); + urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.en")); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 7e0d6b3597..52103026a2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -47,6 +47,7 @@ import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIMenuBar; import com.fr.design.gui.itoolbar.UILargeToolbar; import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.i18n.LocaleCenter; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.menu.MenuDef; @@ -543,9 +544,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(new CusDemandAction()); shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); - if (Locale.TAIWAN.equals(GeneralContext.getLocale())) { - shortCuts.add(new FacebookFansAction()); - } + LocaleCenter.getInstance().getLocaleAction(GeneralContext.getLocale()).addAction(shortCuts, new FacebookFansAction()); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } diff --git a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java index c32c2307d2..f74fb7966d 100644 --- a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java @@ -7,11 +7,11 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.DescriptionTextArea; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.ActionType; +import com.fr.design.i18n.LocaleCenter; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import javax.swing.*; @@ -31,11 +31,6 @@ public class CollectUserInformationDialog extends UIDialog { private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; - private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); - private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); - private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); - private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); - private UITextField keyTextField; private ActionListener actionListener = new ActionListener() { @@ -130,18 +125,8 @@ public class CollectUserInformationDialog extends UIDialog { private void getKeyAction() { Locale locale = GeneralContext.getLocale(); - String url = EN_LOGIN_HTML; - if (ComparatorUtils.equals(locale, Locale.TAIWAN)) { - url = TW_LOGIN_HTML; - } - if (ComparatorUtils.equals(locale, Locale.CHINA)) { - url = CN_LOGIN_HTML; - } - if (ComparatorUtils.equals(locale, Locale.JAPAN)) { - url = JP_LOGIN_HTML; - } try { - Desktop.getDesktop().browse(new URI(url)); + Desktop.getDesktop().browse(new URI(LocaleCenter.getInstance().getLocaleAction(locale).getUrls().get(ActionType.ACTIVATION_CODE))); } catch (Exception ignored) { } diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 17eff62baf..17a4897b3a 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,6 +1,7 @@ package com.fr.start; import com.fr.design.DesignerEnvManager; +import com.fr.design.i18n.LocaleCenter; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -166,13 +167,6 @@ public class SplashContext { } private static String getSplashPath() { - Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); - if (Locale.US.equals(locale) || Locale.KOREA.equals(locale) || Locale.TAIWAN.equals(locale)) { - return "/com/fr/design/images/splash_10_en.gif"; - } else if (Locale.JAPAN.equals(locale)) { - return "/com/fr/design/images/splash_10_jp.gif"; - } else { - return "/com/fr/design/images/splash_10.gif"; - } + return LocaleCenter.getInstance().getLocaleAction(DesignerEnvManager.getEnvManager().getLanguage()).getSplashPath(); } } From bfc341f3b0113e61227940f8941f0ec33b91e954 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 4 Jun 2019 19:56:13 +0800 Subject: [PATCH 07/25] update --- .../design/actions/community/VideoAction.java | 2 +- .../main/java/com/fr/design/i18n/Action.java | 21 +++++++++++++++ .../java/com/fr/design/i18n/ActionType.java | 6 +++++ .../java/com/fr/design/i18n/LocaleCenter.java | 15 ++++++++++- .../com/fr/design/i18n/LocaleDifference.java | 23 +++++++++++++--- .../impl/AbstractDefaultLocaleAction.java | 27 ++++++++++++++++--- .../design/i18n/impl/ChinaLocaleAction.java | 13 +++++++++ .../design/i18n/impl/JapanLocaleAction.java | 13 +++++++++ .../design/i18n/impl/KoreaLocaleAction.java | 11 ++++++++ .../design/i18n/impl/TaiWanLocaleAction.java | 11 ++++++-- .../fr/design/i18n/impl/USLocaleAction.java | 12 +++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 10 +++++-- .../start/CollectUserInformationDialog.java | 3 +-- .../main/java/com/fr/start/SplashContext.java | 5 ++-- 14 files changed, 153 insertions(+), 19 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/i18n/Action.java diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 6eea8cc159..e405f3bb50 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -26,7 +26,7 @@ public class VideoAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - BrowseUtils.browser(LocaleCenter.getInstance().getLocaleAction(GeneralContext.getLocale()).getUrls().get(ActionType.VIDEO)); + BrowseUtils.browser(LocaleCenter.getInstance().getLocaleAction().getUrls().get(ActionType.VIDEO)); } public static final MenuKeySet VIDEO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/i18n/Action.java b/designer-base/src/main/java/com/fr/design/i18n/Action.java new file mode 100644 index 0000000000..a976ae4b7b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/Action.java @@ -0,0 +1,21 @@ +package com.fr.design.i18n; + +/** + * 包装一些动作 + * @author Hades + * @date 2019/6/4 + */ +public interface Action { + + Action EMPTY_ACTION = new Action() { + @Override + public void todo() { + // do nothing + } + }; + + /** + * 具体动作 + */ + void todo(); +} diff --git a/designer-base/src/main/java/com/fr/design/i18n/ActionType.java b/designer-base/src/main/java/com/fr/design/i18n/ActionType.java index 1f6b9943a6..724d3df669 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/ActionType.java +++ b/designer-base/src/main/java/com/fr/design/i18n/ActionType.java @@ -1,5 +1,11 @@ package com.fr.design.i18n; +/** + * 不同语言环境下的action + * + * @author Hades + * @date 2019/5/30 + */ public enum ActionType { /** diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java index 79476f15f4..20bc096113 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java +++ b/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java @@ -1,15 +1,24 @@ package com.fr.design.i18n; +import com.fr.design.DesignerEnvManager; import com.fr.design.i18n.impl.ChinaLocaleAction; import com.fr.design.i18n.impl.JapanLocaleAction; import com.fr.design.i18n.impl.KoreaLocaleAction; import com.fr.design.i18n.impl.TaiWanLocaleAction; import com.fr.design.i18n.impl.USLocaleAction; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; import java.util.HashMap; import java.util.Locale; import java.util.Map; +/** + * 不同语言环境的动作管理 + * + * @author Hades + * @date 2019/5/30 + */ public class LocaleCenter { private Map actionMap = new HashMap(); @@ -34,7 +43,11 @@ public class LocaleCenter { return Holder.INSTANCE; } - public LocaleDifference getLocaleAction(Locale locale) { + public LocaleDifference getLocaleAction() { + Locale locale = GeneralContext.getLocale(); + if (!ComparatorUtils.equals(locale, DesignerEnvManager.getEnvManager().getLanguage())) { + locale = DesignerEnvManager.getEnvManager().getLanguage(); + } LocaleDifference localeDifference = actionMap.get(locale); return localeDifference == null ? actionMap.get(Locale.CHINA) : localeDifference; } diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java index 41a7b26cee..d18ef8b9fd 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java +++ b/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java @@ -1,10 +1,14 @@ package com.fr.design.i18n; import java.util.List; +import java.util.Locale; import java.util.Map; /** * 国际化之间有不同表现的动作 + * + * @author Hades + * @date 2019/5/30 */ public interface LocaleDifference { @@ -16,11 +20,17 @@ public interface LocaleDifference { /** - * 添加Action - * @param list 列表 - * @param action 对应action + * 哪些国际化需要执行该动作 + * @param locales */ - void addAction(List list, Object action); + void doAction(Locale ...locales); + + /** + * 构建具体的动作 + * @param action + * @return + */ + LocaleDifference buildAction(Action action); /** * 返回设计器启动画面路径 @@ -28,5 +38,10 @@ public interface LocaleDifference { */ String getSplashPath(); + /** + * 对应的国际化 + * @return + */ + Locale getLocale(); } diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java index d190c990fc..9ed01d31d7 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java @@ -1,16 +1,28 @@ package com.fr.design.i18n.impl; +import com.fr.design.i18n.Action; import com.fr.design.i18n.LocaleDifference; import com.fr.design.i18n.ActionType; import com.fr.general.CloudCenter; +import com.fr.general.ComparatorUtils; +import java.util.ArrayList; +import java.util.Arrays; import java.util.EnumMap; import java.util.List; +import java.util.Locale; import java.util.Map; +/** + * 一些默认的实现 + * + * @author Hades + * @date 2019/5/30 + */ public abstract class AbstractDefaultLocaleAction implements LocaleDifference { protected EnumMap urls = new EnumMap(ActionType.class); + private Action action = Action.EMPTY_ACTION; protected void init() { urls.put(ActionType.BBS, CloudCenter.getInstance().acquireUrlByKind("bbs")); @@ -28,14 +40,21 @@ public abstract class AbstractDefaultLocaleAction implements LocaleDifference { } @Override - public void addAction(List list, Object action) { - // do nothing + public void doAction(Locale ...locales) { + List localeList = Arrays.asList(locales); + if (localeList.contains(this.getLocale())) { + action.todo(); + } + } + + @Override + public LocaleDifference buildAction(Action action) { + this.action = action; + return this; } @Override public String getSplashPath() { return "/com/fr/design/images/splash_10_en.gif"; } - - } diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java index c10c9b7142..d2fc2c7f94 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java @@ -1,9 +1,22 @@ package com.fr.design.i18n.impl; +import java.util.Locale; + +/** + * 简体中文环境具体的表现动作 + * + * @author Hades + * @date 2019/5/30 + */ public class ChinaLocaleAction extends AbstractDefaultLocaleAction { @Override public String getSplashPath() { return "/com/fr/design/images/splash_10.gif"; } + + @Override + public Locale getLocale() { + return Locale.CHINA; + } } diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java index 8a018bee04..81614bbb81 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java @@ -3,6 +3,14 @@ package com.fr.design.i18n.impl; import com.fr.design.i18n.ActionType; import com.fr.general.CloudCenter; +import java.util.Locale; + +/** + * 日文环境具体的表现动作 + * + * @author Hades + * @date 2019/5/30 + */ public class JapanLocaleAction extends AbstractDefaultLocaleAction { @Override @@ -17,5 +25,10 @@ public class JapanLocaleAction extends AbstractDefaultLocaleAction { return "/com/fr/design/images/splash_10_jp.gif"; } + @Override + public Locale getLocale() { + return Locale.JAPAN; + } + } diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java index 0216ecdbdb..5a5e9b8ed0 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java @@ -1,6 +1,17 @@ package com.fr.design.i18n.impl; +import java.util.Locale; +/** + * 韩文环境具体的表现动作 + * + * @author Hades + * @date 2019/5/30 + */ public class KoreaLocaleAction extends AbstractDefaultLocaleAction { + @Override + public Locale getLocale() { + return Locale.KOREA; + } } diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java index 2985e74162..f9e8df2af4 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java @@ -4,7 +4,14 @@ import com.fr.design.i18n.ActionType; import com.fr.general.CloudCenter; import java.util.List; +import java.util.Locale; +/** + * 繁体中文具体的表现动作 + * + * @author Hades + * @date 2019/5/30 + */ public class TaiWanLocaleAction extends AbstractDefaultLocaleAction { @Override @@ -15,7 +22,7 @@ public class TaiWanLocaleAction extends AbstractDefaultLocaleAction { } @Override - public void addAction(List list, Object action) { - list.add(action); + public Locale getLocale() { + return Locale.TAIWAN; } } diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java index bdd305761c..4acfc3db10 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java +++ b/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java @@ -3,6 +3,14 @@ package com.fr.design.i18n.impl; import com.fr.design.i18n.ActionType; import com.fr.general.CloudCenter; +import java.util.Locale; + +/** + * 英文环境具体的表现动作 + * + * @author Hades + * @date 2019/5/30 + */ public class USLocaleAction extends AbstractDefaultLocaleAction { @Override @@ -13,4 +21,8 @@ public class USLocaleAction extends AbstractDefaultLocaleAction { urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.en")); } + @Override + public Locale getLocale() { + return Locale.US; + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 52103026a2..3fad25f6f4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -47,6 +47,7 @@ import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIMenuBar; import com.fr.design.gui.itoolbar.UILargeToolbar; import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.i18n.Action; import com.fr.design.i18n.LocaleCenter; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.ToolBarNewTemplatePane; @@ -533,7 +534,7 @@ public abstract class ToolBarMenuDock { * @return 社区菜单的子菜单 */ public ShortCut[] createCommunityShortCuts() { - java.util.List shortCuts = new ArrayList(); + final java.util.List shortCuts = new ArrayList(); shortCuts.add(new BBSAction()); shortCuts.add(new VideoAction()); shortCuts.add(new TutorialAction()); @@ -544,7 +545,12 @@ public abstract class ToolBarMenuDock { shortCuts.add(new CusDemandAction()); shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); - LocaleCenter.getInstance().getLocaleAction(GeneralContext.getLocale()).addAction(shortCuts, new FacebookFansAction()); + LocaleCenter.getInstance().getLocaleAction().buildAction(new Action() { + @Override + public void todo() { + shortCuts.add(new FacebookFansAction()); + } + }).doAction(Locale.TAIWAN); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } diff --git a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java index f74fb7966d..1ec0712810 100644 --- a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java @@ -124,9 +124,8 @@ public class CollectUserInformationDialog extends UIDialog { private void getKeyAction() { - Locale locale = GeneralContext.getLocale(); try { - Desktop.getDesktop().browse(new URI(LocaleCenter.getInstance().getLocaleAction(locale).getUrls().get(ActionType.ACTIVATION_CODE))); + Desktop.getDesktop().browse(new URI(LocaleCenter.getInstance().getLocaleAction().getUrls().get(ActionType.ACTIVATION_CODE))); } catch (Exception ignored) { } diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 17a4897b3a..9fcdad122a 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,6 +1,5 @@ package com.fr.start; -import com.fr.design.DesignerEnvManager; import com.fr.design.i18n.LocaleCenter; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.event.Event; @@ -25,7 +24,7 @@ import java.util.concurrent.TimeUnit; public class SplashContext { public static final String SPLASH_PATH = getSplashPath(); - public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1); + public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf('/') + 1); private static final int FETCH_ONLINE_MAX_TIMES = 50; private static final SplashContext SPLASH_CONTEXT = new SplashContext(); @@ -167,6 +166,6 @@ public class SplashContext { } private static String getSplashPath() { - return LocaleCenter.getInstance().getLocaleAction(DesignerEnvManager.getEnvManager().getLanguage()).getSplashPath(); + return LocaleCenter.getInstance().getLocaleAction().getSplashPath(); } } From f9fb1389e67f6b10aa7378203fb98ca97d9e2fa0 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 5 Jun 2019 09:24:53 +0800 Subject: [PATCH 08/25] =?UTF-8?q?MOBILE-21196=20=E3=80=90=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E3=80=91=E7=A7=BB=E5=8A=A8=E7=AB=AF=E3=80=8B=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E3=80=8B=E6=89=93=E5=BC=80=E5=B0=91=E6=95=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=87=BA=E7=8E=B0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E7=BC=93=E6=85=A2=EF=BC=8C=E6=97=B6=E9=97=B4=E5=9C=A85s?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A=E4=B8=8D=E7=AD=89=20=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/frpane/ImgChooseWrapper.java | 4 ++-- .../ImageBackgroundQuickPane.java | 2 +- .../backgroundpane/ImagePreviewPane.java | 2 +- .../background/image/ImagePreviewPane.java | 2 +- .../java/com/fr/design/utils/ImageUtils.java | 19 +++++++++++++--- .../com/fr/design/mainframe/JWorkBook.java | 4 +++- .../com/fr/design/report/SelectImagePane.java | 22 +++++-------------- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java index 36183f1078..19823d8b42 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java @@ -7,7 +7,6 @@ import com.fr.design.style.background.image.ImageFileChooser; import com.fr.design.style.background.image.ImagePreviewer; import com.fr.design.utils.ImageUtils; import com.fr.general.ImageWithSuffix; - import com.fr.stable.CoreGraphHelper; import com.fr.stable.StringUtils; @@ -16,6 +15,7 @@ import javax.swing.SwingWorker; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.Image; +import java.awt.image.BufferedImage; import java.io.File; /** @@ -103,7 +103,7 @@ public class ImgChooseWrapper { if (imageFileChooser.isCheckSelected()) { imageWithSuffix = ImageUtils.defaultImageCompWithSuff(selectedFile); } else { - Image image = BaseUtils.readImage(selectedFile.getPath()); + BufferedImage image = BaseUtils.readImage(selectedFile.getPath()); String type = ImageUtils.getImageType(selectedFile); imageWithSuffix = new ImageWithSuffix(image, type); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java index 7f794b708b..afa6fc9077 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java @@ -114,7 +114,7 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane { @Override public Background updateBean() { - ImageFileBackground imageBackground = new ImageFileBackground(previewPane.getImage(), suffix); + ImageFileBackground imageBackground = new ImageFileBackground(previewPane.getImageWithSuffix()); imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(imageLayoutPane.getSelectedItem()); imageBackground.setLayout(imageStyle.getImageLayout()); return imageBackground; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java index 6b9882397f..24b3ebfc42 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java @@ -304,7 +304,7 @@ public class ImagePreviewPane extends JComponent implements Scrollable, ImagePre @Override public void setImage(Image image) { - setImageWithSuffix(image == null ? null : new ImageWithSuffix(image)); + setImageWithSuffix(ImageWithSuffix.build(image)); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java b/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java index 0e5cbe4635..bc4f3f41cc 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java @@ -63,7 +63,7 @@ public class ImagePreviewPane extends JComponent implements Scrollable, ImagePre @Override public void setImage(Image image) { - setImageWithSuffix(image == null ? null : new ImageWithSuffix(image)); + setImageWithSuffix(ImageWithSuffix.build(image)); } diff --git a/designer-base/src/main/java/com/fr/design/utils/ImageUtils.java b/designer-base/src/main/java/com/fr/design/utils/ImageUtils.java index 33f928a466..389b9981e9 100644 --- a/designer-base/src/main/java/com/fr/design/utils/ImageUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/ImageUtils.java @@ -1,6 +1,7 @@ package com.fr.design.utils; import com.fr.base.BaseUtils; +import com.fr.base.frpx.util.ImageIOHelper; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.ImageWithSuffix; @@ -70,7 +71,7 @@ public class ImageUtils { return null; } BufferedImage srcImg = BaseUtils.readImage(imageFile.getPath()); - Image desImg = srcImg; + BufferedImage desImg = srcImg; try { if (canbeCompressedToJPEG(imageFile)) { @@ -186,11 +187,23 @@ public class ImageUtils { /** * 获取图片类型 + * 先根据ImageReader获取,ImageReader获取不到就拿后缀 * * @param imageFile 图片文件 * @return 图片类型(JPEG, PNG, GIF) */ public static String getImageType(File imageFile) { + String imageType = getImageTypeByImageReader(imageFile); + return StringUtils.EMPTY.equals(imageType) ? ImageIOHelper.getSuffix(imageFile) : imageType; + } + + /** + * 根据ImageReader获取图片类型 + * + * @param imageFile 图片文件 + * @return 图片类型(JPEG, PNG, GIF) + */ + public static String getImageTypeByImageReader(File imageFile) { try { ImageInputStream iis = ImageIO.createImageInputStream(imageFile); Iterator iter = ImageIO.getImageReaders(iis); @@ -226,7 +239,7 @@ public class ImageUtils { * @param scale 缩放比例。比例大于1时为放大,小于1大于0为缩小 * @param opacityCompatible 是否处理背景透明 */ - public static Image scale(BufferedImage srcImg, float scale, boolean opacityCompatible) { + public static BufferedImage scale(BufferedImage srcImg, float scale, boolean opacityCompatible) { if (scale < 0) { // 自动修正负数 scale = -scale; @@ -234,7 +247,7 @@ public class ImageUtils { int width = mul(Integer.toString(srcImg.getWidth(null)), Float.toString(scale)).intValue(); // 得到源图宽 int height = mul(Integer.toString(srcImg.getHeight(null)), Float.toString(scale)).intValue(); // 得到源图长 - return scale(srcImg, width, height, opacityCompatible); + return CoreGraphHelper.toBufferedImage(scale(srcImg, width, height, opacityCompatible)); } private static BigDecimal mul(String v1, String v2) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 07136bc1ef..6e72e98fef 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -68,6 +68,7 @@ import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; +import com.fr.general.ImageWithSuffix; import com.fr.general.ModuleContext; import com.fr.grid.Grid; import com.fr.grid.GridUtils; @@ -89,6 +90,7 @@ import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.poly.PolyWorkSheet; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; +import com.fr.stable.CoreGraphHelper; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.module.Module; @@ -621,7 +623,7 @@ public class JWorkBook extends JTemplate { if (workBook instanceof WorkBookAdapter) { elem.setValue(new CellImagePainter(cellImage)); } else { - elem.setValue(cellImage.getImage()); + elem.setValue(ImageWithSuffix.build(cellImage.getImage(),cellImage.getSuffix())); } } diff --git a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java b/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java index 77a662d6d1..ba57676ecd 100644 --- a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java @@ -2,16 +2,15 @@ package com.fr.design.report; import com.fr.base.BaseUtils; import com.fr.base.Style; -import com.fr.base.frpx.pack.PictureCollection; -import com.fr.base.frpx.util.ImageIOHelper; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.image.ImageFileChooser; import com.fr.design.style.background.image.ImagePreviewPane; +import com.fr.design.utils.ImageUtils; import com.fr.design.utils.gui.GUICoreUtils; - +import com.fr.general.ImageWithSuffix; import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.painter.CellImagePainter; @@ -28,6 +27,7 @@ import java.awt.GridLayout; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; import java.io.File; /** @@ -46,11 +46,6 @@ public class SelectImagePane extends BasicPane { private Image previewImage = null; - /** - * 默认格式 - */ - private String suffix = PictureCollection.DEFAULT_SUFFIX; - private File imageFile; public SelectImagePane() { @@ -127,13 +122,12 @@ public class SelectImagePane extends BasicPane { if (selectedFile != null && selectedFile.isFile()) { String filePath = selectedFile.getPath(); - suffix = ImageIOHelper.getSuffix(filePath); - Image image = BaseUtils.readImage(filePath); + BufferedImage image = BaseUtils.readImage(filePath); CoreGraphHelper.waitForImage(image); imageFile = selectedFile; setImageStyle(); - previewPane.setImage(image); + previewPane.setImageWithSuffix(ImageWithSuffix.build(image, ImageUtils.getImageType(selectedFile))); previewPane.setImageStyle(imageStyle); previewImage = image; } else { @@ -184,7 +178,6 @@ public class SelectImagePane extends BasicPane { setImage((Image) value); } else if (value instanceof CellImagePainter) { setImage(((CellImagePainter) value).getImage()); - suffix = ((CellImagePainter) value).getSuffix(); } style = cell.getStyle(); @@ -214,11 +207,8 @@ public class SelectImagePane extends BasicPane { public CellImage update() { CellImage cellImage = new CellImage(); - cellImage.setImage(previewPane.getImage()); + cellImage.setImage(previewPane.getImageWithSuffix()); cellImage.setStyle(this.imageStyle); - if (suffix != null) { - cellImage.setSuffix(suffix); - } return cellImage; } From 63cf9064fe8b4e2032908cf60f5f9cb6e505b062 Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 5 Jun 2019 09:38:04 +0800 Subject: [PATCH 09/25] =?UTF-8?q?REPORT-17656=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=90=8E=E5=80=BC=E8=A2=AB=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/community/VideoAction.java | 16 +++-- .../main/java/com/fr/design/i18n/Action.java | 21 ------- .../java/com/fr/design/i18n/ActionType.java | 38 ------------ .../java/com/fr/design/i18n/LocaleCenter.java | 54 ----------------- .../com/fr/design/i18n/LocaleDifference.java | 47 --------------- .../impl/AbstractDefaultLocaleAction.java | 60 ------------------- .../design/i18n/impl/ChinaLocaleAction.java | 22 ------- .../design/i18n/impl/JapanLocaleAction.java | 34 ----------- .../design/i18n/impl/KoreaLocaleAction.java | 17 ------ .../design/i18n/impl/TaiWanLocaleAction.java | 28 --------- .../fr/design/i18n/impl/USLocaleAction.java | 28 --------- .../mainframe/toolbar/ToolBarMenuDock.java | 13 ++-- .../com/fr/grid/GridCornerMouseHandler.java | 2 + .../start/CollectUserInformationDialog.java | 22 ++++++- .../main/java/com/fr/start/SplashContext.java | 15 +++-- 15 files changed, 47 insertions(+), 370 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/Action.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/ActionType.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java delete mode 100644 designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index e405f3bb50..7fa6314d6b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,15 +1,15 @@ package com.fr.design.actions.community; +import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; -import com.fr.design.i18n.ActionType; -import com.fr.design.i18n.LocaleCenter; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; -import com.fr.general.IOUtils; import javax.swing.*; import java.awt.event.ActionEvent; +import java.util.Locale; public class VideoAction extends UpdateAction { @@ -19,14 +19,20 @@ public class VideoAction extends UpdateAction this.setMenuKeySet(VIDEO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png")); } @Override public void actionPerformed(ActionEvent arg0) { - BrowseUtils.browser(LocaleCenter.getInstance().getLocaleAction().getUrls().get(ActionType.VIDEO)); + String url; + if (GeneralContext.getLocale().equals(Locale.US)) { + url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); + } else { + url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); + } + BrowseUtils.browser(url); } public static final MenuKeySet VIDEO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/i18n/Action.java b/designer-base/src/main/java/com/fr/design/i18n/Action.java deleted file mode 100644 index a976ae4b7b..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/Action.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.design.i18n; - -/** - * 包装一些动作 - * @author Hades - * @date 2019/6/4 - */ -public interface Action { - - Action EMPTY_ACTION = new Action() { - @Override - public void todo() { - // do nothing - } - }; - - /** - * 具体动作 - */ - void todo(); -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/ActionType.java b/designer-base/src/main/java/com/fr/design/i18n/ActionType.java deleted file mode 100644 index 724d3df669..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/ActionType.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.fr.design.i18n; - -/** - * 不同语言环境下的action - * - * @author Hades - * @date 2019/5/30 - */ -public enum ActionType { - - /** - * 视频教学 - */ - VIDEO("video"), - - /** - * 激活码 - */ - ACTIVATION_CODE("activationCode"), - - /** - * 帮助文档 - */ - HELP_DOCUMENT("helpDocument"), - - /** - * 论坛 - */ - BBS("bbs"); - - - private String description; - - ActionType(String description) { - this.description = description; - } - -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java deleted file mode 100644 index 20bc096113..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.fr.design.i18n; - -import com.fr.design.DesignerEnvManager; -import com.fr.design.i18n.impl.ChinaLocaleAction; -import com.fr.design.i18n.impl.JapanLocaleAction; -import com.fr.design.i18n.impl.KoreaLocaleAction; -import com.fr.design.i18n.impl.TaiWanLocaleAction; -import com.fr.design.i18n.impl.USLocaleAction; -import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralContext; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** - * 不同语言环境的动作管理 - * - * @author Hades - * @date 2019/5/30 - */ -public class LocaleCenter { - - private Map actionMap = new HashMap(); - - private LocaleCenter() { - init(); - } - - private void init() { - actionMap.put(Locale.CHINA, new ChinaLocaleAction()); - actionMap.put(Locale.US, new USLocaleAction()); - actionMap.put(Locale.TAIWAN, new TaiWanLocaleAction()); - actionMap.put(Locale.JAPAN, new JapanLocaleAction()); - actionMap.put(Locale.KOREA, new KoreaLocaleAction()); - } - - private static class Holder { - private static final LocaleCenter INSTANCE = new LocaleCenter(); - } - - public static LocaleCenter getInstance() { - return Holder.INSTANCE; - } - - public LocaleDifference getLocaleAction() { - Locale locale = GeneralContext.getLocale(); - if (!ComparatorUtils.equals(locale, DesignerEnvManager.getEnvManager().getLanguage())) { - locale = DesignerEnvManager.getEnvManager().getLanguage(); - } - LocaleDifference localeDifference = actionMap.get(locale); - return localeDifference == null ? actionMap.get(Locale.CHINA) : localeDifference; - } -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java deleted file mode 100644 index d18ef8b9fd..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.design.i18n; - -import java.util.List; -import java.util.Locale; -import java.util.Map; - -/** - * 国际化之间有不同表现的动作 - * - * @author Hades - * @date 2019/5/30 - */ -public interface LocaleDifference { - - /** - * 返回该国际化所有的url - * @return url - */ - Map getUrls(); - - - /** - * 哪些国际化需要执行该动作 - * @param locales - */ - void doAction(Locale ...locales); - - /** - * 构建具体的动作 - * @param action - * @return - */ - LocaleDifference buildAction(Action action); - - /** - * 返回设计器启动画面路径 - * @return 路径 - */ - String getSplashPath(); - - /** - * 对应的国际化 - * @return - */ - Locale getLocale(); - -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java deleted file mode 100644 index 9ed01d31d7..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.fr.design.i18n.impl; - -import com.fr.design.i18n.Action; -import com.fr.design.i18n.LocaleDifference; -import com.fr.design.i18n.ActionType; -import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -/** - * 一些默认的实现 - * - * @author Hades - * @date 2019/5/30 - */ -public abstract class AbstractDefaultLocaleAction implements LocaleDifference { - - protected EnumMap urls = new EnumMap(ActionType.class); - private Action action = Action.EMPTY_ACTION; - - protected void init() { - urls.put(ActionType.BBS, CloudCenter.getInstance().acquireUrlByKind("bbs")); - urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video")); - urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.cn")); - urls.put(ActionType.HELP_DOCUMENT, CloudCenter.getInstance().acquireUrlByKind("help.zh_CN.10")); - } - - @Override - public Map getUrls() { - if (urls.isEmpty()) { - init(); - } - return urls; - } - - @Override - public void doAction(Locale ...locales) { - List localeList = Arrays.asList(locales); - if (localeList.contains(this.getLocale())) { - action.todo(); - } - } - - @Override - public LocaleDifference buildAction(Action action) { - this.action = action; - return this; - } - - @Override - public String getSplashPath() { - return "/com/fr/design/images/splash_10_en.gif"; - } -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java deleted file mode 100644 index d2fc2c7f94..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fr.design.i18n.impl; - -import java.util.Locale; - -/** - * 简体中文环境具体的表现动作 - * - * @author Hades - * @date 2019/5/30 - */ -public class ChinaLocaleAction extends AbstractDefaultLocaleAction { - - @Override - public String getSplashPath() { - return "/com/fr/design/images/splash_10.gif"; - } - - @Override - public Locale getLocale() { - return Locale.CHINA; - } -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java deleted file mode 100644 index 81614bbb81..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.fr.design.i18n.impl; - -import com.fr.design.i18n.ActionType; -import com.fr.general.CloudCenter; - -import java.util.Locale; - -/** - * 日文环境具体的表现动作 - * - * @author Hades - * @date 2019/5/30 - */ -public class JapanLocaleAction extends AbstractDefaultLocaleAction { - - @Override - protected void init() { - super.init(); - urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.jp")); - } - - - @Override - public String getSplashPath() { - return "/com/fr/design/images/splash_10_jp.gif"; - } - - @Override - public Locale getLocale() { - return Locale.JAPAN; - } - - -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java deleted file mode 100644 index 5a5e9b8ed0..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.fr.design.i18n.impl; - -import java.util.Locale; - -/** - * 韩文环境具体的表现动作 - * - * @author Hades - * @date 2019/5/30 - */ -public class KoreaLocaleAction extends AbstractDefaultLocaleAction { - - @Override - public Locale getLocale() { - return Locale.KOREA; - } -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java deleted file mode 100644 index f9e8df2af4..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.design.i18n.impl; - -import com.fr.design.i18n.ActionType; -import com.fr.general.CloudCenter; - -import java.util.List; -import java.util.Locale; - -/** - * 繁体中文具体的表现动作 - * - * @author Hades - * @date 2019/5/30 - */ -public class TaiWanLocaleAction extends AbstractDefaultLocaleAction { - - @Override - protected void init() { - super.init(); - urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_TW")); - urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.tw")); - } - - @Override - public Locale getLocale() { - return Locale.TAIWAN; - } -} diff --git a/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java b/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java deleted file mode 100644 index 4acfc3db10..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.design.i18n.impl; - -import com.fr.design.i18n.ActionType; -import com.fr.general.CloudCenter; - -import java.util.Locale; - -/** - * 英文环境具体的表现动作 - * - * @author Hades - * @date 2019/5/30 - */ -public class USLocaleAction extends AbstractDefaultLocaleAction { - - @Override - protected void init() { - super.init(); - urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video.en")); - urls.put(ActionType.HELP_DOCUMENT, CloudCenter.getInstance().acquireUrlByKind("help.en_US.10")); - urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.en")); - } - - @Override - public Locale getLocale() { - return Locale.US; - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 3fad25f6f4..7e0d6b3597 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -47,8 +47,6 @@ import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIMenuBar; import com.fr.design.gui.itoolbar.UILargeToolbar; import com.fr.design.gui.itoolbar.UIToolbar; -import com.fr.design.i18n.Action; -import com.fr.design.i18n.LocaleCenter; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.menu.MenuDef; @@ -534,7 +532,7 @@ public abstract class ToolBarMenuDock { * @return 社区菜单的子菜单 */ public ShortCut[] createCommunityShortCuts() { - final java.util.List shortCuts = new ArrayList(); + java.util.List shortCuts = new ArrayList(); shortCuts.add(new BBSAction()); shortCuts.add(new VideoAction()); shortCuts.add(new TutorialAction()); @@ -545,12 +543,9 @@ public abstract class ToolBarMenuDock { shortCuts.add(new CusDemandAction()); shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); - LocaleCenter.getInstance().getLocaleAction().buildAction(new Action() { - @Override - public void todo() { - shortCuts.add(new FacebookFansAction()); - } - }).doAction(Locale.TAIWAN); + if (Locale.TAIWAN.equals(GeneralContext.getLocale())) { + shortCuts.add(new FacebookFansAction()); + } return shortCuts.toArray(new ShortCut[shortCuts.size()]); } diff --git a/designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java index 4c4342291b..e68bd907b9 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java +++ b/designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java @@ -29,6 +29,8 @@ public class GridCornerMouseHandler extends MouseInputAdapter { private void doSelectAll() { ElementCasePane reportPane = this.gridCorner.getElementCasePane(); + // 全选时,停止编辑状态 + reportPane.getGrid().stopEditing(); ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane); reportPane.setSelection(new CellSelection(0, 0, lastColumnRow.getColumn(), lastColumnRow.getRow())); diff --git a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java index 1ec0712810..c32c2307d2 100644 --- a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java @@ -7,11 +7,11 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.DescriptionTextArea; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.i18n.ActionType; -import com.fr.design.i18n.LocaleCenter; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; +import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import javax.swing.*; @@ -31,6 +31,11 @@ public class CollectUserInformationDialog extends UIDialog { private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; + private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); + private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); + private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); + private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); + private UITextField keyTextField; private ActionListener actionListener = new ActionListener() { @@ -124,8 +129,19 @@ public class CollectUserInformationDialog extends UIDialog { private void getKeyAction() { + Locale locale = GeneralContext.getLocale(); + String url = EN_LOGIN_HTML; + if (ComparatorUtils.equals(locale, Locale.TAIWAN)) { + url = TW_LOGIN_HTML; + } + if (ComparatorUtils.equals(locale, Locale.CHINA)) { + url = CN_LOGIN_HTML; + } + if (ComparatorUtils.equals(locale, Locale.JAPAN)) { + url = JP_LOGIN_HTML; + } try { - Desktop.getDesktop().browse(new URI(LocaleCenter.getInstance().getLocaleAction().getUrls().get(ActionType.ACTIVATION_CODE))); + Desktop.getDesktop().browse(new URI(url)); } catch (Exception ignored) { } diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 9fcdad122a..441bf0f607 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,6 +1,6 @@ package com.fr.start; -import com.fr.design.i18n.LocaleCenter; +import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit; public class SplashContext { public static final String SPLASH_PATH = getSplashPath(); - public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf('/') + 1); + public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1); private static final int FETCH_ONLINE_MAX_TIMES = 50; private static final SplashContext SPLASH_CONTEXT = new SplashContext(); @@ -166,6 +166,13 @@ public class SplashContext { } private static String getSplashPath() { - return LocaleCenter.getInstance().getLocaleAction().getSplashPath(); + Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); + if (Locale.US.equals(locale) || Locale.KOREA.equals(locale) || Locale.TAIWAN.equals(locale)) { + return "/com/fr/design/images/splash_10_en.gif"; + } else if (Locale.JAPAN.equals(locale)) { + return "/com/fr/design/images/splash_10_jp.gif"; + } else { + return "/com/fr/design/images/splash_10.gif"; + } } -} +} \ No newline at end of file From 7d209fba578597d85cd0e2709a1e73ebf62cf85a Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 5 Jun 2019 09:40:43 +0800 Subject: [PATCH 10/25] update --- .../main/java/com/fr/design/actions/community/VideoAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 7fa6314d6b..4fabbd6da6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -6,6 +6,7 @@ import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; import javax.swing.*; import java.awt.event.ActionEvent; @@ -19,7 +20,7 @@ public class VideoAction extends UpdateAction this.setMenuKeySet(VIDEO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png")); } From 045dcec0500d260abc97bdfe7c431c95014cc76b Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Wed, 5 Jun 2019 10:22:33 +0800 Subject: [PATCH 11/25] =?UTF-8?q?CHART-3647=20=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/designer/type/VanChartMapSourceChoosePane.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 5fa180ffe6..606f04dd13 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.map.designer.type; import com.fr.base.Parameter; import com.fr.base.Utils; +import com.fr.decision.webservice.v10.map.WMSFactory; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListPane; @@ -19,6 +20,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; +import com.fr.geojson.helper.GEOJSONHelper; import com.fr.plugin.chart.base.GisLayer; import com.fr.plugin.chart.base.ViewCenter; import com.fr.plugin.chart.map.VanChartMapPlot; @@ -26,9 +28,7 @@ import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.layer.WMSLayer; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; -import com.fr.geojson.helper.GEOJSONHelper; import com.fr.plugin.chart.map.server.MapLayerConfigManager; -import com.fr.plugin.chart.service.WMSFactory; import com.fr.plugin.chart.type.GISLayerType; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; @@ -57,6 +57,7 @@ import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.ArrayList; +import java.util.List; /** * Created by Mitisky on 16/5/11. @@ -392,7 +393,10 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { } String res = httpClient.getResponseText(); - list = WMSFactory.readLayers(res); + List layers = WMSFactory.readLayers(res); + for (String layer : layers) { + list.add(new WMSLayer(layer, false)); + } return null; } From 7fdcce6b04a20781f68c682668e89d7dd1f075f3 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Wed, 5 Jun 2019 10:36:12 +0800 Subject: [PATCH 12/25] fix list --- .../van/chart/map/designer/type/VanChartMapSourceChoosePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 606f04dd13..dab21dd62f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -394,6 +394,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { String res = httpClient.getResponseText(); List layers = WMSFactory.readLayers(res); + list.clear(); for (String layer : layers) { list.add(new WMSLayer(layer, false)); } From d69ecae6f14c228ac49181a61ae9cab68d662c0d Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Wed, 5 Jun 2019 15:30:10 +0800 Subject: [PATCH 13/25] CHART-9401 fix list --- .../chart/map/designer/type/VanChartMapSourceChoosePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index dab21dd62f..10664b3405 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -381,7 +381,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { public void actionPerformed(ActionEvent e) { new SwingWorker() { - private java.util.List list; + private java.util.List list = new ArrayList<>(); @Override protected Void doInBackground() throws Exception { From 2a9fcf77e653c8cf87f87ce262e020b6f4a099fd Mon Sep 17 00:00:00 2001 From: Hades Date: Thu, 6 Jun 2019 15:30:09 +0800 Subject: [PATCH 14/25] =?UTF-8?q?REPORT-17277=20frm=E7=9A=84body=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6=E4=B8=8D=E8=A7=81=E4=BA=86=20=20&&?= =?UTF-8?q?=20REPORT-17897=20=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=96=87=E4=BB=B6?= =?UTF-8?q?-=E9=80=89=E9=A1=B9=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=20=20&&=20REPORT-17873=20=E6=A8=A1=E6=9D=BF-=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7-=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=8C=89=E9=92=AE=E6=8F=90=E7=A4=BA=E6=A1=86=E7=9A=84?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 13 +++- .../fr/design/data/datapane/ChoosePane.java | 5 +- .../java/com/fr/design/dialog/BasicPane.java | 77 +++++-------------- .../layout/FRFitLayoutDefinePane.java | 3 +- 4 files changed, 33 insertions(+), 65 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index de7e342780..2a856f159d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -8,6 +8,7 @@ import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.DialogActionListener; import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; @@ -31,6 +32,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; +import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; import com.fr.locale.InterProviderFactory; @@ -79,6 +81,7 @@ public class PreferencePane extends BasicPane { private static final int CACHING_DEFAULT = 5; private static final int CACHING_GAP = 5; private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230; + private static final int OFFSET_HEIGHT = 50; private static final String TYPE = "pressed"; private static final String DISPLAY_TYPE = "+"; @@ -133,7 +136,6 @@ public class PreferencePane extends BasicPane { private UIComboBox logLevelComboBox, pageLengthComboBox, reportLengthComboBox; private UIDictionaryComboBox languageComboBox; private IntegerEditor portEditor; - private UITextField jdkHomeTextField; private UICheckBox oracleSpace; private UISpinner cachingTemplateSpinner; private UICheckBox openDebugComboBox; @@ -393,10 +395,10 @@ public class PreferencePane extends BasicPane { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color")); - gridLineColorTBButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); + gridLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); gridLineColorTBButton.setEnabled(this.isEnabled()); - paginationLineColorTBButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); + paginationLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); paginationLineColorTBButton.setEnabled(this.isEnabled()); JPanel leftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); @@ -790,4 +792,9 @@ public class PreferencePane extends BasicPane { } }); } + + @Override + public BasicDialog showWindow(Window window, DialogActionListener l) { + return showWindowWithCustomSize(window, l, new Dimension(BasicDialog.DEFAULT.width, this.getPreferredSize().height + OFFSET_HEIGHT)); + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 9ec67adb64..413a0f00d1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -32,6 +32,7 @@ import com.fr.design.mainframe.DesignerFrame; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.ConnectionConfig; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; @@ -331,7 +332,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha DBUtils.refreshDatabase(); String schema = StringUtils.isEmpty(schemaBox.getSelectedItem()) ? null : schemaBox.getSelectedItem(); DataCoreUtils.refreshTables(getConnection(), TableProcedure.TABLE, schema); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Refresh_Database"), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Database"), JOptionPane.INFORMATION_MESSAGE); } @@ -343,7 +344,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; Object userObj = node.getUserObject(); if (userObj instanceof String) { - this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_insert/expandCell.gif")); + this.setIcon(IOUtils.readIcon("com/fr/design/images/m_insert/expandCell.gif")); } else if (userObj instanceof TableProcedure) { this.setText(((TableProcedure) userObj).getName()); } diff --git a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java index c01daff70e..4809e536c6 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java @@ -40,21 +40,7 @@ public abstract class BasicPane extends JPanel { * @return 对话框 */ public BasicDialog showWindow(Window window, DialogActionListener l) { - BasicDialog dg; - if (window instanceof Frame) { - dg = new DIALOG((Frame) window); - } else { - dg = new DIALOG((Dialog) window); - } - - if (l != null) { - dg.addDialogActionListener(l); - } - - dg.setBasicDialogSize(BasicDialog.DEFAULT); - GUICoreUtils.centerWindow(dg); - dg.setResizable(false); - return dg; + return showWindowWithCustomSize(window, l, BasicDialog.DEFAULT); } /** @@ -100,21 +86,7 @@ public abstract class BasicPane extends JPanel { * @return 对话框 */ public BasicDialog showWindow4ChartType(Window window, DialogActionListener l) { - BasicDialog dg; - if (window instanceof Frame) { - dg = new DIALOG((Frame) window); - } else { - dg = new DIALOG((Dialog) window); - } - - if (l != null) { - dg.addDialogActionListener(l); - } - - dg.setBasicDialogSize(BasicDialog.CHART); - GUICoreUtils.centerWindow(dg); - dg.setResizable(false); - return dg; + return showWindowWithCustomSize(window, l, BasicDialog.CHART); } /** @@ -125,20 +97,7 @@ public abstract class BasicPane extends JPanel { * @return 对话框 */ public BasicDialog showSmallWindow(Window window, DialogActionListener l) { - BasicDialog dg; - if (window instanceof Frame) { - dg = new DIALOG((Frame) window); - } else { - dg = new DIALOG((Dialog) window); - } - - if (l != null) { - dg.addDialogActionListener(l); - } - dg.setBasicDialogSize(BasicDialog.SMALL); - GUICoreUtils.centerWindow(dg); - dg.setResizable(false); - return dg; + return showWindowWithCustomSize(window, l, BasicDialog.SMALL); } /** @@ -149,20 +108,7 @@ public abstract class BasicPane extends JPanel { * @return 对话框 */ public BasicDialog showMediumWindow(Window window, DialogActionListener l) { - BasicDialog dg; - if (window instanceof Frame) { - dg = new DIALOG((Frame) window); - } else { - dg = new DIALOG((Dialog) window); - } - - if (l != null) { - dg.addDialogActionListener(l); - } - dg.setBasicDialogSize(BasicDialog.MEDIUM); - GUICoreUtils.centerWindow(dg); - dg.setResizable(false); - return dg; + return showWindowWithCustomSize(window, l, BasicDialog.MEDIUM); } /** @@ -173,6 +119,17 @@ public abstract class BasicPane extends JPanel { * @return 对话框 */ public BasicDialog showLargeWindow(Window window, DialogActionListener l) { + return showWindowWithCustomSize(window, l, BasicDialog.LARGE); + } + + /** + * 以自定义的宽高显示窗口 + * @param window 窗口 + * @param l 对话框监听器 + * @param dimension 自定义尺寸 + * @return 对话框 + */ + protected BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) { BasicDialog dg; if (window instanceof Frame) { dg = new DIALOG((Frame) window); @@ -183,7 +140,7 @@ public abstract class BasicPane extends JPanel { if (l != null) { dg.addDialogActionListener(l); } - dg.setBasicDialogSize(BasicDialog.LARGE); + dg.setBasicDialogSize(dimension); GUICoreUtils.centerWindow(dg); dg.setResizable(false); return dg; @@ -350,6 +307,7 @@ public abstract class BasicPane extends JPanel { } } + @Override public void setVisible(boolean isVisible) { this.nameTextField.setVisible(isVisible); this.Name.setVisible(isVisible); @@ -377,6 +335,7 @@ public abstract class BasicPane extends JPanel { * * @throws Exception 异常 */ + @Override public void checkValid() throws Exception { super.checkValid(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index 04864c98a6..ff8ef4411f 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -195,7 +195,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { Component[] components = xWFitLayout.getComponents(); xWFitLayout.removeAll(); layout.resetStyle(); - XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); + XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent(); xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); for (Component component : components) { XCreator xCreator = (XCreator) component; @@ -208,6 +208,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { } xwAbsoluteBodyLayout.add(component); } + xWFitLayout.setBackupParent(xwAbsoluteBodyLayout); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().setSelectedCreators( FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{wAbsoluteBodyLayout})); From d2d97234a366a5fd37b95cca0dd1075f1ddbd248 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 10 Jun 2019 13:34:25 +0800 Subject: [PATCH 15/25] =?UTF-8?q?REPORT-17887=20=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=9C=80=E5=A4=A7=E5=80=BC=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E5=80=BC=E9=83=A8=E5=88=86=E5=9C=BA=E6=99=AF=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/NumberEditorValidatePane.java | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java index 78accb96b3..42bcfae0aa 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -9,13 +9,15 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.NumberEditor; - import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -23,6 +25,7 @@ import java.awt.event.ActionListener; * Created by kerry on 2017/9/10. */ public class NumberEditorValidatePane extends JPanel { + private UICheckBox allowDecimalsCheckBox; private UICheckBox allowNegativeCheckBox; private UICheckBox setMaxValueCheckBox; @@ -104,6 +107,7 @@ public class NumberEditorValidatePane extends JPanel { private void initListeners() { allowDecimalsListener = new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (allowDecimalsCheckBox.isSelected()) { limitNumberPane.setVisible(true); @@ -129,8 +133,8 @@ public class NumberEditorValidatePane extends JPanel { if (!setMinValueCheckBox.isSelected()) { maxValueSpinner.getTextField().setMinValue(0.0); } - Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); - Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); + double minValue = Double.parseDouble("" + minValueSpinner.getValue()); + double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); if (minValue < 0.0) { minValueSpinner.setValue(0.0); } @@ -143,10 +147,11 @@ public class NumberEditorValidatePane extends JPanel { setMaxListener = new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); - Double value = new Double(0); + Double value = (double) 0; if (setMinValueCheckBox.isSelected()) { Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); if (minValue > value) { @@ -163,10 +168,11 @@ public class NumberEditorValidatePane extends JPanel { setMinListener = new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); - Double value = new Double(0); + Double value = (double) 0; if (setMaxValueCheckBox.isSelected()) { Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); if (maxValue < value) { @@ -177,7 +183,7 @@ public class NumberEditorValidatePane extends JPanel { maxValueSpinner.getTextField().setMinValue(value); } else { minValueSpinner.setEnabled(false); - maxValueSpinner.getTextField().setMinValue(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0)); + maxValueSpinner.getTextField().setMinValue(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : (double) 0); } } }; @@ -222,28 +228,28 @@ public class NumberEditorValidatePane extends JPanel { allowNegativeCheckBox.setSelected(e.isAllowNegative()); if (e.getMaxValue() == Double.MAX_VALUE) { setMaxValueCheckBox.setSelected(false); - maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); + maxValueSpinner.setValue(Double.MAX_VALUE); maxValueSpinner.setEnabled(false); } else { setMaxValueCheckBox.setSelected(true); maxValueSpinner.setEnabled(true); - maxValueSpinner.setValue(new Double(e.getMaxValue())); + maxValueSpinner.setValue(e.getMaxValue()); } if (e.getMinValue() == -Double.MAX_VALUE) { setMinValueCheckBox.setSelected(false); - minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); + minValueSpinner.setValue(-Double.MAX_VALUE); minValueSpinner.setEnabled(false); } else { setMinValueCheckBox.setSelected(true); minValueSpinner.setEnabled(true); - minValueSpinner.setValue(new Double(e.getMinValue())); + minValueSpinner.setValue(e.getMinValue()); } - if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){ + if (setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()) { errorMsgTextFieldPane.setVisible(true); errorMsgTextField.setText(e.getRegErrorMessage()); - }else{ + } else { errorMsgTextFieldPane.setVisible(false); errorMsgTextField.setText(StringUtils.EMPTY); } @@ -259,15 +265,19 @@ public class NumberEditorValidatePane extends JPanel { if (setMinValueCheckBox.isSelected()) { ob.setMinValue(minValueSpinner.getValue()); + } else { + ob.setMinValue(-Double.MAX_VALUE); } if (setMaxValueCheckBox.isSelected()) { ob.setMaxValue(maxValueSpinner.getValue()); + } else { + ob.setMaxValue(Double.MAX_VALUE); } - if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){ + if (setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()) { errorMsgTextFieldPane.setVisible(true); - }else{ + } else { errorMsgTextFieldPane.setVisible(false); errorMsgTextField.setText(StringUtils.EMPTY); } From 6a7d8824b2d434746a68c4ec7ce0a52447496e05 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 11 Jun 2019 13:45:26 +0800 Subject: [PATCH 16/25] =?UTF-8?q?REPORT-17908=20=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E2=80=9C=E5=88=9D=E5=A7=8B=E5=8C=96=E2=80=9D?= =?UTF-8?q?=E7=9A=84=E5=9B=BD=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/start/SplashContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 441bf0f607..0c3199e417 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -26,6 +26,7 @@ public class SplashContext { public static final String SPLASH_PATH = getSplashPath(); public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1); private static final int FETCH_ONLINE_MAX_TIMES = 50; + private static final String THANKS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Thanks_To"); private static final SplashContext SPLASH_CONTEXT = new SplashContext(); @@ -147,7 +148,7 @@ public class SplashContext { if (shouldShowThanks()) { tryFetchOnline(); if (StringUtils.isNotEmpty(guest)) { - updateThanksLog(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Thanks_To") + guest); + updateThanksLog(THANKS + guest); } } } From 7d57de3d84bd3c97c2febae68a881e154d93a900 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 11 Jun 2019 13:59:34 +0800 Subject: [PATCH 17/25] update --- designer-realize/src/main/java/com/fr/start/SplashContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 0c3199e417..87a4237e0d 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,6 +1,7 @@ package com.fr.start; import com.fr.design.DesignerEnvManager; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -26,7 +27,7 @@ public class SplashContext { public static final String SPLASH_PATH = getSplashPath(); public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1); private static final int FETCH_ONLINE_MAX_TIMES = 50; - private static final String THANKS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Thanks_To"); + private static final String THANKS = Toolkit.i18nText("Fine-Design_Report_Thanks_To"); private static final SplashContext SPLASH_CONTEXT = new SplashContext(); From 24f2f13bf442eb53d19938dd21716a509a24b1b2 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Mon, 17 Jun 2019 15:11:57 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8D=E6=97=B6=E7=94=A8uuid=E4=BD=9C=E4=B8=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/messagecollect/entity/FileEntityBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java index c8ac3b32c0..28d6322c5b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java @@ -109,7 +109,7 @@ public class FileEntityBuilder { String filePath = FOCUS_POINT_FILE_ROOT_PATH + CoreConstants.SEPARATOR + today + CoreConstants.SEPARATOR + keyFileName; String bbsUserName = MarketConfig.getInstance().getBbsUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); - String name = bbsUserName == null ? uuid : bbsUserName; + String name = StringUtils.isEmpty(bbsUserName) ? uuid : bbsUserName; client.uploadFile(file, filePath, name, FILE_FROM); addMessageQueue(filePath, bbsUserName, uuid); From 3cf0d45159f5370dd9e5ce6bb0e882f65edf8c80 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Jun 2019 09:30:53 +0800 Subject: [PATCH 19/25] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B9=B1=E7=A0=81?= =?UTF-8?q?=E5=92=8C=E5=85=A5=E5=BA=93=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/FileEntityBuilder.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java index 28d6322c5b..4497a0b28f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java @@ -2,12 +2,9 @@ package com.fr.design.mainframe.messagecollect.entity; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; -import com.fr.general.CloudCenter; import com.fr.general.CloudClient; import com.fr.general.IOUtils; -import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; -import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; import com.fr.stable.CoreConstants; @@ -22,7 +19,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; -import java.util.HashMap; import java.util.UUID; /** @@ -32,11 +28,7 @@ import java.util.UUID; public class FileEntityBuilder { private static final String FOCUS_POINT_FILE_ROOT_PATH = "FocusPoint"; - private static final String FOCUS_POINT_FILE_UPLOAD_TOPIC = "__fine_intelli_file_upload__"; private static final String FILE_FROM = "design"; - private static final String FOCUS_POINT_FILE_UPLOAD_TYPE = "FocusPoint"; - private static final String FOCUS_POINT_FILE_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.feedback"); - private static final String FOCUS_POINT_URL_KEY = "focuspoint"; /** * 文件夹路径 @@ -111,27 +103,6 @@ public class FileEntityBuilder { String uuid = DesignerEnvManager.getEnvManager().getUUID(); String name = StringUtils.isEmpty(bbsUserName) ? uuid : bbsUserName; - client.uploadFile(file, filePath, name, FILE_FROM); - addMessageQueue(filePath, bbsUserName, uuid); - } - - private static void addMessageQueue(String filePath, String userName, String uuid) { - JSONObject uploadInfo = new JSONObject(FOCUS_POINT_FILE_UPLOAD_URL); - String focusPointUrl = uploadInfo.optString(FOCUS_POINT_URL_KEY); - try { - HashMap params = new HashMap<>(); - params.put("topic", FOCUS_POINT_FILE_UPLOAD_TOPIC); - params.put("username", URLEncoder.encode(userName, EncodeConstants.ENCODING_UTF_8)); - params.put("uuid", uuid); - params.put("filepath", filePath); - params.put("timestamp", String.valueOf(System.currentTimeMillis())); - params.put("signature", String.valueOf(CommonUtils.signature())); - params.put("type", FOCUS_POINT_FILE_UPLOAD_TYPE); - if(StringUtils.isNotEmpty(focusPointUrl)){ - HttpToolbox.post(focusPointUrl, params); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + client.uploadFile(file, filePath, URLEncoder.encode(name, EncodeConstants.ENCODING_UTF_8), FILE_FROM); } } From a98259b93025cff9fcc6d8f8948b9c0e889de5e9 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 21 Jun 2019 16:20:51 +0800 Subject: [PATCH 20/25] =?UTF-8?q?=E5=B0=86=E6=89=80=E6=9C=89=E6=B5=B7?= =?UTF-8?q?=E5=A4=96=E7=89=88=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=9B=9E=E4=BC=A0=E5=8A=9F=E8=83=BD=E9=98=89=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index dcc588fa35..b50f38b73d 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -688,7 +688,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * @return 是否加入产品改良 */ public boolean isJoinProductImprove() { - return joinProductImprove; + return Locale.CHINA.equals(GeneralContext.getLocale()) && this.joinProductImprove; } /** From 4e218c7456bb1ab10da554b9d0bdb66eca8469dc Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 25 Jun 2019 10:08:53 +0800 Subject: [PATCH 21/25] =?UTF-8?q?KERNEL-582=20=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BC=9A=E8=B6=8A?= =?UTF-8?q?=E6=9D=A5=E8=B6=8A=E5=A4=9A=EF=BC=8C=E6=83=B3=E5=8A=9E=E6=B3=95?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=BF=99=E7=A7=8Dif=20else=E5=86=99=E6=B3=95?= =?UTF-8?q?=20&&=20REPORT-18522=20=E5=B0=86=E6=89=80=E6=9C=89=E6=B5=B7?= =?UTF-8?q?=E5=A4=96=E7=89=88=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=9B=9E=E4=BC=A0=E5=8A=9F=E8=83=BD=E9=98=89=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 6 +++- .../design/actions/community/VideoAction.java | 18 ++++------ .../locale/impl/ProductImproveMark.java | 31 ++++++++++++++++ .../com/fr/design/locale/impl/SplashMark.java | 35 ++++++++++++++++++ .../fr/design/locale/impl/UserInfoMark.java | 36 +++++++++++++++++++ .../com/fr/design/locale/impl/VideoMark.java | 35 ++++++++++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 27 +++++++++----- .../start/CollectUserInformationDialog.java | 22 +++--------- .../main/java/com/fr/start/SplashContext.java | 14 +++----- 9 files changed, 176 insertions(+), 48 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/ProductImproveMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index b50f38b73d..7370d4d55d 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -14,6 +14,7 @@ import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.update.push.DesignerPushUpdateConfigManager; import com.fr.design.style.color.ColorSelectConfigManager; @@ -23,6 +24,8 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRLogFormatter; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.general.xml.GeneralXMLTools; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; @@ -688,7 +691,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * @return 是否加入产品改良 */ public boolean isJoinProductImprove() { - return Locale.CHINA.equals(GeneralContext.getLocale()) && this.joinProductImprove; + LocaleMark localeMark = LocaleCenter.getMark(ProductImproveMark.class); + return localeMark.getValue() && this.joinProductImprove; } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 4fabbd6da6..f3cb21bc70 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,16 +1,16 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; +import com.fr.design.locale.impl.VideoMark; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import javax.swing.*; import java.awt.event.ActionEvent; -import java.util.Locale; + public class VideoAction extends UpdateAction { @@ -27,14 +27,8 @@ public class VideoAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url; - if (GeneralContext.getLocale().equals(Locale.US)) { - url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); - } else { - url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); - } - BrowseUtils.browser(url); - + LocaleMark localeMark = LocaleCenter.getMark(VideoMark.class); + BrowseUtils.browser(localeMark.getValue()); } public static final MenuKeySet VIDEO = new MenuKeySet() { @Override diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/ProductImproveMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/ProductImproveMark.java new file mode 100644 index 0000000000..b7a05975cb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/ProductImproveMark.java @@ -0,0 +1,31 @@ +package com.fr.design.locale.impl; + +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author Hades + * @date 2019/6/24 + */ +public class ProductImproveMark implements LocaleMark { + + private Map map = new HashMap<>(); + + public ProductImproveMark() { + map.put(Locale.CHINA, true); + map.put(Locale.TAIWAN, false); + map.put(Locale.US, false); + map.put(Locale.KOREA, false); + map.put(Locale.JAPAN, false); + } + + @Override + public Boolean getValue() { + Boolean result = map.get(GeneralContext.getLocale()); + return result == null ? false : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java new file mode 100644 index 0000000000..790108978f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java @@ -0,0 +1,35 @@ +package com.fr.design.locale.impl; + +import com.fr.design.DesignerEnvManager; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author Hades + * @date 2019/6/24 + */ +public class SplashMark implements LocaleMark { + + private Map map = new HashMap(); + private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; + private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_10_en.gif"; + private static final String SPLASH_JP_PATH = "/com/fr/design/images/splash_10_jp.gif"; + + public SplashMark() { + map.put(Locale.CHINA, SPLASH_PATH); + map.put(Locale.KOREA, SPLASH_EN_PATH); + map.put(Locale.JAPAN, SPLASH_JP_PATH); + map.put(Locale.US, SPLASH_EN_PATH); + map.put(Locale.TAIWAN, SPLASH_EN_PATH); + } + + @Override + public String getValue() { + String result = map.get(DesignerEnvManager.getEnvManager().getLanguage()); + return result == null ? SPLASH_EN_PATH : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java new file mode 100644 index 0000000000..3739c49f6a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java @@ -0,0 +1,36 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author Hades + * @date 2019/6/24 + */ +public class UserInfoMark implements LocaleMark { + + private Map map = new HashMap<>(); + private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); + private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); + private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); + private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); + + public UserInfoMark() { + map.put(Locale.CHINA, CN_LOGIN_HTML); + map.put(Locale.KOREA, EN_LOGIN_HTML); + map.put(Locale.JAPAN, JP_LOGIN_HTML); + map.put(Locale.US, EN_LOGIN_HTML); + map.put(Locale.TAIWAN, TW_LOGIN_HTML); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? EN_LOGIN_HTML : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java new file mode 100644 index 0000000000..2071faba3f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java @@ -0,0 +1,35 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author Hades + * @date 2019/6/24 + */ +public class VideoMark implements LocaleMark { + + private Map map = new HashMap<>(); + private static final String VIDEO_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); + private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); + private static final String VIDEO_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.video.tw"); + + public VideoMark() { + map.put(Locale.CHINA, VIDEO_CN); + map.put(Locale.KOREA, VIDEO_EN); + map.put(Locale.JAPAN, VIDEO_EN); + map.put(Locale.US, VIDEO_EN); + map.put(Locale.TAIWAN, VIDEO_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? VIDEO_EN : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 7e0d6b3597..bd7bd0a2ad 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -58,6 +58,9 @@ import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.utils.ThemeUtils; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleAction; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.impl.SupportLocaleImpl; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; @@ -240,7 +243,7 @@ public abstract class ToolBarMenuDock { public MenuDef[] menus(final ToolBarMenuDockPlus plus) { //删除之前创建的插件菜单监听 clearPluginListeners(); - java.util.List menuList = new java.util.ArrayList(); + final java.util.List menuList = new java.util.ArrayList(); // 添加文件菜单 menuList.add(createFileMenuDef(plus)); @@ -258,10 +261,13 @@ public abstract class ToolBarMenuDock { // 添加帮助菜单 menuList.add(createHelpMenuDef()); - if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)) { - // 添加社区菜单 - addCommunityMenuDef(menuList); - } + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + addCommunityMenuDef(menuList); + } + }, SupportLocaleImpl.COMMUNITY); + // 添加全部UpdateAction到actionmanager中 addAllUpdateActionsToList(menuList); @@ -532,7 +538,7 @@ public abstract class ToolBarMenuDock { * @return 社区菜单的子菜单 */ public ShortCut[] createCommunityShortCuts() { - java.util.List shortCuts = new ArrayList(); + final java.util.List shortCuts = new ArrayList(); shortCuts.add(new BBSAction()); shortCuts.add(new VideoAction()); shortCuts.add(new TutorialAction()); @@ -543,9 +549,12 @@ public abstract class ToolBarMenuDock { shortCuts.add(new CusDemandAction()); shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); - if (Locale.TAIWAN.equals(GeneralContext.getLocale())) { - shortCuts.add(new FacebookFansAction()); - } + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new FacebookFansAction()); + } + }, SupportLocaleImpl.FACEBOOK); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } diff --git a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java index c32c2307d2..139030642c 100644 --- a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java @@ -8,11 +8,14 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.DescriptionTextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.locale.impl.UserInfoMark; import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import javax.swing.*; import javax.swing.border.TitledBorder; @@ -31,11 +34,6 @@ public class CollectUserInformationDialog extends UIDialog { private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; - private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); - private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); - private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); - private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); - private UITextField keyTextField; private ActionListener actionListener = new ActionListener() { @@ -129,19 +127,9 @@ public class CollectUserInformationDialog extends UIDialog { private void getKeyAction() { - Locale locale = GeneralContext.getLocale(); - String url = EN_LOGIN_HTML; - if (ComparatorUtils.equals(locale, Locale.TAIWAN)) { - url = TW_LOGIN_HTML; - } - if (ComparatorUtils.equals(locale, Locale.CHINA)) { - url = CN_LOGIN_HTML; - } - if (ComparatorUtils.equals(locale, Locale.JAPAN)) { - url = JP_LOGIN_HTML; - } + LocaleMark localeMark = LocaleCenter.getMark(UserInfoMark.class); try { - Desktop.getDesktop().browse(new URI(url)); + Desktop.getDesktop().browse(new URI(localeMark.getValue())); } catch (Exception ignored) { } diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 87a4237e0d..ab358e8d71 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,12 +1,14 @@ package com.fr.start; -import com.fr.design.DesignerEnvManager; import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.SplashMark; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.module.ModuleEvent; import com.fr.stable.StringUtils; @@ -168,13 +170,7 @@ public class SplashContext { } private static String getSplashPath() { - Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); - if (Locale.US.equals(locale) || Locale.KOREA.equals(locale) || Locale.TAIWAN.equals(locale)) { - return "/com/fr/design/images/splash_10_en.gif"; - } else if (Locale.JAPAN.equals(locale)) { - return "/com/fr/design/images/splash_10_jp.gif"; - } else { - return "/com/fr/design/images/splash_10.gif"; - } + LocaleMark localeMark = LocaleCenter.getMark(SplashMark.class); + return localeMark.getValue(); } } \ No newline at end of file From 70184cdb0fae354577424e76f6d8c00a4b979649 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 25 Jun 2019 10:46:03 +0800 Subject: [PATCH 22/25] update --- .../design/locale/impl/SupportLocaleImpl.java | 44 +++++++++++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java new file mode 100644 index 0000000000..61de25937c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -0,0 +1,44 @@ +package com.fr.design.locale.impl; + +import com.fr.general.locale.SupportLocale; + +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; + +/** + * 某些国际化环境支持的操作 + * 需要增加/删除支持的语言 统一在这里修改 无须改动业务代码 + * 后续有新的不同语言下的差异操作 添加新的枚举 + * @author Hades + * @date 2019/6/24 + */ +public enum SupportLocaleImpl implements SupportLocale { + + /** + * 社区菜单支持的国际化环境 + */ + COMMUNITY { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.CHINA); + set.add(Locale.TAIWAN); + return set; + } + }, + + /** + * Facebook支持的国际化环境 + */ + FACEBOOK { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.TAIWAN); + return set; + } + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index bd7bd0a2ad..8a739f54f1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -60,7 +60,7 @@ import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.locale.LocaleAction; import com.fr.general.locale.LocaleCenter; -import com.fr.general.locale.impl.SupportLocaleImpl; +import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; From 8ea122559a1a0a3c34209ce7fe3c8ae8ab21e303 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 25 Jun 2019 18:24:06 +0800 Subject: [PATCH 23/25] ct --- .../main/java/com/fr/start/SplashContext.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 8ae77ee090..e45eee48f1 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,12 +1,15 @@ package com.fr.start; import com.fr.concurrent.NamedThreadFactory; -import com.fr.design.DesignerEnvManager; +import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.SplashMark; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.module.ModuleEvent; import com.fr.stable.StringUtils; @@ -27,6 +30,7 @@ public class SplashContext { public static final String SPLASH_PATH = getSplashPath(); public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1); private static final int FETCH_ONLINE_MAX_TIMES = 50; + private static final String THANKS = Toolkit.i18nText("Fine-Design_Report_Thanks_To"); private static final SplashContext SPLASH_CONTEXT = new SplashContext(); @@ -148,7 +152,7 @@ public class SplashContext { if (shouldShowThanks()) { tryFetchOnline(); if (StringUtils.isNotEmpty(guest)) { - updateThanksLog(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Thanks_To") + guest); + updateThanksLog(THANKS + guest); } } } @@ -167,13 +171,7 @@ public class SplashContext { } private static String getSplashPath() { - Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); - if (Locale.US.equals(locale) || Locale.KOREA.equals(locale) || Locale.TAIWAN.equals(locale)) { - return "/com/fr/design/images/splash_10_en.gif"; - } else if (Locale.JAPAN.equals(locale)) { - return "/com/fr/design/images/splash_10_jp.gif"; - } else { - return "/com/fr/design/images/splash_10.gif"; - } + LocaleMark localeMark = LocaleCenter.getMark(SplashMark.class); + return localeMark.getValue(); } -} +} \ No newline at end of file From 210d02fc79f54fdb8742f48239194bc7af331f3d Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 25 Jun 2019 18:25:19 +0800 Subject: [PATCH 24/25] ct --- .../constants/DesignerLaunchStatus.java | 34 +++++++++++++++++++ .../main/java/com/fr/start/SplashContext.java | 1 - 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java diff --git a/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java b/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java new file mode 100644 index 0000000000..d62a84f786 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java @@ -0,0 +1,34 @@ +package com.fr.design.constants; + +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Null; + +/** + * 设计器启动事件类型 + * + * @author vito + * @date 2019-06-18 + */ +public enum DesignerLaunchStatus implements Event { + /** + * 初始化环境完成 + */ + WORKSPACE_INIT_COMPLETE, + + /** + * 设计器模块启动完成 + */ + DESIGNER_INIT_COMPLETE; + + private static DesignerLaunchStatus status; + + public static DesignerLaunchStatus getStatus() { + return status; + } + + public static void setStatus(DesignerLaunchStatus state) { + status = state; + EventDispatcher.fire(DesignerLaunchStatus.getStatus()); + } +} diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index e45eee48f1..7c5e208bc3 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,6 +1,5 @@ package com.fr.start; -import com.fr.concurrent.NamedThreadFactory; import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.SplashMark; import com.fr.design.mainframe.bbs.BBSConstants; From e19197474d4639bff2aab648590a2b49ae67c5bb Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 25 Jun 2019 18:27:53 +0800 Subject: [PATCH 25/25] ct --- designer-realize/src/main/java/com/fr/start/SplashContext.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index 7c5e208bc3..e45eee48f1 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.concurrent.NamedThreadFactory; import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.SplashMark; import com.fr.design.mainframe.bbs.BBSConstants;