From f0b03de062cecc49182128667000d2ef6e35b323 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Fri, 4 Jun 2021 14:53:19 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-53019=20=E5=AD=97=E4=BD=93=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/check/CheckButton.java | 33 +++++-------------- .../mainframe/check/CheckFontInfoDialog.java | 25 +++----------- .../fr/design/i18n/dimension_en.properties | 4 +++ .../fr/design/i18n/dimension_ja_JP.properties | 4 +++ .../fr/design/i18n/dimension_ko_KR.properties | 4 +++ .../fr/design/i18n/dimension_zh.properties | 4 +++ .../fr/design/i18n/dimension_zh_TW.properties | 4 +++ 7 files changed, 34 insertions(+), 44 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java index b2fc99359..7757ea2f4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java @@ -4,13 +4,14 @@ import com.fr.base.BaseUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; -import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; @@ -22,13 +23,11 @@ import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; -import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.util.Locale; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -42,7 +41,7 @@ public class CheckButton extends UIButton { private UILabel message; private UIButton okButton; private JDialog dialog; - private UILabel uiLabel; + private UILabel imageLabel; public CheckButton() { this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png")); @@ -73,7 +72,7 @@ public class CheckButton extends UIButton { } if (set.isEmpty()) { okButton.setEnabled(true); - uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); + imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); message.setText("" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + ""); } else { if (dialog != null) { @@ -163,7 +162,6 @@ public class CheckButton extends UIButton { }); checkThread.execute(); dialog.setVisible(true); - dialog.dispose(); } }; @@ -173,7 +171,7 @@ public class CheckButton extends UIButton { @Override public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { - uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); + imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); message.setText("" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + ""); okButton.setEnabled(true); return null; @@ -185,7 +183,7 @@ public class CheckButton extends UIButton { private void initDialogPane() { message = new UILabel(); message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "..."); - uiLabel = new UILabel(); + imageLabel = new UILabel(); okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); okButton.setEnabled(false); okButton.addActionListener(new ActionListener() { @@ -196,13 +194,13 @@ public class CheckButton extends UIButton { dialog = new JDialog(); dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font")); dialog.setModal(true); - dialog.setSize(new Dimension(getDialogWidth(), 118)); + dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName())); JPanel jp = new JPanel(); JPanel upPane = new JPanel(); JPanel downPane = new JPanel(); - uiLabel = new UILabel(BaseUtils.readIcon("com/fr/design/images/waiting.png")); + imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png")); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); - upPane.add(uiLabel); + upPane.add(imageLabel); upPane.add(message); downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); downPane.add(okButton); @@ -213,17 +211,4 @@ public class CheckButton extends UIButton { dialog.setResizable(false); dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); } - - private int getDialogWidth() { - Locale locale = GeneralContext.getLocale(); - if (locale.equals(Locale.US)) { - return 305; - } else if (locale.equals(Locale.JAPAN)) { - return 280; - } else if (locale.equals(Locale.KOREA)) { - return 230; - } else { - return 250; - } - } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java index 752bf12a5..0671ed1b6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java @@ -3,11 +3,11 @@ package com.fr.design.mainframe.check; import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import javax.swing.BorderFactory; @@ -17,13 +17,11 @@ import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.UIManager; import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.Locale; /** * 字体缺失检测的具体结果对话框 @@ -52,7 +50,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"), Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"), CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html")); - linkMessage.setPreferredSize(new Dimension(getPaneWidth(), 31)); + linkMessage.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink")); messagePanel.add(linkMessage); // 查看详情按钮 @@ -89,11 +87,11 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { public void mouseClicked(MouseEvent e) { if (hiddenPanel.isVisible()) { hiddenPanel.setVisible(false); - CheckFontInfoDialog.this.setSize(new Dimension(getPaneWidth(), 185)); + CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); } else { - CheckFontInfoDialog.this.setSize(new Dimension(getPaneWidth(), 280)); + CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.unfold")); hiddenPanel.setVisible(true); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); @@ -114,24 +112,11 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { this.add(topPanel, BorderLayout.NORTH); this.add(hiddenPanel, BorderLayout.CENTER); this.add(bottomPanel, BorderLayout.SOUTH); - this.setSize(new Dimension(getPaneWidth(), 185)); + this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse")); GUICoreUtils.centerWindow(this); } - private int getPaneWidth() { - Locale locale = GeneralContext.getLocale(); - if (locale.equals(Locale.US)) { - return 630; - } else if (locale.equals(Locale.JAPAN)) { - return 610; - } else if (locale.equals(Locale.KOREA)) { - return 490; - } else { - return 385; - } - } - @Override public void actionPerformed(ActionEvent e) { this.dispose(); diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index 1cafa6d35..23abf1ba4 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -1 +1,5 @@ +com.fr.design.mainframe.check.CheckButton=305*118 +com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185 +com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=630*31 +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280 com.fr.design.report.ReportColumnsPane=800*600 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index e69de29bb..97c7a38b6 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -0,0 +1,4 @@ +com.fr.design.mainframe.check.CheckButton=280*118 +com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185 +com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=610*31 +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index e69de29bb..4ebb3e1ed 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -0,0 +1,4 @@ +com.fr.design.mainframe.check.CheckButton=230*118 +com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185 +com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*31 +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 69c2fcef4..85eb5c552 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -1 +1,5 @@ # \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height +com.fr.design.mainframe.check.CheckButton=250*118 +com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185 +com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31 +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index e69de29bb..d6bdbbc64 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -0,0 +1,4 @@ +com.fr.design.mainframe.check.CheckButton=250*118 +com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185 +com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31 +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 \ No newline at end of file