diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 8d10a263be..1d3100a2a0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -163,7 +163,7 @@ public class JDBCDefPane extends JPanel { public JDBCDefPane() { initMap(); - this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); + this.setBorder(UITitledBorder.createBorderWithTitle(BidiUtils.reverseConcatenateStrings("JDBC", ":"))); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); JPanel innerthis = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); innerthis.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); @@ -207,14 +207,14 @@ public class JDBCDefPane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; JPanel dbtypePane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - dbtypePane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Database"), ":"))); + dbtypePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Database") + ":")); Component[][] dbtypeComComponents = {{dbtypeComboBox}}; double[] dbtypeRowSize = {p}; double[] dbtypeColumnSize = {p}; JPanel dbtypeComPane = TableLayoutHelper.createTableLayoutPane(dbtypeComComponents, dbtypeRowSize, dbtypeColumnSize); JPanel driverPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - driverPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Driver"), ":"))); + driverPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Driver") + ":")); // 选择ODBC数据源的时候的提示链接 JPanel odbcTipsPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); odbcTipsLink = new ActionLabel(Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")) { @@ -263,21 +263,21 @@ public class JDBCDefPane extends JPanel { driverComboBoxAndTips.add(odbcTipsPane, BorderLayout.CENTER); JPanel hostPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - hostPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Host"), ":"))); + hostPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Host") + ":")); Component[][] hostComComponents = {{hostTextField}}; double[] hostRowSize = {p}; double[] hostColumnSize = {p}; JPanel hostComPane = TableLayoutHelper.createTableLayoutPane(hostComComponents, hostRowSize, hostColumnSize); JPanel portPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - portPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Port"), ":"))); + portPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Port") + ":")); Component[][] portComComponents = {{portTextField}}; double[] portRowSize = {p}; double[] portColumnSize = {p}; JPanel portComPane = TableLayoutHelper.createTableLayoutPane(portComComponents, portRowSize, portColumnSize); JPanel dbNamePane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - dbNamePane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_DatabaseName"), ":"))); + dbNamePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_DatabaseName") + ":")); Component[][] dbNameComComponents = {{dbNameTextField}}; double[] dbNameRowSize = {p}; double[] dbNameColumnSize = {p}; @@ -291,8 +291,8 @@ public class JDBCDefPane extends JPanel { JPanel urlComPane = TableLayoutHelper.createCommonTableLayoutPane(urlComComponents, urlRowSize, urlColumnSize, 4); JPanel userPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - userPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Report_UserName"), ":"))); - Component[][] userComComponents = {{userNameTextField, new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Password"), ":")), passwordTextField}}; + userPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_UserName") + ":")); + Component[][] userComComponents = {{userNameTextField, new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}}; double[] userRowSize = {p}; double[] userColumnSize = {f, p, f}; JPanel userComPane = TableLayoutHelper.createCommonTableLayoutPane(userComComponents, userRowSize, userColumnSize, 4); @@ -300,7 +300,7 @@ public class JDBCDefPane extends JPanel { String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")}; charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY)); JPanel chartSetPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - chartSetPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset"), ":"))); + chartSetPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":")); Component[][] charSetComComponents = {{charSetComboBox}}; double[] charSetRowSize = {p}; double[] charSetColumnSize = {f}; @@ -317,6 +317,7 @@ public class JDBCDefPane extends JPanel { // REPORT-41450 Windows环境的jdk11下dpi为125%时会因为缩放导致显示问题,因此加个水平gap值 centerPanel = TableLayoutHelper.createGapTableLayoutPane(allComponents, rowSize, columnSize, 6, 6); innerthis.add(centerPanel); + BidiUtils.applyOrientationByLocale(this); } private void refreshDriverLoader() { 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 d7f6f6d864..b647c23e3c 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 @@ -439,22 +439,11 @@ public class FRGUIPaneFactory { /** - * 创建一个靠右面板 + * 创建一个靠右面板,支持RTL * * @return JPanel对象 */ public static JPanel createRightFlowInnerContainer_S_Pane() { - JPanel jp = new JPanel(); - jp.setLayout(new FlowLayout(FlowLayout.RIGHT)); - return jp; - } - - /** - * 创建一个靠右面板 - * - * @return JPanel对象 - */ - public static JPanel createTrailingFlowInnerContainer_S_Pane() { JPanel jp = new JPanel(); jp.setLayout(new FlowLayout(FlowLayout.TRAILING)); return jp;