Browse Source

Pull request #10202: REPORT-80251 英文设计器国际化显示问题

Merge in DESIGN/design from ~LEVY.XIE/design:release/11.0 to release/11.0

* commit '747f3518dc26edd85ebf5787388dfa75a5ba5bcf':
  REPORT-80251 英文设计器国际化显示问题 【问题原因】1、部分功能模块的label显示文字未做自动换行设置。2、开始界面右键弹出框宽度被固定,未考虑不同语言的适配问题。 【改动思路】1、更改label为自动换行。2、局部微调UI(横排组件变竖排,已与产品沟通无问题)。3、根据当前语言环境确定右键弹出框宽度。 【Review建议】
  REPORT-80251 英文设计器国际化显示问题 【问题原因】1、部分功能模块的label显示文字未做自动换行设置。2、开始界面右键弹出框宽度被固定,未考虑不同语言的适配问题。 【改动思路】1、更改label为自动换行。2、局部微调UI(横排组件变竖排,已与产品沟通无问题)。3、根据当前语言环境确定右键弹出框宽度。 【Review建议】
  REPORT-80251 英文设计器国际化显示问题 【问题原因】1、部分功能模块的label显示文字未做自动换行设置。2、开始界面右键弹出框宽度被固定,未考虑不同语言的适配问题。 【改动思路】1、更改label为自动换行。2、局部微调UI(横排组件变竖排,已与产品沟通无问题)。3、根据当前语言环境确定右键弹出框宽度。 【Review建议】
  REPORT-80251 英文设计器国际化显示问题 【问题原因】1、部分功能模块的label显示文字未做自动换行设置。2、开始界面右键弹出框宽度被固定,未考虑不同语言的适配问题。 【改动思路】1、更改label为自动换行。2、局部微调UI(横排组件变竖排,已与产品沟通无问题)。3、根据当前语言环境确定右键弹出框宽度。 【Review建议】
  REPORT-80251 英文设计器国际化显示问题 问题原因: 1、部分功能模块的label显示文字未做自动换行设置。 2、原先开始界面右键弹出框宽度被固定,未考虑不同语言的适配问题。 改动思路: 1、更改label为自动换行。 2、局部微调UI(横排组件变竖排,已与产品沟通无问题)。 3、设置右键弹出框前,根据当前语言环境确定弹出框宽度。
  111111111
release/11.0
Levy.Xie-解安森 2 years ago
parent
commit
76b5ade664
  1. 19
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 7
      designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
  3. 13
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  4. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  5. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  6. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  7. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  8. 3
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

19
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -119,6 +119,7 @@ public class PreferencePane extends BasicPane {
private static final int CACHING_DEFAULT = 5; private static final int CACHING_DEFAULT = 5;
private static final int CACHING_GAP = 5; private static final int CACHING_GAP = 5;
private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230; private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230;
private static final int PREFERENCE_LABEL_MAX_WIDTH = 460;
private static final int OFFSET_HEIGHT = 60; private static final int OFFSET_HEIGHT = 60;
private static final String TYPE = "pressed"; private static final String TYPE = "pressed";
@ -423,22 +424,20 @@ public class PreferencePane extends BasicPane {
private void createFunctionPane(JPanel generalPane) { private void createFunctionPane(JPanel generalPane) {
JPanel topVerticalTitledBorderPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Function")); JPanel topVerticalTitledBorderPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Function"));
JPanel upper = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); JPanel supportUndoPanel = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
JPanel lower = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); topVerticalTitledBorderPane.add(supportUndoPanel);
topVerticalTitledBorderPane.add(upper);
topVerticalTitledBorderPane.add(lower);
generalPane.add(topVerticalTitledBorderPane); generalPane.add(topVerticalTitledBorderPane);
//添加supportUndo选择项 //添加supportUndo选择项
supportUndoCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Undo")); supportUndoCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Undo"));
upper.add(supportUndoCheckBox); supportUndoPanel.add(supportUndoCheckBox);
//添加maxUndoLimit //添加maxUndoLimit
//String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"}; //String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"};
String[] undoTimes = {i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + i18nText("Fine-Design_Basic_Time(s)") String[] undoTimes = {i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + i18nText("Fine-Design_Basic_Time(s)")
, MAX_UNDO_LIMIT_15 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + i18nText("Fine-Design_Basic_Time(s)")}; , MAX_UNDO_LIMIT_15 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + i18nText("Fine-Design_Basic_Time(s)")};
maxUndoLimit = new UIComboBox(undoTimes); maxUndoLimit = new UIComboBox(undoTimes);
upper.add(maxUndoLimit); supportUndoPanel.add(maxUndoLimit);
//不支持撤销则不能选择撤销可缓存,也不能设置最大撤销次数 //不支持撤销则不能选择撤销可缓存,也不能设置最大撤销次数
supportUndoCheckBox.addActionListener(new ActionListener() { supportUndoCheckBox.addActionListener(new ActionListener() {
@ -452,14 +451,14 @@ public class PreferencePane extends BasicPane {
//添加supportDefaultParentCalculate选择项 //添加supportDefaultParentCalculate选择项
supportDefaultParentCalculateCheckBox = new UICheckBox( supportDefaultParentCalculateCheckBox = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate")); i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate"));
upper.add(supportDefaultParentCalculateCheckBox); topVerticalTitledBorderPane.add(supportDefaultParentCalculateCheckBox);
//添加是否展示打开模板提示缺少插件选择项 //添加是否展示打开模板提示缺少插件选择项
showTemplateMissingPlugin = new UICheckBox( showTemplateMissingPlugin = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin")); i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin"));
upper.add(showTemplateMissingPlugin); topVerticalTitledBorderPane.add(showTemplateMissingPlugin);
startWithEmptyFile = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Start_Empty_File")); startWithEmptyFile = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Start_Empty_File"));
lower.add(startWithEmptyFile); topVerticalTitledBorderPane.add(startWithEmptyFile);
} }
private void createEditPane(JPanel generalPane) { private void createEditPane(JPanel generalPane) {
@ -661,7 +660,7 @@ public class PreferencePane extends BasicPane {
startupPageEnabledCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Check_Text")); startupPageEnabledCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Check_Text"));
startupPane.add(startupPageEnabledCheckBox); startupPane.add(startupPageEnabledCheckBox);
UILabel descLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc")); UILabel descLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc"), PREFERENCE_LABEL_MAX_WIDTH);
descLabel.setForeground(new Color(51, 51, 52, (int)Math.round(0.5 * 255))); descLabel.setForeground(new Color(51, 51, 52, (int)Math.round(0.5 * 255)));
startupPane.add(descLabel); startupPane.add(descLabel);
} }

