From 4ef4c4879589597d802cff088662de3376bf20ed Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 28 Jul 2020 10:04:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85=E5=8C=96-?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87=EF=BC=8C=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 +++++ .../fr/start/server/FineEmbedServerMonitor.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index e416083f73..6d10b48e56 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,4 +96,9 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } + + public void updateLoadingText(String text, FRFont font) { + this.text.setFont(font); + this.text.setText(text); + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 0783721832..6bab19fded 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,7 +7,11 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.FRFont; +import com.fr.general.GeneralContext; +import javax.swing.plaf.ColorUIResource; +import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -86,8 +90,14 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - DesignerContext.getDesignerFrame().getProgressDialog() - .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); + String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + //如果为韩文则改变字体 + if (GeneralContext.getLocale().equals(Locale.KOREA)) { + FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); + } else { + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); + } } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 6a9e3db2f178904d6e0de4508d3229d6917ff49b Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 28 Jul 2020 16:11:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85=E5=8C=96-?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87=EF=BC=8C=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/iprogressbar/ProgressDialog.java | 4 ++- .../design/locale/impl/SupportLocaleImpl.java | 13 +++++++++- .../start/server/FineEmbedServerMonitor.java | 26 ++++++++++++------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 6d10b48e56..29214984c3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -98,7 +98,9 @@ public class ProgressDialog extends UIDialog { } public void updateLoadingText(String text, FRFont font) { - this.text.setFont(font); + if (font != null) { + this.text.setFont(font); + } this.text.setText(text); } } 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 index 61de25937c..c6c1b1f280 100644 --- 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 @@ -38,7 +38,18 @@ public enum SupportLocaleImpl implements SupportLocale { set.add(Locale.TAIWAN); return set; } - } + }, + /** + * 支持韩文 + */ + SUPPORT_KOREA { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.KOREA); + return set; + } + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 6bab19fded..7e95c48d27 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -2,16 +2,18 @@ package com.fr.start.server; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.gui.iprogressbar.ProgressDialog; +import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleAction; +import com.fr.general.locale.LocaleCenter; import javax.swing.plaf.ColorUIResource; -import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -31,6 +33,11 @@ public class FineEmbedServerMonitor { private static final int STEP_HEARTBEAT = 40; private static volatile FineEmbedServerMonitor monitor; private static ProgressDialog progressBar = DesignerContext.getDesignerFrame().getProgressDialog(); + //由于默认值的字体不支持韩文,所以要对韩文单独生成字体 + private FRFont font = null; + private static final int FONT_RGB = 333334; + private static final int FONT_SIZE = 14; + private static final String FONT_NAME = "Dialog"; private FineEmbedServerMonitor() { } @@ -90,14 +97,15 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); //如果为韩文则改变字体 - if (GeneralContext.getLocale().equals(Locale.KOREA)) { - FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); - } else { - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); - } + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + font = FRFont.getInstance().applySize(FONT_SIZE).applyForeground(new ColorUIResource(FONT_RGB)).applyName(FONT_NAME); + } + }, SupportLocaleImpl.SUPPORT_KOREA); + String text = Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); } DesignerContext.getDesignerFrame().updateProgress(getProgress()); }