Browse Source

REPORT-53019 字体检查国际化显示不全

zheng-1641779399395
Bruce.Deng 3 years ago
parent
commit
f0b03de062
  1. 33
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  2. 25
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  3. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  4. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  5. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  6. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  7. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

33
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("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>");
} 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("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>");
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;
}
}
}

25
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();

4
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

4
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

4
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

4
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

4
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
Loading…
Cancel
Save