7
designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java

@ -94,8 +94,7 @@ public class FeedbackToolboxDialog extends JDialog {
private JPanel createInfoPane() { private JPanel createInfoPane() {
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 10); JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 10);
UILabel title = new UILabel(); UILabel title = new UILabel();
//空格布局会好看一点 title.setText(" " + Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": ");
title.setText(" " + Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": ");
//判断一下当天是否有卡顿日志记录,如果有将日期设置为当天,如果没有设置为空 //判断一下当天是否有卡顿日志记录,如果有将日期设置为当天,如果没有设置为空
boolean cartonExists = SwitchForSwingChecker.isCartonExists(); boolean cartonExists = SwitchForSwingChecker.isCartonExists();
if (cartonExists) { if (cartonExists) {
@ -344,8 +343,8 @@ public class FeedbackToolboxDialog extends JDialog {
/** /**
* 导出卡顿日志到本地或远程服务器WEB-INF下 * 导出卡顿日志到本地或远程服务器WEB-INF下
* *
* @param sourceFile 导出的卡顿日志所在文件夹 * @param sourceFile 导出的卡顿日志所在文件夹
* @param path 文件需要导出到的路径 * @param path 文件需要导出到的路径
* @param sourceFilePath 导出的卡顿日志所在文件夹的路径 * @param sourceFilePath 导出的卡顿日志所在文件夹的路径
*/ */
private void exportCartonLog(File sourceFile, String path, String sourceFilePath) { private void exportCartonLog(File sourceFile, String path, String sourceFilePath) {

13
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -11,6 +11,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.gui.imenu.UIScrollPopUpMenu; import com.fr.design.gui.imenu.UIScrollPopUpMenu;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -24,6 +25,7 @@ import com.fr.design.utils.TemplateUtils;
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.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -67,6 +69,7 @@ import java.awt.geom.Line2D;
import java.awt.geom.Path2D; import java.awt.geom.Path2D;
import java.awt.geom.RoundRectangle2D; import java.awt.geom.RoundRectangle2D;
import java.util.List; import java.util.List;
import java.util.Locale;
import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION; import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
@ -197,7 +200,9 @@ public class MutilTempalteTabPane extends JComponent {
height += 25; height += 25;
} }
} }
menu.setPreferredSize(new Dimension(170, height)); //根据当前i18n语言环境,动态调整popupMenu的宽度
menu.setPreferredSize(new Dimension((int) DesignSizeI18nManager.getInstance().
i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(), height));
GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight());
} }
} }
@ -334,7 +339,7 @@ public class MutilTempalteTabPane extends JComponent {
} }
} }
private void closeTemplate(JTemplate<?, ?>[] templates, JTemplate<?, ?> currentTemplate) { private void closeTemplate(JTemplate<?, ?>[] templates, JTemplate<?, ?> currentTemplate) {
for (int i = 0; i < templates.length; i++) { for (int i = 0; i < templates.length; i++) {
if (option.shouldClose(tplIndex, i)) { if (option.shouldClose(tplIndex, i)) {
JTemplate<?, ?> jTemplate = templates[i]; JTemplate<?, ?> jTemplate = templates[i];
@ -935,7 +940,7 @@ public class MutilTempalteTabPane extends JComponent {
/** /**
* 后台关闭当前编辑模板 * 后台关闭当前编辑模板
*/ */
public void closeCurrentTpl(){ public void closeCurrentTpl() {
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
this.setIsCloseCurrent(true); this.setIsCloseCurrent(true);
this.closeFormat(jTemplate); this.closeFormat(jTemplate);
@ -1159,7 +1164,7 @@ public class MutilTempalteTabPane extends JComponent {
boolean completed = WorkerManager.getInstance().isCompleted(template.getTarget().getTemplateID()); boolean completed = WorkerManager.getInstance().isCompleted(template.getTarget().getTemplateID());
if (!completed) { if (!completed) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Close_Template_Tip", template.getEditingFILE().getName())); Toolkit.i18nText("Fine-Design_Close_Template_Tip", template.getEditingFILE().getName()));
return; return;
} }
} }

3
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -21,4 +21,5 @@ com.fr.design.ds.column.sort.pane=250*180
com.fr.design.sort.expand.header.pane=95*10 com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65

3
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=250*165
com.fr.design.sort.expand.header.pane=95*10 com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65

3
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=250*180
com.fr.design.sort.expand.header.pane=95*10 com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65

3
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -22,4 +22,5 @@ com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10 com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65

3
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10 com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65

Loading…
Cancel
Save