diff --git a/designer-base/src/main/java/com/fr/base/i18n/ArabicI18nImpl.java b/designer-base/src/main/java/com/fr/base/i18n/ArabicI18nImpl.java new file mode 100644 index 0000000000..ba8ba8df15 --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/i18n/ArabicI18nImpl.java @@ -0,0 +1,23 @@ +package com.fr.base.i18n; + +import com.fr.stable.fun.I18nProvider; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * description + * + * @author obo + * @since 11.0 + * Created on 2024/08/06 + */ +public class ArabicI18nImpl implements I18nProvider { + @Override + public Map obtainAll() { + Map map = new HashMap<>(); + map.put(new Locale("ar", "SA"), "Fine-Core_Arabic_Language"); + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java b/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java new file mode 100644 index 0000000000..b11e6340da --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java @@ -0,0 +1,91 @@ +package com.fr.base.i18n; + +import com.fr.design.DesignerEnvManager; + +import javax.swing.border.TitledBorder; +import java.awt.Component; +import java.awt.ComponentOrientation; +import java.awt.Container; +import java.util.Locale; + +/** + * 根据国际化获取组件方向 + * + * @author obo + * @since 11.0 + * Created on 2024/07/17 + */ +public class BidiUtils { + + private static final Locale LOCALE = DesignerEnvManager.getEnvManager().getLanguage(); + + private BidiUtils() { + } + + public static ComponentOrientation getOrientationByLocale() { + return ComponentOrientation.getOrientation(LOCALE); + } + + public static T applyOrientationByLocale(T component) { + component.applyComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); + return component; + } + + public static T setOrientationByLocale(T component) { + component.setComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); + return component; + } + + public static void setOrientationByLocale(Component... components) { + for (Component component : components) { + component.setComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); + } + } + + public static void applyOrientationByLocale(Component... components) { + for (Component component : components) { + component.applyComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); + } + } + + public static boolean rtl() { + return ComponentOrientation.getOrientation(LOCALE) == ComponentOrientation.RIGHT_TO_LEFT; + } + + /** + * 拼接字符数组,有的组件名是多段字符串拼接起来的,如果是rtl的话需要反向拼接 + */ + public static String concatenateStrings(String... strs) { + StringBuilder result = new StringBuilder(); + + if (rtl()) { + for (int i = strs.length - 1; i >= 0; i--) { + result.append(strs[i]); + } + } else { + for (int i = 0; i <= strs.length - 1; i++) { + result.append(strs[i]); + } + } + return result.toString(); + } + + public static T applyTitledBorderJustification(T titledBorder) { + titledBorder.setTitleJustification(BidiUtils.rtl() ? TitledBorder.RIGHT : TitledBorder.LEFT); + return titledBorder; + } + + /** + * 镜像BoxLayout布局组件 + */ + public static void mirrorBoxLayout(Container container) { + Component[] components = container.getComponents(); + for (int i = components.length - 1; i >= 0; i--) { + Component component = components[i]; + container.remove(i); + container.add(component); + } + container.revalidate(); + container.repaint(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index 8a6e7a7df9..f47341ae7f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -24,7 +24,7 @@ public class TableDataSourceAction extends TemplateComponentAction t) { super(t); this.setMenuKeySet(KeySetUtils.TEMPLATE_TABLE_DATA_SOURCE); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_web/datasource"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java index d33c04eb15..9861887844 100644 --- a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java @@ -6,6 +6,7 @@ package com.fr.design.actions; import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; +import com.fr.base.i18n.BidiUtils; import com.fr.base.svg.SVGIcon; import com.fr.base.svg.IconUtils; import com.fr.design.actions.core.ActionFactory; @@ -327,6 +328,7 @@ public abstract class UpdateAction extends ShortCut implements Action { object = menuItem; this.putValue(UIMenuItem.class.getName(), object); + BidiUtils.applyOrientationByLocale(menuItem); } return (UIMenuItem) object; } @@ -338,7 +340,7 @@ public abstract class UpdateAction extends ShortCut implements Action { setPressedIcon4Button(menuItem); setDisabledIcon4Button(menuItem); this.putValue(UIMenuItem.class.getName(), menuItem); - return menuItem; + return BidiUtils.applyOrientationByLocale(menuItem); } /** @@ -547,7 +549,6 @@ public abstract class UpdateAction extends ShortCut implements Action { menuItem.addActionListener(action); menuItem.setToolTipText((String) action.getValue(Action.LONG_DESCRIPTION)); menuItem.setAccelerator((KeyStroke) action.getValue(Action.ACCELERATOR_KEY)); - return menuItem; } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java b/designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java index 812d89e5f8..517a6c8080 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java @@ -16,7 +16,7 @@ import java.awt.event.ActionEvent; public class BatchCompileAction extends UpdateAction { public BatchCompileAction() { this.setMenuKeySet(COMPILE); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/nx/app/designer/transform/batch_transform.png")); } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java index dd48e26841..ca463d3d46 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java @@ -17,7 +17,7 @@ import java.awt.event.ActionEvent; public class PreferenceAction extends UpdateAction { public PreferenceAction() { this.setMenuKeySet(KeySetUtils.PREFERENCE); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.generateAndSetSearchText(PreferencePane.class.getName()); } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index f8703275f8..343b34ad3b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,5 +1,6 @@ package com.fr.design.actions.file; +import com.fr.base.i18n.BidiUtils; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -44,7 +45,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; @@ -52,7 +52,6 @@ import com.fr.io.attr.ImageExportAttr; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.report.ReportConfigManager; -import com.fr.scheduler.tool.FineScheduler; import com.fr.stable.Constants; import com.fr.stable.os.OperatingSystem; import com.fr.third.apache.logging.log4j.Level; @@ -76,7 +75,6 @@ import javax.swing.ButtonGroup; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFileChooser; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JProgressBar; @@ -377,6 +375,7 @@ public class PreferencePane extends BasicPane { cloudAnalyticsDelayCheckBox = new UICheckBox(i18nText("Fine-Design_Cloud_Analytics_Delay")); designerStartupOption.add(cloudAnalyticsDelayCheckBox); advancePane.add(designerStartupOption); + BidiUtils.applyOrientationByLocale(generalPane, advancePane, vcsPane); } private JPanel createImageExportSettingPane() { diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java index b957e15630..a8062218bf 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java @@ -18,7 +18,7 @@ public class SaveAsTemplateAction extends JTemplateAction> { public SaveAsTemplateAction(JTemplate dPane) { super(dPane); this.setMenuKeySet(KeySetUtils.SAVE_AS_TEMPLATE); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_file/saveAs"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java index 4dcc53a13c..b57a4e91e9 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java @@ -17,7 +17,7 @@ import java.awt.event.ActionEvent; public class AboutAction extends UpdateAction { public AboutAction() { this.setMenuKeySet(ABOUT); - this.setName(getMenuKeySet().getMenuKeySetName()+"..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); } diff --git a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java index 4742f337cd..6e83ef0b64 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java @@ -1,5 +1,6 @@ package com.fr.design.actions.server; +import com.fr.base.i18n.BidiUtils; import com.fr.data.impl.Connection; import com.fr.design.actions.UpdateAction; import com.fr.design.data.datapane.connect.ConnectionShowPane; @@ -118,6 +119,7 @@ public class ConnectionListAction extends UpdateAction { menuItem.setName(getName()); setPressedIcon4Button(menuItem); setDisabledIcon4Button(menuItem); + BidiUtils.applyOrientationByLocale(menuItem); object = menuItem; this.putValue(UILockMenuItem.class.getName(), object); diff --git a/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java index d7f1cdbb7a..279540558c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java @@ -27,7 +27,7 @@ import java.awt.event.ActionEvent; public class FunctionManagerAction extends UpdateAction { public FunctionManagerAction() { this.setMenuKeySet(FUNCTION_MANAGER); - this.setName(getMenuKeySet().getMenuKeySetName()+"..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_web/function"); this.generateAndSetSearchText(FunctionManagerPane.class.getName()); diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java index d3f035972c..859671b9c7 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java @@ -29,7 +29,7 @@ import java.awt.event.ActionEvent; public class GlobalParameterAction extends UpdateAction { public GlobalParameterAction() { this.setMenuKeySet(GLOBAL_PARAMETER); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_report/p"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java index 1457f0d111..23ef358ca8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java @@ -4,6 +4,7 @@ package com.fr.design.actions.server; import com.fr.base.TableData; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignModelAdapter; import com.fr.design.actions.UpdateAction; import com.fr.design.data.DesignTableDataManager; @@ -181,7 +182,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS setPressedIcon4Button(menuItem); setDisabledIcon4Button(menuItem); object = menuItem; - + BidiUtils.applyOrientationByLocale(menuItem); this.putValue(UILockMenuItem.class.getName(), object); ServerTableDataLockChangeChecker.getInstance().addEditLockChangeListener((UILockMenuItem)object); } diff --git a/designer-base/src/main/java/com/fr/design/border/UITitledBorder.java b/designer-base/src/main/java/com/fr/design/border/UITitledBorder.java index 875ef00833..249f6d277c 100644 --- a/designer-base/src/main/java/com/fr/design/border/UITitledBorder.java +++ b/designer-base/src/main/java/com/fr/design/border/UITitledBorder.java @@ -1,5 +1,6 @@ package com.fr.design.border; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import javax.swing.BorderFactory; @@ -14,11 +15,11 @@ public class UITitledBorder extends TitledBorder { private static final long serialVersionUID = 1L; public static UITitledBorder createBorderWithTitle(String title) { - return new UITitledBorder(title); + return BidiUtils.applyTitledBorderJustification(new UITitledBorder(title)); } public static UITitledBorder createBorderWithTitle(String title, int roundedCorner) { - return new UITitledBorder(title, roundedCorner); + return BidiUtils.applyTitledBorderJustification(new UITitledBorder(title, roundedCorner)); } private UITitledBorder(String title) { diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 5d6ee4e5ac..aa96fe24a2 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -1,6 +1,7 @@ package com.fr.design.condition; +import com.fr.base.i18n.BidiUtils; import com.fr.common.annotations.Open; import com.fr.design.actions.UpdateAction; import com.fr.design.beans.BasicBeanPane; @@ -71,6 +72,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); dealScrollPane(selectedItemScrollPane); propertyChangePane.add(selectedItemScrollPane); + BidiUtils.applyOrientationByLocale(this); } protected void dealScrollPane(JScrollPane scrollPane){ diff --git a/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java b/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java index 82c8ec340f..4a8af5dc46 100644 --- a/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java @@ -2,6 +2,7 @@ package com.fr.design.condition; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; +import com.fr.base.i18n.BidiUtils; import com.fr.data.DataConstants; import com.fr.data.condition.CommonCondition; import com.fr.data.condition.FormulaCondition; @@ -400,6 +401,7 @@ public abstract class LiteConditionPane extends BasicBeanPa public LiteConditionPane() { this.initComponents(); + BidiUtils.applyOrientationByLocale(this); } protected abstract BasicBeanPane createUnFormulaConditionPane(); @@ -439,7 +441,7 @@ public abstract class LiteConditionPane extends BasicBeanPa conditionsTree.addTreeSelectionListener(treeSelectionListener); JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); - previewPane.add(GUICoreUtils.createBorderPane(buttonPane, BorderLayout.NORTH), BorderLayout.EAST); + previewPane.add(GUICoreUtils.createBorderPane(buttonPane, BorderLayout.NORTH), BorderLayout.LINE_END); initButtonPane(buttonPane); // peter:必须要检查Enabled. @@ -494,7 +496,7 @@ public abstract class LiteConditionPane extends BasicBeanPa conditonTypePane.setBorder(new ModLineBorder(ModLineBorder.BOTTOM)); UILabel conditionTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Type") + ":"); - conditonTypePane.add(conditionTypeLabel, BorderLayout.WEST); + conditonTypePane.add(conditionTypeLabel, BorderLayout.LINE_START); conditionTypeLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, DOWN_PADDING, 0)); JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java index 175ddbfda3..505e5faabe 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane; +import com.fr.base.i18n.BidiUtils; import com.fr.data.impl.RecursionTableData; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.PreviewLabel; @@ -56,7 +57,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { public TreeTableDataDictPane(String treeName) { this.setLayout(new BorderLayout(5, 30)); this.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 0)); - selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") + " :"); + selectTableDataLabel = new UILabel(BidiUtils.concatenateStrings(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One"), " :")); setTableDataNameComboBox(treeName); tableDataNameComboBox.setPreferredSize(new Dimension(180, 20)); JPanel tableFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); @@ -95,11 +96,11 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { markButtonGroup.add(parentMarkRadio); markButtonGroup.add(lengthMarkRadio); - originFieldDependsOnParentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed") + " :", SwingConstants.RIGHT); - parentFieldLabel = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field") + " :", SwingConstants.RIGHT); - treeDataFieldLabel1 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT); - originFieldDependsOnLengthLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed") + " :", SwingConstants.RIGHT); - treeDataFieldLabel2 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT); + originFieldDependsOnParentLabel = new UILabel(BidiUtils.concatenateStrings(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"), " :"), SwingConstants.TRAILING); + parentFieldLabel = new UILabel(BidiUtils.concatenateStrings(" ", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field"), " :"), SwingConstants.TRAILING); + treeDataFieldLabel1 = new UILabel(BidiUtils.concatenateStrings(" ", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field"), " :"), SwingConstants.TRAILING); + originFieldDependsOnLengthLabel = new UILabel(BidiUtils.concatenateStrings(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"), " :"), SwingConstants.TRAILING); + treeDataFieldLabel2 = new UILabel(BidiUtils.concatenateStrings(" ", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field"), " :"), SwingConstants.TRAILING); // originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))}); // parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))}); @@ -164,6 +165,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { } }); centerPane.add(previewPanel, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } protected void setTableDataNameComboBox(String treeName) { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java index 374efb1121..23d72554a7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; @@ -41,8 +42,8 @@ public class VerticalChoosePane extends ChoosePane implements DesignerBean { rs.add(tableNameComboBox, BorderLayout.CENTER); rs.add(GUICoreUtils.createFlowPane(new Component[]{new RefreshLabel(this), previewLabel}, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST); rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER)); - UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT); - UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT); + UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEADING); + UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEADING); UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH, UILabel.LEFT); if (labelSize > 0) { Dimension pSize = new Dimension(labelSize, 20); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java index 7784aa5712..26543691f3 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java @@ -41,10 +41,10 @@ public class AdvancePane extends BasicPane { double[] rowSizeDbcp = {p, p, p, p}; double[] columnDbcp = {190, p}; Component[][] comps = { - {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.RIGHT), DBCP_MAX_ACTIVE}, - {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.RIGHT), DBCP_VALIDATION_QUERY}, - {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow") + ":", SwingConstants.RIGHT), DBCP_TESTONBORROW}, - {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Max_Wait_Time") + ":", SwingConstants.RIGHT), DBCP_MAX_WAIT} + {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.TRAILING), DBCP_MAX_ACTIVE}, + {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.TRAILING), DBCP_VALIDATION_QUERY}, + {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow") + ":", SwingConstants.TRAILING), DBCP_TESTONBORROW}, + {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Max_Wait_Time") + ":", SwingConstants.TRAILING), DBCP_MAX_WAIT} }; JPanel contextPane = TableLayoutHelper.createGapTableLayoutPane(comps, rowSizeDbcp, columnDbcp, 11, 11); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index eadf456e09..dcbd1f6bb5 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.file.ConnectionConfig; @@ -21,6 +22,7 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio } }; container.add(connectionListPane, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 11c3f64d64..9e01be12d6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -3,6 +3,7 @@ */ package com.fr.design.data.datapane.connect; +import com.fr.base.i18n.BidiUtils; import com.fr.data.driver.util.JarFileParseUtil; import com.fr.data.impl.Connection; import com.fr.data.impl.JDBCDatabaseConnection; @@ -281,6 +282,7 @@ public abstract class DatabaseConnectionPane { JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.add(northPane, BorderLayout.NORTH); this.add(initSouthPanel(), BorderLayout.SOUTH); + BidiUtils.applyOrientationByLocale(this); } private JPanel initSouthPanel() { JPanel jpanel = new JPanel(); diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index ae430b26e3..e677c29017 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -2,6 +2,7 @@ package com.fr.design.data.tabledata.tabledatapane; import com.fr.base.Parameter; import com.fr.base.ParameterHelper; +import com.fr.base.i18n.BidiUtils; import com.fr.data.core.db.TableProcedure; import com.fr.data.impl.Connection; import com.fr.data.impl.DBTableData; @@ -123,6 +124,7 @@ public class DBTableDataPane extends AbstractTableDataPane implemen public DBTableDataPane() { initCards(); initContentPane(); + BidiUtils.applyOrientationByLocale(this); } /** diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java index ba5d42bd88..49d8a2993a 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.tabledata.tabledatapane; +import com.fr.base.i18n.BidiUtils; import com.fr.data.impl.EmbeddedTableData; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; @@ -40,6 +41,7 @@ public class EmbeddedTableDataDefinedPane extends BasicPane{ public EmbeddedTableDataDefinedPane() { initComponents(); + BidiUtils.applyOrientationByLocale(this); } protected void initComponents() { diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index 731816243e..da3b22cd69 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.tabledata.tabledatapane; +import com.fr.base.i18n.BidiUtils; import com.fr.data.impl.EmbeddedTableData; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -48,6 +49,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane { fileTypeComboBox = new UIComboBox(item); fileTypeComboBox.setPreferredSize(new Dimension(100, 20)); type.add(fileTypeComboBox); - northPanel.add(type, BorderLayout.WEST); + northPanel.add(type, BorderLayout.LINE_START); // 最上面的pane,文件选择 JPanel centerPanel = new JPanel(); @@ -172,7 +173,8 @@ public class FileTableDataPane extends AbstractTableDataPane { this.add(northPanel, BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); - this.add(southPanel, BorderLayout.EAST); + this.add(southPanel, BorderLayout.LINE_END); + BidiUtils.applyOrientationByLocale(this); } private void addToCenterPanel(JPanel centerPanel) { @@ -207,9 +209,9 @@ public class FileTableDataPane extends AbstractTableDataPane { buttonPanel.add(chooseFile); buttonPanel.add(testConnection); filePath = FRGUIPaneFactory.createBorderLayout_S_Pane(); - filePath.add(textPanel, BorderLayout.WEST); + filePath.add(textPanel, BorderLayout.LINE_START); filePath.add(textFieldPanel, BorderLayout.CENTER); - filePath.add(buttonPanel, BorderLayout.EAST); + filePath.add(buttonPanel, BorderLayout.LINE_END); centerPanel.add(filePath, BorderLayout.NORTH); // 中间的pane,提示信息 diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index af2b71a7c6..3afe9728d5 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -2,6 +2,7 @@ package com.fr.design.data.tabledata.tabledatapane; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -67,6 +68,7 @@ public class MaxMemRowCountPanel extends UIToolbar { }; public MaxMemRowCountPanel() { + this.setLayout(new FlowLayout(FlowLayout.LEADING)); this.setFloatable(false); this.setRollover(true); this.setBackground(UIConstants.NORMAL_BACKGROUND); diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java index 66674f166a..28aaf86d45 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java @@ -1,6 +1,7 @@ package com.fr.design.data.tabledata.tabledatapane; import com.fr.base.*; +import com.fr.base.i18n.BidiUtils; import com.fr.data.impl.ConditionTableData; import com.fr.data.impl.MultiTDTableData; import com.fr.data.impl.UnionTableData; @@ -132,7 +133,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane= (maxWidth + SMALLGAP) && evtX <= (getWidth() - SMALLGAP); + if (BidiUtils.rtl()) { + return evtX >= SMALLGAP && evtX <= (LIST_BUTTON_WIDTH - SMALLGAP); + } else { + int maxWidth = getWidth() - LIST_BUTTON_WIDTH; + return evtX >= (maxWidth + SMALLGAP) && evtX <= (getWidth() - SMALLGAP); + } } private int getTemplateIndex(int evtX) { - int textX = 0; + int textX = BidiUtils.rtl() ? (int) (getWidth() - LIST_BUTTON_WIDTH * 1.0D) - realWidth : 0; for (int i = minPaintIndex; i <= maxPaintIndex; i++) { int textWidth = showJTemplateTab(openedTemplate.get(i)) ? realWidth : 0; if (evtX >= textX && evtX < textX + textWidth) { return i; } - textX += textWidth; + textX = BidiUtils.rtl() ? textX - textWidth : textX + textWidth; } return -1; } diff --git a/designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java b/designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java index 31cc290324..4e4bca58bf 100644 --- a/designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java +++ b/designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java @@ -1,6 +1,7 @@ package com.fr.design.foldablepane; import com.fr.base.GraphHelper; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxUtilities; @@ -59,7 +60,8 @@ public class HeaderPane extends JPanel { RenderingHints.VALUE_ANTIALIAS_ON); BufferedImage panelImage = createPanelImage(); g2d.drawImage(panelImage, null, 0, 0); - GraphHelper.drawString(g2d, this.title, TITLE_X, headHeight - fontSize / 2 - 1); + int x = BidiUtils.rtl() ? headWidth - TITLE_X - g2d.getFontMetrics().stringWidth(title) : TITLE_X; + GraphHelper.drawString(g2d, this.title, x, headHeight - fontSize / 2 - 1); } private BufferedImage createPanelImage() { @@ -75,7 +77,7 @@ public class HeaderPane extends JPanel { if (desktopHints != null) { g2d.setRenderingHints(desktopHints); } - int leftWdith = headWidth - LEFT_X; + int leftWdith = BidiUtils.rtl() ? TITLE_X : headWidth - LEFT_X; if (this.isShow) { image = UIConstants.DRAG_DOWN_SELECTED_SMALL; g2d.drawImage(image, leftWdith, LEFT_Y, null); diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index f41c044b74..fbaf01911e 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -6,6 +6,7 @@ import com.fr.base.Parameter; import com.fr.base.ParameterMapNameSpace; import com.fr.base.TableDataNameSpace; import com.fr.base.Utils; +import com.fr.base.i18n.BidiUtils; import com.fr.base.io.IOFile; import com.fr.data.TableDataSource; import com.fr.design.actions.UpdateAction; @@ -161,6 +162,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { public FormulaPane() { initComponents(); + BidiUtils.applyOrientationByLocale(this); } private void initFormulaTextAreaKeyListener() { @@ -225,6 +227,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private void initFormulaTextArea() { formulaTextArea = new RSyntaxTextArea(); + BidiUtils.setOrientationByLocale(formulaTextArea); configFormulaArea(); initFormulaTextAreaKeyListener(); initFormulaTextAreaMouseListener(); @@ -259,8 +262,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private void initTipsPane() { // tipsPane JPanel containerSPane = new JPanel(new BorderLayout(4, 1)); - JPanel labelPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0), true); - JPanel searchPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0), true); + JPanel labelPane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0), true); + JPanel searchPane = new JPanel(new FlowLayout(FlowLayout.TRAILING, 0, 0), true); containerSPane.setPreferredSize(new Dimension(892, 23)); this.add(containerSPane, BorderLayout.NORTH); @@ -269,13 +272,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Input_Formula_In_The_Text_Area_Below") + ":"); formulaLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); - labelPane.add(formulaLabel, BorderLayout.WEST); + labelPane.add(formulaLabel, BorderLayout.LINE_START); keyWordTextField.setPreferredSize(new Dimension(240, 23)); - searchPane.add(keyWordTextField, BorderLayout.EAST); - searchPane.add(searchButton, BorderLayout.EAST); + searchPane.add(keyWordTextField, BorderLayout.LINE_END); + searchPane.add(searchButton, BorderLayout.LINE_END); - containerSPane.add(labelPane, BorderLayout.WEST); - containerSPane.add(searchPane, BorderLayout.EAST); + containerSPane.add(labelPane, BorderLayout.LINE_START); + containerSPane.add(searchPane, BorderLayout.LINE_END); initKeyWordTextFieldKeyListener(); tipsList = new JList(listModel); @@ -313,7 +316,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { // text JPanel textPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.add(textPane, BorderLayout.CENTER); - JPanel checkBoxandbuttonPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); + JPanel checkBoxandbuttonPane = new JPanel(new BorderLayout()); initFormulaTextArea(); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); @@ -329,12 +332,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { //靠左流式布局 JPanel checkBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - checkBoxandbuttonPane.add(checkBoxPane, BorderLayout.WEST); + checkBoxandbuttonPane.add(checkBoxPane, BorderLayout.LINE_START); //靠右流式布局 JPanel buttonPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - buttonPane.add(checkValidButton, BorderLayout.EAST); - buttonPane.add(calButton, BorderLayout.EAST); - checkBoxandbuttonPane.add(buttonPane, BorderLayout.EAST); + buttonPane.add(checkValidButton, BorderLayout.LINE_END); + buttonPane.add(calButton, BorderLayout.LINE_END); + checkBoxandbuttonPane.add(buttonPane, BorderLayout.LINE_END); if (autoCompletionCheck == null) { autoCompletionCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_AutoCompletion")); autoCompletionCheck.setSelected(true); @@ -343,8 +346,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { checkBeforeColse = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Before_Closed")); checkBeforeColse.setSelected(true); } - checkBoxPane.add(autoCompletionCheck, BorderLayout.WEST); - checkBoxPane.add(checkBeforeColse, BorderLayout.WEST); + checkBoxPane.add(autoCompletionCheck, BorderLayout.LINE_START); + checkBoxPane.add(checkBeforeColse, BorderLayout.LINE_START); extendCheckBoxPane(checkBoxPane); ParameterTableModel model = new ParameterTableModel(0); diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPaneWhenReserveFormula.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPaneWhenReserveFormula.java index ab49b605d4..a83d66ca5d 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPaneWhenReserveFormula.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPaneWhenReserveFormula.java @@ -1,6 +1,7 @@ package com.fr.design.formula; import com.fr.base.BaseFormula; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.icheckbox.UICheckBox; import javax.swing.JPanel; @@ -40,8 +41,8 @@ public class FormulaPaneWhenReserveFormula extends FormulaPane { reserveCheckBox4Write = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Save_Formula")); reserveCheckBox4Write.setSelected(false); - checkBoxPane.add(reserveCheckBox4Result, BorderLayout.WEST); - checkBoxPane.add(reserveCheckBox4Write, BorderLayout.WEST); + checkBoxPane.add(reserveCheckBox4Result, BorderLayout.LINE_START); + checkBoxPane.add(reserveCheckBox4Write, BorderLayout.LINE_START); } @Override diff --git a/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java b/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java index c40a917e39..e05bd55470 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java @@ -1,5 +1,6 @@ package com.fr.design.formula; +import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.dialog.BasicDialog; @@ -161,6 +162,7 @@ public class FunctionManagerPane extends BasicPane { descriptionPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Description") + ":"), BorderLayout.NORTH); this.descriptionTextArea = new UITextArea(6, 24); descriptionPane.add(new JScrollPane(this.descriptionTextArea), BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } private String getEscapePath(String path) { diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java index a269359b73..6800228f0f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.columnrow; import java.awt.BorderLayout; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ilable.UILabel; import javax.swing.JPanel; @@ -30,14 +31,14 @@ public class ColumnRowVerticalPane extends ColumnRowPane { initColSpinner(); colPane.add(columnSpinner); - + JPanel rowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); pane.add(rowPane); rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") + ":")); initRowSpinner(); rowPane.add(rowSpinner); - + BidiUtils.applyOrientationByLocale(colPane, rowPane); this.addDocumentListener(d); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index 37fef509db..1dccf84b3f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.controlpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.controlpane.shortcutfactory.AbstractShortCutFactory; import com.fr.design.gui.controlpane.shortcutfactory.OldShortCutFactory; @@ -106,7 +107,7 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S this.creators = this.createNameableCreators(); initCardPane(); // SplitPane - JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane); + JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, BidiUtils.applyOrientationByLocale(getLeftPane()), cardPane); mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor())); mainSplitPane.setOneTouchExpandable(true); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index dfece2e133..8de29491e5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.controlpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icontainer.UIScrollPane; @@ -363,11 +364,12 @@ public abstract class JListControlPane extends JControlPane implements ListContr this.textLabel.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 1)); this.iconLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 0)); add(this.textLabel, BorderLayout.CENTER); - add(this.iconLabel, BorderLayout.WEST); + add(this.iconLabel, BorderLayout.LINE_START); this.iconLabel.setBackground(Color.WHITE); //iconLabel和textLabel的背景颜色不会被JList背景颜色覆盖,开发者自定义 this.textLabel.setOpaque(true); this.iconLabel.setOpaque(true); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 12f904922d..5e0aed3c6a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.controlpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; @@ -175,8 +176,8 @@ public abstract class UIControlPane extends JControlPane { toolBarPane.add(topToolBar, BorderLayout.NORTH); JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - leftTopPane.add(toolBarPane, BorderLayout.EAST); - leftTopPane.add(addItemLabel, BorderLayout.CENTER); + leftTopPane.add(toolBarPane, BorderLayout.LINE_END); + leftTopPane.add(addItemLabel, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.CENTER); return leftTopPane; } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java index ebe6abb672..c80c92bcc8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; @@ -68,13 +69,13 @@ public abstract class EditingStringListPane extends BasicBeanPane> eastPane.add(removeButton); eastPane.add(moveUpButton); eastPane.add(moveDownButton); - this.add(GUICoreUtils.createBorderPane(eastPane, BorderLayout.NORTH), BorderLayout.EAST); + this.add(GUICoreUtils.createBorderPane(eastPane, BorderLayout.NORTH), BorderLayout.LINE_END); JPanel centerPane = new JPanel(new BorderLayout(0, 5)); this.add(centerPane, BorderLayout.CENTER); JPanel northcenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northcenterPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); - northcenterPane.add(addButton, BorderLayout.EAST); + northcenterPane.add(addButton, BorderLayout.LINE_END); centerPane.add(northcenterPane, BorderLayout.NORTH); centerPane.add(new JScrollPane(jlist), BorderLayout.CENTER); @@ -82,6 +83,7 @@ public abstract class EditingStringListPane extends BasicBeanPane> this.addButton.setEnabled(false); this.checkEnableState(); + BidiUtils.applyOrientationByLocale(this); } private void addListener() { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java index e946ad4f94..a491cce4ef 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java @@ -30,7 +30,7 @@ public class ObjectProperiesPane extends BasicBeanPane { JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + " " +com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")); - buttonPane.add(this.addButton, BorderLayout.WEST); + buttonPane.add(this.addButton, BorderLayout.LINE_START); this.add(buttonPane, BorderLayout.NORTH); this.addButton.addActionListener(new ActionListener() { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java index 38e33514bc..895a260205 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.ErrorMsgTextFieldAdapter; import com.fr.design.beans.UITextFieldAdapter; @@ -84,7 +85,7 @@ public class RegFieldPane extends RegPane { UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); tipLabel.setPreferredSize(new Dimension(60, 20)); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, errorMsgTextFieldAdapter.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM); - this.add(panel); + this.add(BidiUtils.applyOrientationByLocale(panel)); } private void initRegErrorMsgField() { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java index ea92ee73ce..2b684d6851 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; @@ -91,6 +92,7 @@ public class RegPane extends BasicPane { centerPane.add(cardPane, BorderLayout.NORTH); jPanel.add(centerPane, BorderLayout.CENTER); this.add(jPanel, BorderLayout.NORTH); + BidiUtils.applyOrientationByLocale(this); regComboBox.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { RegExp regExp = (RegExp)regComboBox.getSelectedItem(); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java index 37bd82bfc5..dba9dcb92f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java @@ -5,6 +5,7 @@ package com.fr.design.gui.frpane; import com.fr.base.Parameter; import com.fr.base.core.KV; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.BasicPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -81,6 +82,7 @@ public class ReportletParameterViewPane extends BasicPane { } this.add(editorPane, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java index 27cff9c5e3..3079c28782 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.general.ComparatorUtils; @@ -25,6 +26,7 @@ public class UITabbedPane extends JTabbedPane{ public UITabbedPane() { super(); + BidiUtils.setOrientationByLocale(this); } public UITabbedPane(int tabPlacement) { diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java index e6130ca3da..c205f66f2b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java @@ -1,5 +1,6 @@ package com.fr.design.gui.icombobox; +import com.fr.base.i18n.BidiUtils; import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.UIObserver; @@ -71,6 +72,7 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser setRenderer(new UIComboBoxRenderer()); setEditor(new UIComboBoxEditor()); initListener(); + BidiUtils.applyOrientationByLocale(this); } protected void initListener() { diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxUI.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxUI.java index d4de4e8501..ed8720bb2b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxUI.java @@ -1,5 +1,6 @@ package com.fr.design.gui.icombobox; +import com.fr.base.i18n.BidiUtils; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; @@ -96,7 +97,8 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener { } g2d.setColor(linecolor); if (!comboBox.isPopupVisible()) { - g2d.drawRoundRect(0, 0, c.getWidth() - arrowButton.getWidth() + 3, c.getHeight() - 1, UIConstants.ARC, UIConstants.ARC); + int width = BidiUtils.rtl() ? c.getWidth() : c.getWidth() - arrowButton.getWidth() + 3; + g2d.drawRoundRect(0, 0, width, c.getHeight() - 1, UIConstants.ARC, UIConstants.ARC); } else { g2d.drawRoundRect(0, 0, c.getWidth(), c.getHeight() + 3, UIConstants.ARC, UIConstants.ARC); g2d.drawLine(0, c.getHeight() - 1, c.getWidth(), c.getHeight() - 1); diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index cec4b840a7..090fb2ab5e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -1,6 +1,7 @@ package com.fr.design.gui.icontainer; +import com.fr.base.i18n.BidiUtils; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; @@ -177,13 +178,19 @@ public class UIEastResizableContainer extends JPanel { if (topToolPane == null || rightPane == null) { return; } - -// topToolPane.setBounds(0, 0, containerWidth, topToolPaneHeight);//0,0,10,462 - topToolPane.setBounds(0, 0, leftPaneWidth, topToolPaneHeight);//0,0,10,462 - leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight); + if (BidiUtils.rtl()) { + topToolPane.setBounds(containerWidth - leftPaneWidth, 0, leftPaneWidth, topToolPaneHeight); + leftPane.setBounds(containerWidth - leftPaneWidth, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight); + rightPane.setBounds(0, 0, containerWidth - leftPaneWidth, getHeight()); + } else { + // topToolPane.setBounds(0, 0, containerWidth, topToolPaneHeight);//0,0,10,462 + topToolPane.setBounds(0, 0, leftPaneWidth, topToolPaneHeight);//0,0,10,462 + leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight); // parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());//10,0,230,462 - rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0 + rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0 + } + } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java b/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java index d6a7952757..f47ccfc8b7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ilable; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.core.UITextComponent; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -27,19 +28,23 @@ public class UILabel extends JLabel implements UITextComponent { if (image != null && text != null) { setIconTextGap(4); } + adjustLabelTextForRTL(); } public UILabel(String text, int horizontalAlignment) { super(text, horizontalAlignment); + adjustLabelTextForRTL(); } public UILabel(String text) { super(text); + adjustLabelTextForRTL(); } public UILabel(String text, boolean enable) { super(text); this.setEnabled(enable); + adjustLabelTextForRTL(); } public UILabel(Icon image, int horizontalAlignment) { @@ -64,6 +69,27 @@ public class UILabel extends JLabel implements UITextComponent { return preferredSize; } + /** + * 调整label的名称以适配RTL + *

