Browse Source

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

zheng-1641779399395
Bruce.Deng 4 years ago
parent
commit
fb3a33186e
  1. 17
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  2. 21
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

17
designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java

@ -10,6 +10,7 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralContext;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler; import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.rpc.RPCInvokerExceptionInfo;
@ -27,6 +28,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
@ -194,7 +196,7 @@ public class CheckButton extends UIButton {
dialog = new JDialog(); dialog = new JDialog();
dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font")); dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font"));
dialog.setModal(true); dialog.setModal(true);
dialog.setSize(new Dimension(268, 118)); dialog.setSize(new Dimension(getDialogWidth(), 118));
JPanel jp = new JPanel(); JPanel jp = new JPanel();
JPanel upPane = new JPanel(); JPanel upPane = new JPanel();
JPanel downPane = new JPanel(); JPanel downPane = new JPanel();
@ -211,4 +213,17 @@ public class CheckButton extends UIButton {
dialog.setResizable(false); dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); 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;
}
}
} }

21
designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

@ -52,7 +52,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"), MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"),
Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"), Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"),
CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html")); CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html"));
linkMessage.setPreferredSize(new Dimension(380, 31)); linkMessage.setPreferredSize(new Dimension(getPaneWidth(), 31));
messagePanel.add(linkMessage); messagePanel.add(linkMessage);
// 查看详情按钮 // 查看详情按钮
@ -89,11 +89,11 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (hiddenPanel.isVisible()) { if (hiddenPanel.isVisible()) {
hiddenPanel.setVisible(false); hiddenPanel.setVisible(false);
CheckFontInfoDialog.this.setSize(new Dimension(380, 185)); CheckFontInfoDialog.this.setSize(new Dimension(getPaneWidth(), 185));
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
} else { } else {
CheckFontInfoDialog.this.setSize(new Dimension(380, 280)); CheckFontInfoDialog.this.setSize(new Dimension(getPaneWidth(), 280));
hiddenPanel.setVisible(true); hiddenPanel.setVisible(true);
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down"));
@ -114,11 +114,24 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
this.add(topPanel, BorderLayout.NORTH); this.add(topPanel, BorderLayout.NORTH);
this.add(hiddenPanel, BorderLayout.CENTER); this.add(hiddenPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH); this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 400:380, 185)); this.setSize(new Dimension(getPaneWidth(), 185));
GUICoreUtils.centerWindow(this); 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 @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
this.dispose(); this.dispose();

Loading…
Cancel
Save