Browse Source

字体检测、选项处理

persist/11.0-arabic
obo 7 months ago
parent
commit
26ee6854f6
  1. 30
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 4
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  3. 3
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

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

@ -1,5 +1,6 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.base.i18n.BidiUtils;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -82,6 +83,7 @@ import javax.swing.JPanel;
import javax.swing.JProgressBar; import javax.swing.JProgressBar;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import javax.swing.ScrollPaneConstants; import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.Timer; import javax.swing.Timer;
@ -377,6 +379,7 @@ public class PreferencePane extends BasicPane {
cloudAnalyticsDelayCheckBox = new UICheckBox(i18nText("Fine-Design_Cloud_Analytics_Delay")); cloudAnalyticsDelayCheckBox = new UICheckBox(i18nText("Fine-Design_Cloud_Analytics_Delay"));
designerStartupOption.add(cloudAnalyticsDelayCheckBox); designerStartupOption.add(cloudAnalyticsDelayCheckBox);
advancePane.add(designerStartupOption); advancePane.add(designerStartupOption);
BidiUtils.applyOrientationByLocale(generalPane, advancePane, vcsPane);
} }
private JPanel createImageExportSettingPane() { private JPanel createImageExportSettingPane() {
@ -393,8 +396,8 @@ public class PreferencePane extends BasicPane {
previewRenderGroup.add(previewRenderSpeed); previewRenderGroup.add(previewRenderSpeed);
JPanel imageExportSettingPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel imageExportSettingPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JComponent[][] templateComps = { JComponent[][] templateComps = {
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":"), this.previewResolutionBtnS, this.previewResolutionBtnM}, {new UILabel(createLabelColonName("Fine-Design_Report_Engine_Enlarge_Or_Reduce")), this.previewResolutionBtnS, this.previewResolutionBtnM},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.previewRenderQuality, this.previewRenderSpeed}, {new UILabel(createLabelColonName("Fine-Design_Image_Export_Rendering_Quality")), this.previewRenderQuality, this.previewRenderSpeed},
}; };
imageExportSettingPane.add( imageExportSettingPane.add(
TableLayoutHelper.createGapTableLayoutPane( TableLayoutHelper.createGapTableLayoutPane(
@ -471,7 +474,7 @@ public class PreferencePane extends BasicPane {
} }
} }
}); });
vcsPane.add(enableVcsPanel); vcsPane.add(remindVcsLabel);
vcsPane.add(intervalPanel); vcsPane.add(intervalPanel);
if (VcsHelper.getInstance().isLegacyMode()) { if (VcsHelper.getInstance().isLegacyMode()) {
vcsPane.add(saveCommitCheckBox); vcsPane.add(saveCommitCheckBox);
@ -659,7 +662,7 @@ public class PreferencePane extends BasicPane {
} }
}); });
JPanel keyStrokePane = new JPanel(new BorderLayout()); JPanel keyStrokePane = new JPanel(new BorderLayout());
keyStrokePane.add(new UILabel(i18nText("Fine-Design_Basic_Support_Auto_Complete_Shortcut") + ":"), BorderLayout.WEST); keyStrokePane.add(new UILabel(createLabelColonName("Fine-Design_Basic_Support_Auto_Complete_Shortcut")), BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST);
shortCutLabel = new UILabel(); shortCutLabel = new UILabel();
keyStrokePane.add(shortCutLabel, BorderLayout.CENTER); keyStrokePane.add(shortCutLabel, BorderLayout.CENTER);
keyStrokePane.setBorder(new EmptyBorder(0, 10,0,0)); keyStrokePane.setBorder(new EmptyBorder(0, 10,0,0));
@ -738,10 +741,10 @@ public class PreferencePane extends BasicPane {
paginationLineColorTBButton.setEnabled(this.isEnabled()); paginationLineColorTBButton.setEnabled(this.isEnabled());
JPanel leftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel leftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
leftPane.add(new UILabel(i18nText("Fine-Design_Basic_Preference_Grid_Line_Color") + ":")); leftPane.add(new UILabel(createLabelColonName("Fine-Design_Basic_Preference_Grid_Line_Color")));
leftPane.add(gridLineColorTBButton); leftPane.add(gridLineColorTBButton);
JPanel rightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel rightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
rightPane.add(new UILabel(i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color") + ":")); rightPane.add(new UILabel(createLabelColonName("Fine-Design_Basic_Preference_Pagination_Line_Color")));
rightPane.add(paginationLineColorTBButton); rightPane.add(paginationLineColorTBButton);
colorSettingPane.add(leftPane); colorSettingPane.add(leftPane);
colorSettingPane.add(rightPane); colorSettingPane.add(rightPane);
@ -753,7 +756,7 @@ public class PreferencePane extends BasicPane {
advancePane.add(logPane); advancePane.add(logPane);
JPanel logExportPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Export_Setting")); JPanel logExportPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Export_Setting"));
logPane.add(logExportPane); logPane.add(logExportPane);
UILabel logLabel = new UILabel(i18nText("Fine-Design_Basic_Select_Export_Log_Directory") + ":"); UILabel logLabel = new UILabel(i18nText(createLabelColonName("Fine-Design_Basic_Select_Export_Log_Directory")));
logExportPane.add(logLabel, BorderLayout.WEST); logExportPane.add(logLabel, BorderLayout.WEST);
logExportDirectoryField = new UITextField(24); logExportDirectoryField = new UITextField(24);
logExportPane.add(logExportDirectoryField, BorderLayout.CENTER); logExportPane.add(logExportDirectoryField, BorderLayout.CENTER);
@ -873,8 +876,8 @@ public class PreferencePane extends BasicPane {
reportLengthComboBox = new UIComboBox(UnitConvertUtil.getUnitItems()); reportLengthComboBox = new UIComboBox(UnitConvertUtil.getUnitItems());
reportLengthComboBox.setPreferredSize(new Dimension(80, 20)); reportLengthComboBox.setPreferredSize(new Dimension(80, 20));
reportLengthComboBox.setMinimumSize(new Dimension(80, 20)); reportLengthComboBox.setMinimumSize(new Dimension(80, 20));
UILabel pagelengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":"); UILabel pagelengthLabel = new UILabel(createLabelColonName("Fine-Design_Basic_Page_Setup_Scale_Units"));
UILabel reportLengthLabel = new UILabel(i18nText("Fine-Design_Basic_Report_Design_Ruler_Units") + ":"); UILabel reportLengthLabel = new UILabel(createLabelColonName("Fine-Design_Basic_Report_Design_Ruler_Units"));
Component[][] lengthComponents = { Component[][] lengthComponents = {
{pagelengthLabel, pageLengthComboBox, reportLengthLabel, reportLengthComboBox}, {pagelengthLabel, pageLengthComboBox, reportLengthLabel, reportLengthComboBox},
}; };
@ -893,7 +896,7 @@ public class PreferencePane extends BasicPane {
portEditor.setPreferredSize(new Dimension(80, 20)); portEditor.setPreferredSize(new Dimension(80, 20));
portEditor.setMinimumSize(new Dimension(80, 20)); portEditor.setMinimumSize(new Dimension(80, 20));
UILabel notiJlabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer")); UILabel notiJlabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));
UILabel serverPortLabel = new UILabel(i18nText("Fine-Design_Basic_Web_Preview_Port") + ":"); UILabel serverPortLabel = new UILabel(createLabelColonName("Fine-Design_Basic_Web_Preview_Port"));
Component[][] portComponents = { Component[][] portComponents = {
{serverPortLabel, portEditor, notiJlabel}, {serverPortLabel, portEditor, notiJlabel},
}; };
@ -1487,5 +1490,12 @@ public class PreferencePane extends BasicPane {
return gcButton; return gcButton;
} }
/**
* 创建带冒号的label名适配RTL
*/
private String createLabelColonName(String i18nKey) {
return BidiUtils.rtl() ? ":" + i18nText(i18nKey) : i18nText(i18nKey) + ":";
}
} }

4
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -1,5 +1,6 @@
package com.fr.design.layout; package com.fr.design.layout;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
@ -17,6 +18,7 @@ import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.LayoutManager; import java.awt.LayoutManager;
public class FRGUIPaneFactory { public class FRGUIPaneFactory {
@ -209,7 +211,7 @@ public class FRGUIPaneFactory {
JPanel jp = new JPanel(); JPanel jp = new JPanel();
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string);
jp.setBorder(explainBorder); jp.setBorder(explainBorder);
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT));
return jp; return jp;
} }

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

@ -1,5 +1,6 @@
package com.fr.design.mainframe.check; package com.fr.design.mainframe.check;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -123,7 +124,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
this.add(hiddenPanel, BorderLayout.CENTER); this.add(hiddenPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH); this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse")); this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse"));
BidiUtils.applyOrientationByLocale(this);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }

Loading…
Cancel
Save