+ * 代码中有大量的国际化文本拼接冒号或者其他硬编码字符串创建Label的行为,RTL时名称需要分段反转,把一部分放在UILabel构造方法中进行调整,目前处理的场景如下: + *

    + *
  • label名+冒号(:)
  • + *
  • Item 2
  • + *
  • Item 3
  • + *
+ */ + private void adjustLabelTextForRTL() { + if (!BidiUtils.rtl()) { + return; + } + String text = this.getText(); + if (StringUtils.isNotEmpty(text) && text.length() > 1 && text.charAt(text.length() - 1) == ':') { + text = ":" + text.substring(0, text.length() - 1); + this.setText(text); + } + } + public static void main(String[] args) { // UILabel label = new UILabel("shishi",SwingConstants.LEFT); JFrame frame = new JFrame("Test"); diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuEastAttrItem.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuEastAttrItem.java index 0df132caf4..ad1c35021d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuEastAttrItem.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuEastAttrItem.java @@ -1,5 +1,6 @@ package com.fr.design.gui.imenu; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.stable.Constants; @@ -78,7 +79,7 @@ public class UIMenuEastAttrItem extends JMenuItem { protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { ButtonModel model = menuItem.getModel(); FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); - + int startX = BidiUtils.rtl() ? textRect.x + 25 : 0; if(!model.isEnabled()) { // *** paint the text disabled if ( UIManager.get("MenuItem.disabledForeground") instanceof Color ) { @@ -97,7 +98,7 @@ public class UIMenuEastAttrItem extends JMenuItem { } else { menuItem.setForeground(isArmed() ? Color.white : Color.black); SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, - -1, 0, textRect.y + fm.getAscent()); + -1, startX , textRect.y + fm.getAscent()); } } } diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java index 0d883abfbf..c5217331c0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java @@ -1,5 +1,6 @@ package com.fr.design.gui.imenu; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.stable.Constants; @@ -34,20 +35,20 @@ public class UIMenuItemUI extends BasicMenuItemUI { g.setColor(UIConstants.NORMAL_BACKGROUND); g.fillRect(0, 0, menuWidth, menuHeight); + int bidiX = BidiUtils.rtl() ? 5 : 30; if (menuItem.isOpaque()) { if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); } else { - GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); + GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, menuWidth - 30, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); } g.setColor(oldColor); - } else if (model.isArmed() || (menuItem instanceof JMenu && - model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + } else if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); g.setColor(oldColor); } } - + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { ButtonModel model = menuItem.getModel(); FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuUI.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuUI.java index d9ed88ffee..82db031c6d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuUI.java @@ -1,5 +1,6 @@ package com.fr.design.gui.imenu; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUIPaintUtils; @@ -17,11 +18,12 @@ public class UIMenuUI extends BasicMenuUI { Color oldColor = g.getColor(); int menuWidth = menuItem.getWidth(); int menuHeight = menuItem.getHeight(); + int bidiX = BidiUtils.rtl() ? 5 : 30; if (menuItem.isOpaque()) { if (menuItem.getParent() instanceof JPopupMenu && model.isSelected()) { g.setColor(UIConstants.UI_MENU_BACKGOURND); g.fillRect(0, 0, menuWidth, menuHeight); - GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); } else if (model.isSelected()) { paintPressed(g, menuWidth, menuHeight); } else { @@ -54,7 +56,7 @@ public class UIMenuUI extends BasicMenuUI { ButtonModel model = menuItem.getModel(); FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); int mnemIndex = -1; - + BidiUtils.applyOrientationByLocale(menuItem); if (!model.isEnabled()) { // *** paint the text disabled if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java index aca38b28d2..acda647b8a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.itableeditorpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; @@ -58,8 +59,8 @@ public class UITableEditorPane extends BasicPane { pane.add(scrollPane, BorderLayout.CENTER); initbuttonPane(action); JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - controlPane.add(buttonPane, BorderLayout.EAST); - controlPane.add(l, BorderLayout.WEST); + controlPane.add(buttonPane, BorderLayout.LINE_END); + controlPane.add(l, BorderLayout.LINE_START); pane.add(controlPane, BorderLayout.NORTH); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/UITreeUI.java b/designer-base/src/main/java/com/fr/design/gui/itree/UITreeUI.java index a4d66c4384..6cfab31338 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/UITreeUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/UITreeUI.java @@ -1,6 +1,7 @@ package com.fr.design.gui.itree; import com.fr.base.BaseUtils; +import com.fr.base.i18n.BidiUtils; import com.fr.base.svg.IconUtils; import com.fr.design.utils.ThemeUtils; @@ -29,7 +30,7 @@ public class UITreeUI extends MetalTreeUI { protected void installDefaults() { super.installDefaults(); setExpandedIcon(IconUtils.readIcon("/com/fr/design/standard/fileicon/minus.svg")); - setCollapsedIcon(IconUtils.readIcon("/com/fr/design/standard/fileicon/plus.svg")); + setCollapsedIcon(BidiUtils.rtl() ? IconUtils.readIcon("/com/fr/design/standard/fileicon/left.svg") : IconUtils.readIcon("/com/fr/design/standard/fileicon/plus.svg")); if (tree.getCellRenderer() instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer r = (DefaultTreeCellRenderer) tree.getCellRenderer(); r.setBackgroundNonSelectionColor(ThemeUtils.TEXT_BG_COLOR); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java index 0b8e8287ab..422845b4cf 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java @@ -4,6 +4,7 @@ import com.fr.base.CoreDecimalFormat; import com.fr.base.GraphHelper; import com.fr.base.Style; import com.fr.base.TextFormat; +import com.fr.base.i18n.BidiUtils; import com.fr.data.core.FormatField; import com.fr.data.core.FormatField.FormatContents; import com.fr.design.border.UIRoundedBorder; @@ -139,7 +140,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName protected void initLayout() { JPanel labeledFormatTypeComboBoxPane = new JPanel(new BorderLayout(20, 0)); - labeledFormatTypeComboBoxPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format")), BorderLayout.WEST); + labeledFormatTypeComboBoxPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format")), BorderLayout.LINE_START); labeledFormatTypeComboBoxPane.add(typeComboBox, BorderLayout.CENTER); JPanel labeledRoundingCheckboxPane = new JPanel(new BorderLayout(0, 0)); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java index 42f13ceed5..1178120938 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -1,6 +1,7 @@ package com.fr.design.hyperlink; import com.fr.base.Utils; +import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; @@ -74,8 +75,8 @@ public abstract class AbstractHyperNorthPane extends BasicB newWindowConfPane.add(widthTextFiled); JPanel centerPanel = new JPanel(new BorderLayout()); - centerPanel.add(targetFramePanel, BorderLayout.WEST); - centerPanel.add(newWindowConfPane, BorderLayout.EAST); + centerPanel.add(targetFramePanel, BorderLayout.LINE_START); + centerPanel.add(newWindowConfPane, BorderLayout.LINE_END); newWindowConfPane.setVisible(false); centerPane.add(centerPanel); @@ -87,6 +88,7 @@ public abstract class AbstractHyperNorthPane extends BasicB }); this.add(this.setFootPanel(), BorderLayout.SOUTH); + BidiUtils.applyOrientationByLocale(this); } protected String[] getTargetFrames() { diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index 8fa88e9293..5e0ed5ae02 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -148,7 +148,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane { urlTextField = new UITextField(headerPane.getWidth()); urlTextField.setText(ProductConstants.WEBSITE_URL); - JPanel urlWithHelp = GUICoreUtils.createNamedPane(urlTextField, "URL:"); + JPanel urlWithHelp = GUICoreUtils.createNamedPane(urlTextField, BidiUtils.concatenateStrings("URL", ":")); if (this.needRenamePane) { headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_SMALL)); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/WebHyperlinkPane.java index 2975e7c343..ca72eb3449 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -1,6 +1,7 @@ package com.fr.design.hyperlink; import com.fr.base.Parameter; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -45,7 +46,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Parameters"), null)); extendParametersCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters")); - this.add(GUICoreUtils.createFlowPane(new Component[]{extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH); + this.add(GUICoreUtils.createFlowPane(new Component[]{extendParametersCheckBox}, FlowLayout.LEADING), BorderLayout.SOUTH); } @Override diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java index 848ac9e57c..ada4b6a18a 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java @@ -3,6 +3,7 @@ package com.fr.design.hyperlink.popup; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.base.Parameter; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.TinyFormulaPane; @@ -73,6 +74,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane { this.add(typePane, BorderLayout.NORTH); stylePane = this.createStylePane(); this.add(stylePane, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } private JPanel createTypePane() { JPanel typePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); popupTypeLabel = new UILabel(""); - typePane.add(popupTypeLabel, BorderLayout.CENTER); + typePane.add(popupTypeLabel, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.CENTER); return MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Type"), typePane); } diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 31c45da762..a01efd9e9f 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -1,5 +1,6 @@ package com.fr.design.javascript; +import com.fr.base.i18n.BidiUtils; import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.border.UIRoundedBorder; @@ -96,6 +97,7 @@ public class JSContentPane extends BasicPane { private void addNewPaneLabel(){ UILabel advancedEditorLabel = new UILabel(Toolkit.i18nText("Fine-Design_Advanced_Editor"), IconUtils.readIcon("com/fr/design/images/edit/advancedEditor.svg"), SwingConstants.LEFT); + BidiUtils.applyOrientationByLocale(advancedEditorLabel); advancedEditorLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); advancedEditorLabel.addMouseListener(new MouseAdapter() { @@ -129,7 +131,7 @@ public class JSContentPane extends BasicPane { advancedEditorDialog.requestFocus(); } }); - labelPane.add(advancedEditorLabel,BorderLayout.EAST); + labelPane.add(advancedEditorLabel, BorderLayout.LINE_END); } protected UIScrollPane createContentTextAreaPanel(){ @@ -160,6 +162,7 @@ public class JSContentPane extends BasicPane { protected JPanel createJSParaPane(){ UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Format_JavaScript"), IOUtils.readIcon("com/fr/design/images/edit/format.png"), SwingConstants.LEFT); + BidiUtils.applyOrientationByLocale(label); label.setCursor(new Cursor(Cursor.HAND_CURSOR)); label.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Format_JavaScript")); label.addMouseListener(new MouseAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 37bca2f6eb..6a6d3d6618 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -1,6 +1,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; +import com.fr.base.i18n.BidiUtils; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.frpane.ReportletParameterViewPane; @@ -9,6 +10,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.hyperlink.AbstractHyperLinkPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.javascript.jsapi.JSImplPopulateAction; import com.fr.design.javascript.jsapi.JSImplUpdateAction; import com.fr.design.mainframe.DesignerContext; @@ -20,6 +22,7 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.border.TitledBorder; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import java.awt.BorderLayout; @@ -67,7 +70,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { importedJsPane.setPreferredSize(new Dimension(265, 150)); jsPane = createJSContentPane(defaultArgs); - jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"))); + jsPane.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Toolkit.i18nText("Fine-Design_Report_JavaScript")))); parameterPane.setPreferredSize(new Dimension(265, 150)); JPanel topPane = new JPanel(new GridLayout(1,2)); @@ -143,7 +146,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { }; UITableEditorPane importedJsPane = new UITableEditorPane(model); importedJsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"))); - return importedJsPane; + return BidiUtils.applyOrientationByLocale(importedJsPane); } /** diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index 417533465d..4c40fb5e28 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -33,21 +33,21 @@ public class FRGUIPaneFactory { public static final int HEIGHT_OFFSET = 50; /** - * 创建一个靠右靠左的水平间隙为2的流式布局 + * 创建一个靠左的水平间隙为2的流式布局,支持RTL * * @return FlowLayout对象 */ public static LayoutManager createBoxFlowLayout() { // createBoxFlowLayout 图表用到的比较多 - return new FlowLayout(FlowLayout.LEFT, 2, 0); + return new FlowLayout(FlowLayout.LEADING, 2, 0); } /** - * 创建一个靠左的布局 + * 创建一个靠左的布局,支持RTL * * @return FlowLayout对象 */ public static LayoutManager createLeftZeroLayout() { - return new FlowLayout(FlowLayout.LEFT, 0, 0); + return new FlowLayout(FlowLayout.LEADING, 0, 0); } /** @@ -70,12 +70,12 @@ public class FRGUIPaneFactory { } /** - * 创建一个靠左的水平和垂直间隙均为5的流式布局 + * 创建一个靠左的水平和垂直间隙均为5的流式布局,支持RTL * * @return FlowLayout对象 */ - public static LayoutManager createLabelFlowLayout() { // createLabelFlowLayout - return new FlowLayout(FlowLayout.LEFT); // 默认 5, 5 + public static LayoutManager createLabelFlowLayout() { + return new FlowLayout(FlowLayout.LEADING); // 默认 5, 5 } /** @@ -200,7 +200,7 @@ public class FRGUIPaneFactory { } /** - * 创建一个带标题边框面板 + * 创建一个带标题边框面板,支持rtl * * @param string 边框标题 * @return JPanel对象 @@ -209,12 +209,12 @@ public class FRGUIPaneFactory { JPanel jp = new JPanel(); UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); jp.setBorder(explainBorder); - jp.setLayout(new FlowLayout(FlowLayout.LEFT)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING)); return jp; } /** - * 创建一个无间隔带标题边框面板 + * 创建一个无间隔带标题边框面板,支持rtl * * @param string 边框标题 * @return JPanel对象 @@ -223,7 +223,7 @@ public class FRGUIPaneFactory { JPanel jp = new JPanel(); UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); jp.setBorder(explainBorder); - jp.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); return jp; } @@ -334,48 +334,48 @@ public class FRGUIPaneFactory { } /** - * 创建一个正常靠左空边框面板 + * 创建一个正常靠左空边框面板,支持RTL * * @return JPanel对象 */ public static JPanel createNormalFlowInnerContainer_M_Pane() { JPanel jp = new JPanel(); jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); - jp.setLayout(new FlowLayout(FlowLayout.LEFT)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING)); return jp; } /** - * 创建一个靠左0间距边框面板 + * 创建一个靠左0间距边框面板,支持RTL * * @return JPanel对象 */ public static JPanel createLeftFlowZeroGapBorderPane() { JPanel jp = new JPanel(); jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - jp.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); return jp; } /** - * 创建一个靠左流式布局,正常流式内嵌 + * 创建一个流式布局,正常流式内嵌,支持RTL * * @return JPanel对象 */ public static JPanel createNormalFlowInnerContainer_S_Pane() { JPanel jp = new JPanel(); - jp.setLayout(new FlowLayout(FlowLayout.LEFT)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING)); return jp; } /** - * 创建一个靠左流式布局,流式内嵌 + * 创建一个靠左流式布局,流式内嵌,支持RTL * * @return JPanel对象 */ public static JPanel createBoxFlowInnerContainer_S_Pane() { JPanel jp = new JPanel(); - jp.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, 2, 2)); return jp; } @@ -406,7 +406,7 @@ public class FRGUIPaneFactory { } /** - * 创建一个靠左的水平流式布局 + * 创建一个靠左的水平流式布局,支持RTL * @param hgap 水平间距 * @param vgap 竖直间距 * @return JPanel对象 @@ -414,20 +414,20 @@ public class FRGUIPaneFactory { public static JPanel createBoxFlowInnerContainer_S_Pane(int hgap, int vgap) { JPanel jp = new JPanel(); jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - jp.setLayout(new FlowLayout(FlowLayout.LEFT, hgap, vgap)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, hgap, vgap)); return jp; } /** - * 创建一个靠右面板 + * 创建一个靠右面板,支持RTL * * @return JPanel对象 */ public static JPanel createRightFlowInnerContainer_S_Pane() { JPanel jp = new JPanel(); - jp.setLayout(new FlowLayout(FlowLayout.RIGHT)); + jp.setLayout(new FlowLayout(FlowLayout.TRAILING)); return jp; } diff --git a/designer-base/src/main/java/com/fr/design/layout/FRLeftFlowLayout.java b/designer-base/src/main/java/com/fr/design/layout/FRLeftFlowLayout.java index 23003eeff3..bb530b4fcf 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRLeftFlowLayout.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRLeftFlowLayout.java @@ -18,7 +18,7 @@ public class FRLeftFlowLayout extends FlowLayout { public void layoutContainer(Container target) { synchronized (target.getTreeLock()) { Insets insets = target.getInsets(); - int maxwidth = target.getWidth() - (insets.left + insets.right + getHgap()*2); + int maxwidth = target.getPreferredSize().width - (insets.left + insets.right + getHgap()*2); int nmembers = target.getComponentCount(); int x = 0, y = insets.top + getVgap(); int rowh = 0, start = 0; diff --git a/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java b/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java index e664524026..05db2e7586 100644 --- a/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java +++ b/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java @@ -1,6 +1,7 @@ package com.fr.design.layout; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; @@ -252,6 +253,7 @@ public class TableLayoutHelper { } } } + BidiUtils.applyOrientationByLocale(resultPane); } diff --git a/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java b/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java index 9f91fee506..508abfadde 100644 --- a/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java +++ b/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java @@ -381,7 +381,6 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { synchronized (target.getTreeLock()) { switch (newAlign) { case TOP: - y += ltr ? 0 : height; break; case CENTER: y += height / 2; @@ -397,7 +396,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { if (ltr) { m.setLocation(isAlignLeft ? x : newX, y); } else { - m.setLocation(isAlignLeft ? x : newX, target.getHeight() - y - m.getHeight()); + m.setLocation(isAlignLeft ? target.getWidth() - m.getWidth() - x : newX, y); } y += m.getHeight() + vgap; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index 3cceff5a75..382e22512f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignState; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; @@ -81,7 +82,7 @@ public class CenterRegionContainerPane extends JPanel { }; toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout()); eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BorderLayout.WEST); + eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BorderLayout.LINE_END); eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); combineUpTooBar(); eastCenterPane.add(combineUp, BorderLayout.NORTH); @@ -108,9 +109,9 @@ public class CenterRegionContainerPane extends JPanel { * 创建上工具栏 */ private void combineUpTooBar() { - combineUp = new UIToolbar(FlowLayout.LEFT); + combineUp = new UIToolbar(FlowLayout.LEADING); combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR)); - combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2)); + combineUp.setLayout(new FlowLayout(FlowLayout.LEADING, 5, 2)); setUpUpToolBar(null); } @@ -229,7 +230,7 @@ public class CenterRegionContainerPane extends JPanel { } // 颜色,字体那些按钮的工具栏 - toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); + toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.CENTER); JPanel customNorthPane = strategy.customNorthPane(toolbarPane,plus); if (!isExist(customNorthPane)){ this.removeNorth(); @@ -275,9 +276,8 @@ public class CenterRegionContainerPane extends JPanel { //移除新建模板按钮 templateTabPane.remove(newWorkBookPane); } else { - eastPane.add(largeToolbar, BorderLayout.WEST); - templateTabPane.add(newWorkBookPane, BorderLayout.WEST); - + eastPane.add(largeToolbar, BorderLayout.LINE_START); + templateTabPane.add(newWorkBookPane, BorderLayout.LINE_START); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e20debacb7..526b7318ba 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -5,6 +5,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.OptimizeUtil; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -75,6 +76,7 @@ import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.WindowConstants; import java.awt.BorderLayout; +import java.awt.ComponentOrientation; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Point; @@ -266,7 +268,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta basePane.add(CenterRegionContainerPane.getInstance(), BorderLayout.CENTER); laoyoutWestPane(); - basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); + basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.LINE_END); basePane.setBounds(0, 0, contentWidth, contentHeight); // 数值越小。越在底层 @@ -310,6 +312,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true)); closeMode = UIConstants.CLOSE_OF_AUTHORITY; initMenuPane(); + BidiUtils.applyOrientationByLocale(this); } public void resizeFrame() { @@ -477,7 +480,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta protected void laoyoutWestPane() { - basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.WEST); + basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.LINE_START); } // 调整windows大小 @@ -820,7 +823,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta DesignerOpenEmptyPanel designerOpenEmptyPanel = new DesignerOpenEmptyPanel(); BorderLayout layout = (BorderLayout) basePane.getLayout(); basePane.remove(layout.getLayoutComponent(BorderLayout.CENTER)); - basePane.remove(layout.getLayoutComponent(BorderLayout.EAST)); + basePane.remove(layout.getLayoutComponent(BorderLayout.LINE_END)); basePane.add(designerOpenEmptyPanel, BorderLayout.CENTER); resetToolkitByPlus(ToolBarMenuDock.NULLAVOID); @@ -974,10 +977,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta basePane.add(center, BorderLayout.CENTER); } if (west != null) { - basePane.add(west, BorderLayout.WEST); + basePane.add(west, BorderLayout.LINE_START); } if (east != null) { - basePane.add(east, BorderLayout.EAST); + basePane.add(east, BorderLayout.LINE_END); } jTemplate.setComposite(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 1357b48354..8604fbbfa0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; +import com.fr.base.i18n.BidiUtils; import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; @@ -1189,7 +1190,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { @Override public void mouseClicked(MouseEvent e) { - if (e.getX() >= ARROW_RANGE_START) { + if ((BidiUtils.rtl() && e.getX() <= 30) || (!BidiUtils.rtl() && e.getX() >= ARROW_RANGE_START)) { onPop(); } } @@ -1204,7 +1205,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { @Override public void mousePressed(MouseEvent e) { - if (e.getX() < ARROW_RANGE_START) { + if ((BidiUtils.rtl() && e.getX() > 30) || (!BidiUtils.rtl() && e.getX() < ARROW_RANGE_START)) { mouseDownCompCoords = e.getPoint(); } } @@ -1213,7 +1214,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private MouseMotionListener mouseMotionListener = new MouseMotionListener() { @Override public void mouseMoved(MouseEvent e) { - if (e.getX() >= ARROW_RANGE_START) { + if ((BidiUtils.rtl() && e.getX() <= 30) || (!BidiUtils.rtl() && e.getX() >= ARROW_RANGE_START)) { setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } else if (isMovable) { setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); @@ -1266,7 +1267,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { contentPane.setBackground(originColor); contentPane.setLayout(new BorderLayout()); UILabel label = new UILabel(title); - contentPane.add(label, BorderLayout.WEST); + contentPane.add(label, BorderLayout.LINE_START); contentPane.setBorder(new EmptyBorder(5, 10, 5, 0)); setLayout(new BorderLayout()); @@ -1321,7 +1322,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } else { button = UIConstants.POP_BUTTON_UP; } - SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, (ARROW_RANGE_START + 8), 4, null)); + SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, BidiUtils.rtl() ? 0 : ARROW_RANGE_START + 8, 4, null)); } } @@ -1375,8 +1376,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public void adjustLocation() { + this.setLocation( - getLeftPane().getLocationOnScreen().x - CONTENT_WIDTH, + BidiUtils.rtl() ? getLeftPane().getLocationOnScreen().x : getLeftPane().getLocationOnScreen().x - CONTENT_WIDTH, DesignerContext.getDesignerFrame().getLocationOnScreen().y + 228 ); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java index d850e8e814..768ba650d9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -67,7 +68,7 @@ public class NorthRegionContainerPane extends JPanel { this.setLayout(new BorderLayout()); this.add(new UIMenuHighLight(), BorderLayout.SOUTH); - this.add(initNorthEastPane(ad), BorderLayout.EAST); + this.add(initNorthEastPane(ad), BorderLayout.LINE_END); } /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java index 004fbd55a3..1cccd53f06 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; @@ -11,7 +12,6 @@ import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; -import com.fr.stable.Constants; public class WestRegionContainerPane extends UIResizableContainer { @@ -31,7 +31,7 @@ public class WestRegionContainerPane extends UIResizableContainer { } public WestRegionContainerPane() { - super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT); + super(DesignerFrameFileDealerPane.getInstance(), BidiUtils.rtl() ? com.fr.stable.Constants.LEFT : com.fr.stable.Constants.RIGHT); setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); 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 8274b65355..3fe98dfa92 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 @@ -1,5 +1,6 @@ package com.fr.design.mainframe.check; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.ibutton.UIButton; 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(bottomPanel, BorderLayout.SOUTH); this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse")); - + BidiUtils.applyOrientationByLocale(this); GUICoreUtils.centerWindow(this); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java index fded318188..754a0dfc54 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.loghandler; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.stable.StringUtils; @@ -52,6 +53,7 @@ public class LogMessageBar extends JPanel { return; } dlg = new LogDetailPane().showDialog(); + BidiUtils.applyOrientationByLocale(dlg); dlg.setVisible(true); } }); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java index ee9b861b1e..2aa6ee8c17 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.manager.search.searcher.control.pane; +import com.fr.base.i18n.BidiUtils; import com.fr.base.svg.IconUtils; import com.fr.design.constants.UIConstants; import com.fr.design.search.event.TreeSearchStatusChangeEvent; @@ -92,6 +93,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS add(contentPane, BorderLayout.CENTER); setPreferredSize(new Dimension(240, 30)); TemplateTreeSearchManager.getInstance().registerTreeSearchStatusChangeListener(this); + BidiUtils.applyOrientationByLocale(this); } private void initContentPane() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java index 5432109dc0..df6218242f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.fr.base.i18n.BidiUtils; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; @@ -147,7 +148,7 @@ public abstract class TemplateThemeEditorPane extends J JPanel borderContainer = new JPanel(new BorderLayout()); borderContainer.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Title"))); borderContainer.add(content); - + BidiUtils.setOrientationByLocale(borderContainer); JPanel container = new JPanel(new BorderLayout()); container.add(borderContainer, BorderLayout.CENTER); @@ -183,7 +184,7 @@ public abstract class TemplateThemeEditorPane extends J uiTabbedPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 1)); container.add(uiTabbedPane, BorderLayout.CENTER); initPluginListener(); - return container; + return BidiUtils.setOrientationByLocale(container); } public void addCustomEditorPane(String title, final Component component) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java index cdbd6d10f2..47c3a824e8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.fr.base.i18n.BidiUtils; import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormThemeConfig; import com.fr.base.theme.ReportTheme; @@ -180,7 +181,7 @@ public class TemplateThemeGridControlPane extends Basic content.setPreferredSize(new Dimension(content.getPreferredSize().width, 20)); UIToolbar toolBar = ToolBarDef.createJToolBar(); - toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + toolBar.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); content.add(toolBar, BorderLayout.CENTER); MenuDef addMenuDef = createAddMenuDef(); @@ -207,7 +208,7 @@ public class TemplateThemeGridControlPane extends Basic } } }); - content.add(setTheme4NewTemplateButton, BorderLayout.EAST); + content.add(setTheme4NewTemplateButton, BorderLayout.LINE_END); JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); container.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java index 36e962c6af..307f5c37af 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.theme; import com.fr.base.ScreenResolution; +import com.fr.base.i18n.BidiUtils; import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormThemeConfig; import com.fr.base.theme.ReportTheme; @@ -297,6 +298,7 @@ public class TemplateThemeGridPagesPane extends JPanel { if (config == reportThemesManagerPane.getConfig()) { tabbedPane.setSelectedIndex(1); } + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index c79ccd9090..7849976cdb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.fr.base.i18n.BidiUtils; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemeThumbnail; @@ -74,7 +75,7 @@ public abstract class TemplateThemeProfilePane extends setLayout(new BorderLayout(5, 0)); setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 6)); add(createLeftPane(), BorderLayout.CENTER); - add(createRightPane(), BorderLayout.EAST); + add(createRightPane(), BorderLayout.LINE_END); } @Override @@ -94,7 +95,7 @@ public abstract class TemplateThemeProfilePane extends themePreviewPane.setPreferredSize(new Dimension(PREVIEW_PANE_WIDTH, PREVIEW_PANE_HEIGHT)); previewContainer.add(themePreviewPane, BorderLayout.CENTER); - return titleContainer; + return BidiUtils.applyOrientationByLocale(titleContainer); } private JPanel createRightPane() { themeEditorPane = createThemeEditorPane(); @@ -383,8 +384,8 @@ public abstract class TemplateThemeProfilePane extends leftTitlePromptLabel = new UILabel(Toolkit.i18nText("Fine-Design_Theme_Control_PC_Prompt")); leftTitleLabel.setForeground(WidgetThemeDisplayConstants.THEME_PREVIEW_TITLE_COLOR); leftTitlePromptLabel.setForeground(WidgetThemeDisplayConstants.COMPATIBLE_STYLE_FONT_COLOR); - titlePane.add(leftTitleLabel, BorderLayout.WEST); - titlePane.add(leftTitlePromptLabel, BorderLayout.EAST); + titlePane.add(leftTitleLabel, BorderLayout.LINE_START); + titlePane.add(leftTitlePromptLabel, BorderLayout.LINE_END); return titlePane; } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java index fb1e3660b9..36aa88e2ab 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.theme.edit.chart; import com.fr.base.BaseUtils; import com.fr.base.FRContext; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserverListener; @@ -83,7 +84,7 @@ public class ChartFontPane extends BasicPane { double p = TableLayout.PREFERRED; double[] rows = {p, p, p}; double[] columnSize = {labelWidth, totalWidth}; - UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT); + UILabel text = new UILabel(getUILabelText(), SwingConstants.LEADING); Component[][] components = { new Component[]{null, null}, new Component[]{text, fontNameComboBox}, diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java index bc466972ef..654477a91a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.ui; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ilable.UILabel; import javax.swing.BorderFactory; @@ -23,7 +24,7 @@ public class BreadcrumbBar extends JPanel { private JButton currentCrumb; public BreadcrumbBar() { - setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); } public void addCrumb(final String text, final BreadcrumbBackListener backListener) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 3372e2ad13..deac118275 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -62,7 +62,6 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; -import com.fr.design.module.DesignModuleFactory; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.update.actions.SoftwareUpdateAction; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java index f7e2779a4e..c2e5b5728f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java @@ -1,7 +1,9 @@ package com.fr.design.mainframe.widget; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.general.FRFont; + import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; @@ -35,14 +37,25 @@ public class UITitleSplitLine extends JPanel { Dimension size = label.getPreferredSize(); int labelH = size.height; g.setColor(color); - g.drawLine(0, labelH / 2, OFFSETX, labelH / 2); - g.drawLine(OFFSETX + size.width + OFFSET * 2, labelH / 2, width, labelH / 2); - g.translate(OFFSETX + OFFSET, 0); - label.setFont(TITLE_FONT); - label.setForeground(TITLE_COLOR); - label.setSize(size.width, size.height); - label.paint(g); - g.translate(-OFFSETX - OFFSET, 0); + if (BidiUtils.rtl()) { + g.drawLine(0, labelH / 2, width - OFFSETX - size.width - OFFSET * 2, labelH / 2); + g.drawLine(width - OFFSETX, labelH / 2, width, labelH / 2); + g.translate(width - OFFSETX - size.width - OFFSET, 0); + label.setFont(TITLE_FONT); + label.setForeground(TITLE_COLOR); + label.setSize(size.width, size.height); + label.paint(g); + g.translate(-width + OFFSETX + size.width + OFFSET, 0); + } else { + g.drawLine(0, labelH / 2, OFFSETX, labelH / 2); + g.drawLine(OFFSETX + size.width + OFFSET * 2, labelH / 2, width, labelH / 2); + g.translate(OFFSETX + OFFSET, 0); + label.setFont(TITLE_FONT); + label.setForeground(TITLE_COLOR); + label.setSize(size.width, size.height); + label.paint(g); + g.translate(-OFFSETX - OFFSET, 0); + } } diff --git a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java index ee82d256ec..b8aaeded6c 100644 --- a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java @@ -25,6 +25,7 @@ import java.awt.event.ContainerListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.text.Bidi; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -240,7 +241,6 @@ public class MenuDef extends ShortCut { createdJMenu.getPopupMenu().addContainerListener(listener); } } - return createdJMenu; } @@ -490,6 +490,8 @@ public class MenuDef extends ShortCut { MenuDef.this.updatePopupMenu(popupMenu); GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height); } +// BidiUtils.applyOrientationByLocale(popupMenu); +// popupMenu.revalidate(); } }; diff --git a/designer-base/src/main/java/com/fr/design/menu/MenuKeySet.java b/designer-base/src/main/java/com/fr/design/menu/MenuKeySet.java index 20653e7982..5ac3c4b8ec 100644 --- a/designer-base/src/main/java/com/fr/design/menu/MenuKeySet.java +++ b/designer-base/src/main/java/com/fr/design/menu/MenuKeySet.java @@ -1,6 +1,8 @@ package com.fr.design.menu; +import com.fr.base.i18n.BidiUtils; + import javax.swing.*; /** @@ -27,7 +29,11 @@ public abstract class MenuKeySet { public abstract String getMenuName(); public String getMenuKeySetName(){ - return getMenuName()+ "(" +getMnemonic() + ")"; + return BidiUtils.concatenateStrings(getMenuName(), "(" + getMnemonic() + ")"); + } + + public String getMenuKeySetNameWithDot(){ + return BidiUtils.concatenateStrings(getMenuKeySetName(), "..."); } public abstract KeyStroke getKeyStroke(); diff --git a/designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java b/designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java index 8617ded9ba..6e1757e1fc 100644 --- a/designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java @@ -1,5 +1,6 @@ package com.fr.design.menu; +import com.fr.base.i18n.BidiUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.itoolbar.UIToolBarUI; @@ -43,7 +44,7 @@ public class ToolBarDef { * 一个static的方法生成一个JToolBar */ public static UIToolbar createJToolBar() { - UIToolbar toolbar = new UIToolbar(FlowLayout.LEFT); + UIToolbar toolbar = new UIToolbar(FlowLayout.LEADING); toolbar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); return toolbar; } diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index 82cf70372b..a32566da57 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -3,6 +3,7 @@ package com.fr.design.present; import java.awt.BorderLayout; import java.awt.event.ItemListener; +import com.fr.base.i18n.BidiUtils; import com.fr.base.present.DictPresent; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.data.tabledata.Prepare4DataSourceChange; @@ -21,6 +22,7 @@ public class DictPresentPane extends FurtherBasicBeanPane implement dictionaryPane = new DictionaryPane(); this.setLayout(new BorderLayout()); this.add(dictionaryPane, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java index 7781233aac..03ea9909e9 100644 --- a/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java +++ b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java @@ -1,6 +1,7 @@ package com.fr.design.report; import com.fr.base.Style; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.ImgChooseWrapper; import com.fr.design.gui.ibutton.UIButton; @@ -83,7 +84,7 @@ public class SelectImagePane extends BasicPane { previewOwnerPane.add(new JScrollPane(previewPane)); JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - previewContainerPane.add(selectFilePane, BorderLayout.EAST); + previewContainerPane.add(selectFilePane, BorderLayout.LINE_END); selectFilePane.setBorder(BorderFactory .createEmptyBorder(8, 2, 4, 0)); diff --git a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java index e06046e079..139909597a 100644 --- a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java +++ b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java @@ -1,6 +1,7 @@ package com.fr.design.report; import com.fr.base.BaseFormula; +import com.fr.base.i18n.BidiUtils; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.design.dialog.BasicPane; import com.fr.design.editor.editor.FormulaEditor; @@ -87,6 +88,7 @@ public class WatermarkPane extends BasicPane { JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); contentPane.add(leftPane, BorderLayout.CENTER); leftPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"), null)); + BidiUtils.setOrientationByLocale(leftPane); JPanel previewPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); leftPane.add(previewPaneWrapper, BorderLayout.CENTER); previewPaneWrapper.setBorder(BorderFactory.createEmptyBorder(2, 8, 4, 8)); @@ -95,7 +97,7 @@ public class WatermarkPane extends BasicPane { // 设置 JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - contentPane.add(rightPane, BorderLayout.EAST); + contentPane.add(rightPane, BorderLayout.LINE_END); rightPane.add(initRightPane(), BorderLayout.NORTH); } @@ -182,7 +184,7 @@ public class WatermarkPane extends BasicPane { UIScrollPane configPane = new UIScrollPane(rightContentPane); configPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"), null)); - return configPane; + return BidiUtils.setOrientationByLocale(configPane); } protected void populateFontSize(int fontSize) { diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index ba37ea18b7..e9d8ff90b8 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -43,7 +43,7 @@ public class ReportFitAttrAction extends JTemplateAction { private void initMenuStyle() { this.setMenuKeySet(REPORT_FIT_ATTR); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/reportfit/fit"); } diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java index 8854b0ee92..2d39c4a32a 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java @@ -1,5 +1,6 @@ package com.fr.design.report.fit.menupane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.design.report.fit.BaseFitAttrPane; @@ -30,6 +31,7 @@ public class TemplateFitAttrPane extends BaseFitAttrPane { break; } } + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java b/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java index e59ddfa579..4a5c8df8b4 100644 --- a/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java @@ -1,5 +1,6 @@ package com.fr.design.style; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; @@ -82,7 +83,7 @@ public abstract class AbstractSelectBox extends AbstractPopBox implements Mou triggleButton.addMouseListener(this); this.add(displayPane, BorderLayout.CENTER); - this.add(triggleButton, BorderLayout.EAST); + this.add(triggleButton, BorderLayout.LINE_END); this.addAncestorListener(new AncestorListener() { public void ancestorAdded(AncestorEvent event) { diff --git a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane4Browser.java b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane4Browser.java index d6cae505b5..67a7796b7a 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane4Browser.java +++ b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane4Browser.java @@ -1,5 +1,6 @@ package com.fr.design.style.background; +import com.fr.base.i18n.BidiUtils; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Background; @@ -11,6 +12,7 @@ public class BackgroundPane4Browser extends BackgroundPane { public BackgroundPane4Browser() { super(); + BidiUtils.applyOrientationByLocale(this); } protected void initTabPane() { diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java index 1cbf543a4b..7e1371b050 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java @@ -1,6 +1,7 @@ package com.fr.design.style.background.gradient; import com.fr.base.background.GradientBackground; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -72,6 +73,7 @@ public class GradientBackgroundPane extends BackgroundDetailPane { jpanel.add(centerPane, BorderLayout.CENTER); this.add(jpanel); + BidiUtils.applyOrientationByLocale(this); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java index 8f91686764..a21dc523b0 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java @@ -1,5 +1,6 @@ package com.fr.design.style.background.impl; +import com.fr.base.i18n.BidiUtils; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.BackgroundDetailPane; @@ -33,6 +34,7 @@ public abstract class BPane extends BackgroundDetailPane { setChildrenOfTypePane(typePane2); setChildrenOfContentPane(contentPane); + BidiUtils.applyOrientationByLocale(this); } protected abstract String titleOfTypePane(); diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java index 3eb990c318..295d6bc81f 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java @@ -3,6 +3,7 @@ package com.fr.design.style.background.impl; import com.fr.base.Style; import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageFileBackground; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.frpane.ImgChooseWrapper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; @@ -53,7 +54,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane { JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); previewOwnerPane.setLayout(new BorderLayout()); previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER); - previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST); + previewContainerPane.add(initSelectFilePane(), BorderLayout.LINE_END); previewPane = new ImagePreviewPane(); previewOwnerPane.add(new JScrollPane(previewPane)); previewPane.addChangeListener(imageSizeChangeListener); @@ -62,6 +63,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane { // init image file chooser. imageFileChooser = new ImageFileChooser(); imageFileChooser.setMultiSelectionEnabled(false); + BidiUtils.applyOrientationByLocale(this); } public JPanel initSelectFilePane() { diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java index 886076ca08..a30f971a18 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java @@ -72,13 +72,11 @@ public class PatternBackgroundPane extends BPane { backgroundColorPane.setSelectObject(Color.black); colorPane.add(Box.createHorizontalStrut(2)); - colorPane.add(this.createLabelColorPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Foreground") - + ":", foregroundColorPane)); + colorPane.add(this.createLabelColorPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Foreground") + ":", foregroundColorPane)); colorPane.add(Box.createHorizontalStrut(8)); - colorPane.add(this.createLabelColorPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background") - + ":", backgroundColorPane)); + colorPane.add(this.createLabelColorPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background") + ":", backgroundColorPane)); } private JPanel createLabelColorPane(String text, diff --git a/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java index 5d7e81487e..2f4ae67b25 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java @@ -6,6 +6,7 @@ package com.fr.design.style.color; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; @@ -13,6 +14,10 @@ import java.awt.geom.Rectangle2D; import javax.swing.BorderFactory; import javax.swing.Box; + +import com.fine.swing.ui.layout.Layouts; +import com.fine.swing.ui.layout.Row; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ilable.UILabel; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -22,6 +27,10 @@ import com.fr.base.GraphHelper; import com.fr.design.border.UITitledBorder; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicPane; +import com.fr.design.layout.FRLeftFlowLayout; + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.fix; /** @@ -42,7 +51,7 @@ public class DetailColorSelectPane extends BasicPane { JPanel titledefaultPane=FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color")); JPanel defaultPane =FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); - this.add(titledefaultPane, BorderLayout.WEST); + this.add(titledefaultPane, BorderLayout.LINE_START); titledefaultPane.add(defaultPane); defaultPane.add(Box.createHorizontalStrut(4)); @@ -56,7 +65,7 @@ public class DetailColorSelectPane extends BasicPane { //color preview JPanel colorPreviewContainPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); defaultPane.add(colorPreviewContainPane); - + BidiUtils.mirrorBoxLayout(defaultPane); JPanel colorPreviewPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); colorPreviewPane.setPreferredSize(new Dimension(180, 60)); colorPreviewContainPane.add(colorPreviewPane, BorderLayout.NORTH); @@ -83,6 +92,7 @@ public class DetailColorSelectPane extends BasicPane { //use the white as the default color. this.populate(Color.WHITE); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index e9c8b7a7d3..fb1e77869a 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -1,6 +1,7 @@ package com.fr.design.style.color; import com.fr.base.FineColor; +import com.fr.base.i18n.BidiUtils; import com.fr.base.theme.FineColorDeriveState; import com.fr.base.theme.TemplateTheme; import com.fr.design.DesignerEnvManager; @@ -98,7 +99,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { JPanel standardColorPane = new JPanel(new BorderLayout(0, 5)); standardColorPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); - standardColorPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Standard_Color")), BorderLayout.CENTER); + standardColorPane.add(createColorSelectPaneLabel(Toolkit.i18nText("Fine-Design_Basic_Standard_Color")), BorderLayout.CENTER); centerPane.add(standardColorPane); JPanel colorSelectPane = createStandardColorPane(); standardColorPane.add(colorSelectPane, BorderLayout.SOUTH); @@ -106,7 +107,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { // 增加最近使用 pane JPanel row1Pane = new JPanel(new BorderLayout(0, 5)); row1Pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); - row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER); + row1Pane.add(createColorSelectPaneLabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER); centerPane.add(row1Pane); // 最近使用 usedColorPane = new NewUsedColorPane(9, this, selectRealTime()); @@ -143,11 +144,17 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { return jPanel; } + private UILabel createColorSelectPaneLabel(String name) { + UILabel label = new UILabel(name); + label.setHorizontalAlignment(UILabel.TRAILING); + return label; + } + private JPanel initThemeColorPane() { menuColorPane.removeAll(); JPanel themeColorPane = new JPanel(new BorderLayout(0, 5)); themeColorPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - themeColorPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Theme_Color")), BorderLayout.CENTER); + themeColorPane.add(createColorSelectPaneLabel(Toolkit.i18nText("Fine-Design_Basic_Theme_Color")), BorderLayout.CENTER); themeColorPane.add(menuColorPane, BorderLayout.SOUTH); diff --git a/designer-base/src/main/java/com/fr/design/utils/LinkStrUtils.java b/designer-base/src/main/java/com/fr/design/utils/LinkStrUtils.java index 666d17b84a..bbee1f4643 100644 --- a/designer-base/src/main/java/com/fr/design/utils/LinkStrUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/LinkStrUtils.java @@ -53,6 +53,7 @@ public class LinkStrUtils { StringBuilder style = new StringBuilder("font-family:" + font.getFamily() + ";"); style.append("font-weight:").append(font.isBold() ? "bold" : "normal").append(";"); + //style.append("margin-bottom:").append("5px").append(";"); style.append("font-size:").append(font.getSize()).append("pt;"); style.append("color:rgb(").append(fontColor.getRed()).append(",").append(fontColor.getGreen()).append(",").append(fontColor.getBlue()).append(");"); style.append("background-color: rgb(").append(backgroundColor.getRed()).append(",").append(backgroundColor.getGreen()).append(",").append(backgroundColor.getBlue()).append(");"); diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 91661301f1..ca46bbf458 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -6,6 +6,7 @@ package com.fr.design.utils.gui; import com.fr.base.BaseUtils; import com.fr.base.Style; import com.fr.base.background.ColorBackground; +import com.fr.base.i18n.BidiUtils; import com.fr.data.util.function.AverageFunction; import com.fr.data.util.function.CountFunction; import com.fr.data.util.function.DataFunction; @@ -535,7 +536,7 @@ public final class GUICoreUtils { } /** - * 生成一个左边是名字,右边是comp的一个JPanel + * 生成一个左边是名字,右边是comp的一个JPanel,支持rtl * @param comp 组件 * @param name 名称 * @return 面板 @@ -544,7 +545,7 @@ public final class GUICoreUtils { JPanel mainPane = new JPanel(); mainPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - mainPane.add(new UILabel(name), BorderLayout.WEST); + mainPane.add(new UILabel(name), BorderLayout.LINE_START); mainPane.add(comp, BorderLayout.CENTER); return mainPane; @@ -671,7 +672,7 @@ public final class GUICoreUtils { } /** - * 生成一个边界布局的面板 + * 生成一个边界布局的面板,支持rtl * @param components 面板中的组件,第一个组件位置在中间,第二个组件位置再东边, * 第三个组件位置在南边,第四个组件位置在西边,第五个组件位置在北边 * @return 具有边界布局的容器 @@ -685,7 +686,7 @@ public final class GUICoreUtils { break; case 1: if (components[1] != null) { - pane.add(components[1], BorderLayout.EAST); + pane.add(components[1], BorderLayout.LINE_END); } break; case 2: @@ -695,7 +696,7 @@ public final class GUICoreUtils { break; case 3: if (components[3] != null) { - pane.add(components[3], BorderLayout.WEST); + pane.add(components[3], BorderLayout.LINE_START); } break; case CASE_FOUR: diff --git a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java index d146c73099..f76f8b0bdf 100644 --- a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java @@ -4,6 +4,7 @@ import java.awt.*; import javax.swing.*; +import com.fr.base.i18n.BidiUtils; import com.fr.design.designer.IntervalConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icombobox.DictionaryComboBox; @@ -59,7 +60,7 @@ public abstract class ButtonWithHotkeysDetailPane extends Butt } UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Advanced"), 280, 20, advancePane); this.add(uiExpandablePane); - + BidiUtils.applyOrientationByLocale(this); } protected abstract Component createCenterPane(); diff --git a/designer-base/src/main/java/com/fr/design/widget/mobile/WidgetMobilePane.java b/designer-base/src/main/java/com/fr/design/widget/mobile/WidgetMobilePane.java index 20b82467bb..b23f25657e 100644 --- a/designer-base/src/main/java/com/fr/design/widget/mobile/WidgetMobilePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/mobile/WidgetMobilePane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.mobile; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.Widget; @@ -19,6 +20,7 @@ public class WidgetMobilePane extends JPanel { public WidgetMobilePane() { this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); init(); + BidiUtils.applyOrientationByLocale(this); } protected void init() { diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index 6e4f2d803f..daeb408d10 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -1,6 +1,7 @@ package com.fr.design.write.submit; import com.fr.base.GraphHelper; +import com.fr.base.i18n.BidiUtils; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; @@ -95,6 +96,7 @@ public abstract class CustomJobPane extends BasicBeanPane { UITextArea area = new UITextArea(2, 1); area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); + BidiUtils.setOrientationByLocale(area); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dsPane.add(area); dsPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description"), null)); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 2526d6fdbf..724654aad2 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -3,6 +3,7 @@ package com.fr.design.write.submit; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.base.Parameter; +import com.fr.base.i18n.BidiUtils; import com.fr.data.DataConstants; import com.fr.data.condition.JoinCondition; import com.fr.data.condition.ListCondition; @@ -62,6 +63,7 @@ import javax.swing.JTable; import javax.swing.JTree; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; +import javax.swing.border.TitledBorder; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellEditor; @@ -146,12 +148,12 @@ public class DBManipulationPane extends BasicBeanPane { dmlConfigComboBox = new UIComboBox(DML_CONFIG_TYPES); JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type") + ":"), dmlConfigComboBox}, - FlowLayout.LEFT, 10); - typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))); + FlowLayout.LEADING, 10); + typePane.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type")))); northPane.add(typePane, BorderLayout.NORTH); chooseTable = new ChoosePaneSupportFormula(); - chooseTable.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table"))); + chooseTable.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table")))); chooseTable.setTableNameComboBoxPopSize(160, 320); northPane.add(chooseTable, BorderLayout.CENTER); @@ -159,7 +161,7 @@ public class DBManipulationPane extends BasicBeanPane { // peter:编辑的TablePane JPanel editTablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.add(editTablePane, BorderLayout.CENTER); - editTablePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))); + editTablePane.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value")))); keyColumnValuesTable = new KeyColumnNameValueTable(); editTablePane.add(new JScrollPane(this.keyColumnValuesTable), BorderLayout.CENTER); @@ -189,7 +191,7 @@ public class DBManipulationPane extends BasicBeanPane { UpdateAction[] actions = this.getActions(); if (actions != null && actions.length > 0) { JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4)); - editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST); + editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.LINE_END); for (UpdateAction action : actions) { controlBtnPane.add(new UIButton(action)); @@ -212,8 +214,9 @@ public class DBManipulationPane extends BasicBeanPane { } }); helpButton.set4ToolbarButton(); - checkBoxUpdatePane.add(UpdateCheckBox, BorderLayout.WEST); - checkBoxUpdatePane.add(helpButton, BorderLayout.EAST); + checkBoxUpdatePane.add(UpdateCheckBox, BorderLayout.LINE_START); + checkBoxUpdatePane.add(helpButton, BorderLayout.LINE_END); + BidiUtils.applyOrientationByLocale(checkBoxUpdatePane); } } @@ -332,8 +335,8 @@ public class DBManipulationPane extends BasicBeanPane { protected void setBorderAndLayout(JPanel jPanel) { jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - jPanel.setBorder(BorderFactory.createTitledBorder( - new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))); + jPanel.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder( + new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition")))); } protected void addComponent(JPanel mainPane, JScrollPane addPane) { @@ -350,7 +353,7 @@ public class DBManipulationPane extends BasicBeanPane { } protected String setControlBtnPanePosition() { - return BorderLayout.EAST; + return BorderLayout.LINE_END; } private void refreshConditionList() { diff --git a/designer-base/src/main/java/com/fr/env/LocalEnvPane.java b/designer-base/src/main/java/com/fr/env/LocalEnvPane.java index 6f191dd1ec..b90d6ac665 100644 --- a/designer-base/src/main/java/com/fr/env/LocalEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/LocalEnvPane.java @@ -1,5 +1,6 @@ package com.fr.env; +import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.gui.ilable.UILabel; @@ -33,7 +34,7 @@ public class LocalEnvPane extends BasicBeanPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.add(northPane, BorderLayout.NORTH); - northPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.WEST); + northPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.LINE_START); pathTextField = new UITextField(); northPane.add(pathTextField, BorderLayout.CENTER); @@ -67,6 +68,7 @@ public class LocalEnvPane extends BasicBeanPane { centerPane.add(description, BorderLayout.SOUTH); description.setText(Toolkit.i18nText("Fine-Design_Basic_Env_Des1")); description.setEditable(false); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 7be733b2b5..65a0c97a13 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -1,5 +1,6 @@ package com.fr.env; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; @@ -317,6 +318,7 @@ public class RemoteEnvPane extends BasicBeanPane { UIScrollPane scrollPane = new UIScrollPane(panel); this.setLayout(new BorderLayout()); this.add(scrollPane); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index f794a0a8e7..72e9014024 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -3,6 +3,7 @@ package com.fr.file; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.extension.FileExtension; +import com.fr.base.i18n.BidiUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; @@ -478,6 +479,7 @@ public class FILEChooserPane extends BasicPane { JPanel contentPane = TableLayoutHelper.createTableLayoutPane(outComponents, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}); this.add(contentPane, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { diff --git a/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java b/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java index ad96c00a9f..3fd58fc384 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java @@ -1,13 +1,16 @@ package com.fr.widgettheme.designer; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.VerticalFlowLayout; import com.fr.widgettheme.control.attr.WidgetDisplayEnhanceMarkAttr; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; import javax.swing.JPanel; import java.awt.Color; @@ -27,20 +30,25 @@ public class WidgetThemeDisplayConfigPane extends BasicPane { } private void initComponents() { - VerticalFlowLayout layout = new VerticalFlowLayout(); - layout.setAlignLeft(true); - this.setLayout(layout); + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(northPane); + northPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0 ,5)); + widgetEnhance = new UICheckBox(Toolkit.i18nText("Fine-Design_Widget_Enable_Display_Enhance")); widgetEnhance.setSelected(true); northPane.add(widgetEnhance); JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(southPane); + southPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0 ,5)); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Widget_Display_Enhance_Tip")); label.setForeground(Color.GRAY); southPane.add(label); + + this.add(Box.createVerticalStrut(20)); + this.add(northPane); + this.add(southPane); + this.add(Box.createVerticalStrut(25)); + BidiUtils.applyOrientationByLocale(this); } @Override diff --git a/designer-base/src/main/resources/com/fr/design/standard/fileicon/left.svg b/designer-base/src/main/resources/com/fr/design/standard/fileicon/left.svg new file mode 100644 index 0000000000..4d7d391962 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/fileicon/left.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index c34fcce653..987f65687c 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -4,6 +4,7 @@ package com.fr.design.chart; */ import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; @@ -71,11 +72,13 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven JScrollPane subListPane = new JScrollPane(iconViewList); //iconPane.add mainTypeList.setSelectedIndex(0); - - JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane); - spane.setDividerLocation(120); - spane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type"))); + Component left = BidiUtils.rtl() ? subListPane :typeScrollPane; + Component right = BidiUtils.rtl() ? typeScrollPane :subListPane; + JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, left, right); + spane.setDividerLocation(BidiUtils.rtl() ? 500 : 120); + spane.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type")))); this.add(spane); + BidiUtils.applyOrientationByLocale(this); iconViewList.setSelectedIndex(0); } diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java index ac30dbf3be..4075b411a3 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java @@ -72,9 +72,9 @@ public class ChartHyperPopAttrPane extends AbstractChartAttrPane { double[] rowSize = { p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title") + ":", SwingConstants.RIGHT), titleField}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":", SwingConstants.RIGHT), widthField}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":", SwingConstants.RIGHT), heightField}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title") + ":", SwingConstants.RIGHT), titleField}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":", SwingConstants.RIGHT), widthField}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":", SwingConstants.RIGHT), heightField}, }; widthField.setText(String.valueOf(DEFAULT_V_VALUE)); @@ -90,7 +90,6 @@ public class ChartHyperPopAttrPane extends AbstractChartAttrPane { return pane; } - public void populateBean(ChartHyperPoplink chartHyperlink) { titleField.setText(chartHyperlink.getChartDigTitle()); diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index 35b0c0d5bc..cc5bf596a1 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -1,5 +1,6 @@ package com.fr.design.chart.series.SeriesCondition.impl; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; @@ -51,7 +52,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane implemen button.add(copyButton); button.add(moveForwardButton); button.add(moveBackButton); - northPane.add(button, BorderLayout.WEST); - northPane.add(configButton, BorderLayout.EAST); - + northPane.add(button, BorderLayout.LINE_START); + northPane.add(configButton, BorderLayout.LINE_END); + BidiUtils.applyOrientationByLocale(this); initConfigCreator(); // Toolkit.getDefaultToolkit().addAWTEventListener(awt, AWTEvent.MOUSE_EVENT_MASK); @@ -340,7 +341,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen JPanel pane = null; for (int i = 0; i < indexList.size(); i++) { if (i % COL_COUNT == 0) { - pane = new JPanel(new FlowLayout(FlowLayout.LEFT)); + pane = new JPanel(new FlowLayout(FlowLayout.LEADING)); northPane.add(pane); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java index 40983c56b5..7aff66d3fd 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui.data; import com.fr.base.BaseUtils; import com.fr.base.TableData; +import com.fr.base.i18n.BidiUtils; import com.fr.data.impl.NameTableData; import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; @@ -40,7 +41,7 @@ public class DatabaseTableDataPane extends BasicPane{ this.setLayout(new BorderLayout(0,0)); if (label != null) { - this.add(label, BorderLayout.WEST); + this.add(label, BorderLayout.LINE_START); } JPanel pane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 9943c79631..6dcc369c66 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.data; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chartx.data.DataLayoutHelper; @@ -14,6 +15,7 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -66,7 +68,7 @@ public class NormalChartDataPane extends DataContentsPane { if (ChartEditContext.supportReportData()) { JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0)); northPane.add(jcb, BorderLayout.CENTER); - UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source")); + UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source"), SwingConstants.LEADING); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); if (ChartEditContext.normalMode()) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 82240bc6d2..72efba4806 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.gui.data; import com.fr.base.TableData; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.TableDataDefinition; @@ -18,6 +19,7 @@ import com.fr.design.utils.gui.UIComponentUtils; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; +import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Dimension; @@ -41,7 +43,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } private void initDataPane() { - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data")); + UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data"), SwingConstants.LEADING); UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH); UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java index 7d12e3e52d..bf5ad2cd74 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.data.table; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.ChartCollection; @@ -42,7 +43,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa categoryCombox = new UIComboBox(); JPanel categoryPane = new JPanel(new BorderLayout(4,0)); categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); - UILabel label1 = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ; + UILabel label1 = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category"), SwingConstants.LEADING) ; label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); categoryCombox.setPreferredSize(new Dimension(100,20)); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java index cf78e59ffb..0b20335775 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.gui.data.table; import com.fr.base.chart.chartdata.TopDefinitionProvider; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartdata.MoreNameCDDefinition; @@ -17,6 +18,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -102,7 +104,7 @@ public class SeriesTypeUseComboxPane extends BasicBeanPane { JPanel northPane = new JPanel(new BorderLayout(4, 0)); //使用系列名/系列值选项面板 - UILabel seriesLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + UILabel seriesLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"), SwingConstants.LEADING); seriesLabel.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); JPanel borderLayoutPane = GUICoreUtils.createBorderLayoutPane(new Component[]{content, null, null, seriesLabel, null}); northPane.add(borderLayoutPane); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java index 345d57de8a..e43b8de392 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.style; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.base.TextAttr; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; @@ -41,7 +42,7 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane { double e = getEdithAreaWidth(); double p = TableLayout.PREFERRED; double[] columnSize = {f, e}; - UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); + UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEADING); JPanel preButtonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][]{new Component[]{text, preButton}}, new double[]{p}, columnSize); textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); panel.add(preButtonPane, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java index 72228e094d..34e81b1c43 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java @@ -3,6 +3,7 @@ package com.fr.design.module; import com.fr.base.BaseUtils; import com.fr.base.ChartEmptyDataStyleConf; import com.fr.base.Style; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -71,7 +72,7 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane { JPanel content = new JPanel(new BorderLayout()); content.add(creatNorthPane(), BorderLayout.NORTH); content.add(creatCenterPane(), BorderLayout.CENTER); - return content; + return BidiUtils.applyOrientationByLocale(content); } private JPanel creatNorthPane() { @@ -100,10 +101,10 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane { UILabel promptContent = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Tip_Content")); imageContent = new UILabel(Toolkit.i18nText("Fine-Design_Report_Image")); - JPanel emptyPane = GUICoreUtils.createFlowPane(new Component[]{promptContent, emptyData}, FlowLayout.LEFT, TEN, 0); - JPanel imagePane = GUICoreUtils.createFlowPane(new Component[]{imageContent, imageData}, FlowLayout.LEFT, TEN, 0); + JPanel emptyPane = GUICoreUtils.createFlowPane(new Component[]{promptContent, emptyData}, FlowLayout.LEADING, TEN, 0); + JPanel imagePane = GUICoreUtils.createFlowPane(new Component[]{imageContent, imageData}, FlowLayout.LEADING, TEN, 0); imagePane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); - JPanel northPane = GUICoreUtils.createFlowPane(new Component[]{emptyPane, imagePane}, FlowLayout.LEFT, 0, 0); + JPanel northPane = GUICoreUtils.createFlowPane(new Component[]{emptyPane, imagePane}, FlowLayout.LEADING, 0, 0); northPane.setBorder(BorderFactory.createEmptyBorder(0, FIVE, 0, 0)); return northPane; } @@ -118,7 +119,7 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane { JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Preview")); previewOwnerPane.setLayout(new BorderLayout()); previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER); - previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST); + previewContainerPane.add(initSelectFilePane(), BorderLayout.LINE_END); previewPane = new ImagePreviewPane(); previewOwnerPane.add(new JScrollPane(previewPane)); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 4cc8466fd4..056d3fe665 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -1,6 +1,7 @@ package com.fr.design.module; import com.fr.base.ChartColorMatching; +import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; @@ -73,12 +74,12 @@ public class ChartPreFillStylePane extends BasicBeanPane { double[] columnSize = {p, p}; double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match")), null}, + new Component[]{new UILabel(BidiUtils.concatenateStrings(" ", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match"))), null}, new Component[]{null, customPane}, }; this.setLayout(new BorderLayout()); - this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.WEST); + this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.LINE_START); } private void initListener() { diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java index e989e1a364..5939e482e7 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java @@ -33,7 +33,7 @@ public class ChartPreStyleAction extends UpdateAction { public ChartPreStyleAction() { this.setMenuKeySet(CHART_DEFAULT_STYLE); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("com/fr/design/images/chart/ChartType"); this.generateAndSetSearchText(ChartPreStyleManagerPane.class.getName()); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java index 9cce2be7c3..5a3ed05e5f 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java @@ -1,6 +1,7 @@ package com.fr.design.module; import com.fr.base.ChartColorMatching; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.base.ChartUtils; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Chart; @@ -36,7 +37,7 @@ public class ChartPreStylePane extends BasicBeanPane { fillStylePane = new ChartPreFillStylePane(); JPanel pane = new JPanel(); - pane.setLayout(new FlowLayout(FlowLayout.LEFT)); + pane.setLayout(new FlowLayout(FlowLayout.LEADING)); pane.add(new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index 3469e26246..8cbe21f7fc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.base.Utils; +import com.fr.base.i18n.BidiUtils; import com.fr.chart.base.TextAttr; import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.formula.DefaultTinyFormulaPane; @@ -158,7 +159,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { UIComponentUtils.setLineWrap(useHtml); Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT), titleContent}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEADING), titleContent}, new Component[]{null, useHtml}, }; JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); @@ -178,7 +179,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_BorderLayout_Constraints"), SwingConstants.LEFT), alignmentPane}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_BorderLayout_Constraints"), SwingConstants.LEADING), alignmentPane}, new Component[]{null, customFloatPositionButton} }; diff --git a/designer-form/src/main/java/com/fr/design/actions/FormECParallelCalAction.java b/designer-form/src/main/java/com/fr/design/actions/FormECParallelCalAction.java index 5874398c28..a189c8e10e 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormECParallelCalAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormECParallelCalAction.java @@ -41,7 +41,7 @@ public class FormECParallelCalAction extends JTemplateAction { private void initMenuStyle() { this.setMenuKeySet(FORM_PARALLEL_SETTING); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("com/fr/design/form/images/parallel.png"); } diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index 6227c169b1..87c0d324a8 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -35,7 +35,7 @@ public class FormMobileAttrAction extends JTemplateAction { public FormMobileAttrAction(JForm jf) { super(jf); this.setMenuKeySet(REPORT_APP_ATTR); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/mobile.png")); } diff --git a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java index 99e432eee1..a26ebff6f6 100644 --- a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java @@ -20,7 +20,7 @@ public class TemplateParameterAction extends JTemplateAction { public TemplateParameterAction(JForm jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.REPORT_PARAMETER_ATTR); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.png")); } diff --git a/designer-form/src/main/java/com/fr/design/actions/file/export/EmbeddedFormExportExportAction.java b/designer-form/src/main/java/com/fr/design/actions/file/export/EmbeddedFormExportExportAction.java index 6d0fe9aa52..4192d7aaac 100644 --- a/designer-form/src/main/java/com/fr/design/actions/file/export/EmbeddedFormExportExportAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/file/export/EmbeddedFormExportExportAction.java @@ -28,7 +28,7 @@ public class EmbeddedFormExportExportAction extends AbstractExportAction public EmbeddedFormExportExportAction(JForm jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.EMBEDDED_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/oem/logo.png")); } diff --git a/designer-form/src/main/java/com/fr/design/fit/FormFitAttrAction.java b/designer-form/src/main/java/com/fr/design/fit/FormFitAttrAction.java index dad6e9be9c..25ab8e3e14 100644 --- a/designer-form/src/main/java/com/fr/design/fit/FormFitAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/fit/FormFitAttrAction.java @@ -43,7 +43,7 @@ public class FormFitAttrAction extends JTemplateAction { private void initMenuStyle() { this.setMenuKeySet(REPORT_FIT_ATTR); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/reportfit/fit"); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java index 3e3010aa4d..3995747d38 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.ui.designer.mobile; +import com.fr.base.i18n.BidiUtils; import com.fr.design.designer.creator.XCreator; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.FormDesigner; @@ -34,6 +35,7 @@ public class TextEditorMobileDefinePane extends BaseTextEditorMobileDefinePane { textSettingPane = new MobileTextEditSettingPane(); container.add(inputSettingPane); container.add(textSettingPane); + BidiUtils.applyOrientationByLocale(this); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java index 9b2758a2d2..1043d516d2 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.ui.designer.mobile.component; +import com.fr.base.i18n.BidiUtils; import com.fr.base.mobile.MobileTextEditAttr; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -24,6 +25,7 @@ public class MobileTextEditSettingPane extends BasicBeanPane initLayout(); allowOneClickClear = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Allow_One_Click_Clear"), getClearDefaultState()); this.add(allowOneClickClear, BorderLayout.NORTH); + BidiUtils.applyOrientationByLocale(this); } protected boolean getClearDefaultState() { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java index b7661f9f04..5e6f3827ef 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.ui.designer.mobile.component; +import com.fr.base.i18n.BidiUtils; import com.fr.base.mobile.MobileScanCodeAttr; import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.LayoutConstants; diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/CSVExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/CSVExportAction.java index cc6bdaf392..d7f7fa7198 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/CSVExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/CSVExportAction.java @@ -23,7 +23,7 @@ public class CSVExportAction extends AbstractWorkBookExportAction { public CSVExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.CSV_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/csv.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/EmbeddedExportExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/EmbeddedExportExportAction.java index 25a6da3ad2..9bdcf9a9a4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/EmbeddedExportExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/EmbeddedExportExportAction.java @@ -20,7 +20,7 @@ public class EmbeddedExportExportAction extends AbstractWorkBookExportAction { public EmbeddedExportExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.EMBEDDED_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/oem/logo.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/ExcelExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/ExcelExportAction.java index 0933387062..3776017970 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/ExcelExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/ExcelExportAction.java @@ -12,7 +12,7 @@ public class ExcelExportAction extends AbstractExcelExportAction { public ExcelExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.SIMPLE_EXCEL_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/PDFExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/PDFExportAction.java index e6fc6b5406..cc0af653b5 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/PDFExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/PDFExportAction.java @@ -21,7 +21,7 @@ public class PDFExportAction extends AbstractWorkBookExportAction { public PDFExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.PDF_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/pdf.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/PageExcelExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/PageExcelExportAction.java index 3f69e3ecc0..360a2f4bb3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/PageExcelExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/PageExcelExportAction.java @@ -10,7 +10,7 @@ public class PageExcelExportAction extends AbstractExcelExportAction { public PageExcelExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.PAGE_EXCEL_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java index 087093004b..c4726f548d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java @@ -14,7 +14,7 @@ public class PageToSheetExcelExportAction extends AbstractExcelExportAction { super(jwb); this.setMenuKeySet(KeySetUtils.PAGETOSHEET_EXCEL_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/SVGExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/SVGExportAction.java index 4a7862e9d4..77cf75d9c7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/SVGExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/SVGExportAction.java @@ -22,7 +22,7 @@ public class SVGExportAction extends AbstractWorkBookExportAction { super(jwb); this.setMenuKeySet(KeySetUtils.SVG_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/svg.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/TextExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/TextExportAction.java index ff3debb49a..930e709e02 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/TextExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/TextExportAction.java @@ -19,7 +19,7 @@ public class TextExportAction extends AbstractWorkBookExportAction { public TextExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.TEXT_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/text.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/WordExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/WordExportAction.java index 9e1a919848..6ab26e352b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/WordExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/WordExportAction.java @@ -21,7 +21,7 @@ public class WordExportAction extends AbstractWorkBookExportAction { public WordExportAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.WORD_EXPORT); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/word.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/form/FormECBackgroundAction.java b/designer-realize/src/main/java/com/fr/design/actions/form/FormECBackgroundAction.java index 205a1e1b9e..228bdb77c4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/form/FormECBackgroundAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/form/FormECBackgroundAction.java @@ -18,7 +18,7 @@ public class FormECBackgroundAction extends AbastractFormECAction { public ReportFooterAction(ReportComponent rc) { super(rc); this.setMenuKeySet(KeySetUtils.REPORT_FOOTER); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_report/footer"); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java index c23ed10b53..3db11f2ed2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java @@ -31,7 +31,7 @@ public class ReportHeaderAction extends ReportComponentAction { public ReportHeaderAction(ReportComponent rc) { super(rc); this.setMenuKeySet(KeySetUtils.REPORT_HEADER); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_report/header"); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index b18c62b086..9c0ce6b1ab 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -33,7 +33,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ public ReportMobileAttrAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(REPORT_APP_ATTR); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setName(getMenuKeySet().getMenuKeySetNameWithDot()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/m_report/mobile"); this.generateAndSetSearchText(ReportMobileAttrPane.class.getName()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java index 9177f4d307..698c5ce71a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java @@ -25,7 +25,7 @@ public class ReportPageAttrAction extends ReportComponentAction { styleBox = new UIComboBox(style.toArray()); namePane.add(styleBox); namePane = GUICoreUtils.createFlowPane(new Component[]{ - new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"), + new UILabel(BidiUtils.concatenateStrings(" ", Toolkit.i18nText("Fine-Design_Report_Event_Name"), ":")), nameText, - new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"), + new UILabel(BidiUtils.concatenateStrings(" ", Toolkit.i18nText("Fine-Design_Report_Event_Type"), ":")), styleBox}, - FlowLayout.LEFT); - namePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Event_Name_Type"))); + FlowLayout.LEADING); + namePane.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Event_Name_Type")))); this.add(namePane, BorderLayout.NORTH); card = new CardLayout(); hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane(); @@ -120,7 +121,7 @@ public class ListenerEditPane extends BasicBeanPane { } //其他事件 addOtherEvent(); - hyperlinkPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_JavaScript_Set"))); + hyperlinkPane.setBorder(BidiUtils.applyTitledBorderJustification(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_JavaScript_Set")))); this.add(hyperlinkPane); styleBox.addItemListener(new ItemListener() { @Override @@ -132,6 +133,7 @@ public class ListenerEditPane extends BasicBeanPane { card.show(hyperlinkPane, selected.toString()); } }); + BidiUtils.applyOrientationByLocale(this); } private void addOtherEvent() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java index 2e034076fc..c0e14fa688 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.base.i18n.BidiUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.constants.UIConstants; @@ -71,6 +72,7 @@ public class ReportFloatPane extends JPanel { JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); leftTopPane.setBorder(BorderFactory.createEmptyBorder(12, 5, 0, 15)); this.add(leftTopPane, BorderLayout.NORTH); + BidiUtils.applyOrientationByLocale(this); } private void initInsertToolBar() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index 9549a3a7e8..c8520305f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.cell.settingpane; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; import com.fr.design.expand.ExpandLeftFatherPane; @@ -63,7 +64,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { horizontalExpandableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable")); verticalExpandableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable")); initAllNames(); - return layoutPane(); + return BidiUtils.applyOrientationByLocale(layoutPane()); } private void initAllNames() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 5ac64d401a..f8a6ccfe6d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.Style; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.link.MessageWithLink; @@ -41,6 +42,7 @@ import com.fr.stable.Constants; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; +import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.JPanel; import javax.swing.SwingConstants; @@ -55,6 +57,7 @@ import java.awt.Insets; import java.awt.Rectangle; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.text.Bidi; import java.util.ArrayList; /** @@ -149,7 +152,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { contentPane.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Desensitization"), HEAD_WDITH, HEAD_HEIGTH, desensitizePane())); // VerticalFlowLayout 与 实现的滚动条有冲突,因此再加一层panel JPanel jPanel = new JPanel(); - jPanel.add(contentPane); + jPanel.add(BidiUtils.applyOrientationByLocale(contentPane)); initAllNames(); return jPanel; } @@ -226,9 +229,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane { return new Insets(LayoutConstants.VGAP_MEDIUM, 0, LayoutConstants.VGAP_MEDIUM, 0); } }; - VerticalFlowLayout verticalFlowLayout = new VerticalFlowLayout(VerticalFlowLayout.CENTER, 0, 0); - verticalFlowLayout.setAlignLeft(true); - basicPane.setLayout(verticalFlowLayout); + basicPane.setLayout(new BoxLayout(basicPane, BoxLayout.Y_AXIS)); + + defaultAutoRadioButton.setAlignmentX(BidiUtils.rtl() ? Component.RIGHT_ALIGNMENT : Component.LEFT_ALIGNMENT); + noAutoRadioButton.setAlignmentX(BidiUtils.rtl() ? Component.RIGHT_ALIGNMENT : Component.LEFT_ALIGNMENT); + autoHeightRadioButton.setAlignmentX(BidiUtils.rtl() ? Component.RIGHT_ALIGNMENT : Component.LEFT_ALIGNMENT); + autoWidthRadioButton.setAlignmentX(BidiUtils.rtl() ? Component.RIGHT_ALIGNMENT : Component.LEFT_ALIGNMENT); + basicPane.add(defaultAutoRadioButton); basicPane.add(noAutoRadioButton); basicPane.add(autoHeightRadioButton); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java index de4e046b84..a8f3b5f34b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.cell.settingpane.desensitization; +import com.fr.base.i18n.BidiUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; @@ -97,7 +98,7 @@ public class CellDesensitizationGroupsPane extends JPanel { JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); controlPane.setBackground(Color.WHITE); - controlPane.add(getbuttonPane(), BorderLayout.WEST); + controlPane.add(getbuttonPane(), BorderLayout.LINE_START); JPanel pane = new JPanel(new BorderLayout(4, 4)); pane.add(editTable, BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java index 818a26205d..3911be9c84 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.cell.settingpane.desensitization.model; +import com.fr.base.i18n.BidiUtils; import com.fr.base.operator.org.OrganizationOperator; import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; @@ -103,6 +104,7 @@ public class DesensitizationCellPane extends BasicBeanPane { emptyTextField.setOpaque(false); editPanel.add(initTableCellPanel()); + BidiUtils.applyOrientationByLocale(editPanel, ruleTextField); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java index e1e095cbfc..fca95a18d4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.cell.settingpane.style; import com.fr.base.CellBorderStyle; import com.fr.base.NameStyle; import com.fr.base.Style; +import com.fr.base.i18n.BidiUtils; import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; @@ -14,6 +15,7 @@ import com.fr.design.style.BorderUtils; import javax.swing.*; import javax.swing.event.ChangeListener; import java.awt.*; +import java.text.Bidi; import java.util.ArrayList; import java.util.List; @@ -40,6 +42,7 @@ public class CustomStylePane extends MultiTabPane