From bc08050175e1b2196a5f6f77924e6dc03b3a2d3e Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 7 Aug 2024 15:23:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E4=BD=8D=E7=BD=AE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E7=9B=B8=E5=AF=B9=E4=BD=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/frpane/ObjectProperiesPane.java | 1 - .../fr/design/layout/FRGUIPaneFactory.java | 38 +++++++++---------- .../mainframe/CenterRegionContainerPane.java | 10 ++--- .../fr/design/mainframe/DesignerFrame.java | 6 +-- .../mainframe/EastRegionContainerPane.java | 2 +- .../mainframe/NorthRegionContainerPane.java | 2 +- .../theme/TemplateThemeGridControlPane.java | 4 +- .../theme/TemplateThemeProfilePane.java | 6 +-- .../theme/edit/chart/ChartFontPane.java | 2 +- .../mainframe/theme/ui/BreadcrumbBar.java | 2 +- .../java/com/fr/design/menu/ToolBarDef.java | 2 +- .../com/fr/design/report/SelectImagePane.java | 2 +- .../com/fr/design/report/WatermarkPane.java | 2 +- .../fr/design/style/AbstractSelectBox.java | 2 +- .../background/impl/ImageBackgroundPane.java | 2 +- .../style/color/DetailColorSelectPane.java | 2 +- .../style/color/NewColorSelectPane.java | 2 +- .../com/fr/design/utils/gui/GUICoreUtils.java | 10 ++--- .../write/submit/DBManipulationPane.java | 10 ++--- .../main/java/com/fr/env/LocalEnvPane.java | 2 +- 20 files changed, 53 insertions(+), 56 deletions(-) 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 fa5821b7fa..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 @@ -1,7 +1,6 @@ package com.fr.design.gui.frpane; import com.fr.base.BaseUtils; -import com.fr.base.i18n.BidiUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; 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 d6d9773d8d..d7f6f6d864 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 @@ -1,6 +1,5 @@ package com.fr.design.layout; -import com.fr.base.i18n.BidiUtils; import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ilable.UILabel; import com.fr.stable.AssistUtils; @@ -18,7 +17,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; -import java.awt.GridLayout; import java.awt.LayoutManager; public class FRGUIPaneFactory { @@ -90,12 +88,12 @@ public class FRGUIPaneFactory { } /** - * 创建一个靠左的水平和垂直间隙均为5的流式布局 + * 创建一个靠左的水平和垂直间隙均为5的流式布局,支持RTL * * @return FlowLayout对象 */ - public static LayoutManager createLabelFlowLayout() { // createLabelFlowLayout - return new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT); // 默认 5, 5 + public static LayoutManager createLabelFlowLayout() { + return new FlowLayout(FlowLayout.LEADING); // 默认 5, 5 } /** @@ -104,7 +102,7 @@ public class FRGUIPaneFactory { * @return FlowLayout对象 */ public static LayoutManager createL_FlowLayout() { - return new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 10, 10); + return new FlowLayout(FlowLayout.LEFT, 10, 10); } /** @@ -220,7 +218,7 @@ public class FRGUIPaneFactory { } /** - * 创建一个带标题边框面板 + * 创建一个带标题边框面板,支持rtl * * @param string 边框标题 * @return JPanel对象 @@ -229,12 +227,12 @@ public class FRGUIPaneFactory { JPanel jp = new JPanel(); UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); jp.setBorder(explainBorder); - jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING)); return jp; } /** - * 创建一个无间隔带标题边框面板 + * 创建一个无间隔带标题边框面板,支持rtl * * @param string 边框标题 * @return JPanel对象 @@ -243,7 +241,7 @@ public class FRGUIPaneFactory { JPanel jp = new JPanel(); UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); jp.setBorder(explainBorder); - jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 0, 0)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); return jp; } @@ -354,48 +352,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(BidiUtils.rtl() ? FlowLayout.RIGHT : 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(BidiUtils.rtl() ? FlowLayout.RIGHT : 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(BidiUtils.rtl() ? FlowLayout.RIGHT : 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(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 2, 2)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, 2, 2)); return jp; } @@ -426,7 +424,7 @@ public class FRGUIPaneFactory { } /** - * 创建一个靠左的水平流式布局 + * 创建一个靠左的水平流式布局,支持RTL * @param hgap 水平间距 * @param vgap 竖直间距 * @return JPanel对象 @@ -434,7 +432,7 @@ 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(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, hgap, vgap)); + jp.setLayout(new FlowLayout(FlowLayout.LEADING, hgap, vgap)); return jp; } 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 6f4e38ad62..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 @@ -82,7 +82,7 @@ public class CenterRegionContainerPane extends JPanel { }; toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout()); eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BorderLayout.LINE_END); eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); combineUpTooBar(); eastCenterPane.add(combineUp, BorderLayout.NORTH); @@ -109,9 +109,9 @@ public class CenterRegionContainerPane extends JPanel { * 创建上工具栏 */ private void combineUpTooBar() { - combineUp = new UIToolbar(BidiUtils.rtl() ? FlowLayout.RIGHT : 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(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 5, 2)); + combineUp.setLayout(new FlowLayout(FlowLayout.LEADING, 5, 2)); setUpUpToolBar(null); } @@ -276,8 +276,8 @@ public class CenterRegionContainerPane extends JPanel { //移除新建模板按钮 templateTabPane.remove(newWorkBookPane); } else { - eastPane.add(largeToolbar, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); - templateTabPane.add(newWorkBookPane, BidiUtils.rtl() ? BorderLayout.EAST : 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 be53242313..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 @@ -823,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(BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST)); + basePane.remove(layout.getLayoutComponent(BorderLayout.LINE_END)); basePane.add(designerOpenEmptyPanel, BorderLayout.CENTER); resetToolkitByPlus(ToolBarMenuDock.NULLAVOID); @@ -977,10 +977,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta basePane.add(center, BorderLayout.CENTER); } if (west != null) { - basePane.add(west, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + basePane.add(west, BorderLayout.LINE_START); } if (east != null) { - basePane.add(east, BidiUtils.rtl() ? BorderLayout.WEST : 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 2ab7725105..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 @@ -1267,7 +1267,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { contentPane.setBackground(originColor); contentPane.setLayout(new BorderLayout()); UILabel label = new UILabel(title); - contentPane.add(label, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + contentPane.add(label, BorderLayout.LINE_START); contentPane.setBorder(new EmptyBorder(5, 10, 5, 0)); setLayout(new BorderLayout()); 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 78e4dbb6a1..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 @@ -68,7 +68,7 @@ public class NorthRegionContainerPane extends JPanel { this.setLayout(new BorderLayout()); this.add(new UIMenuHighLight(), BorderLayout.SOUTH); - this.add(initNorthEastPane(ad), BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + this.add(initNorthEastPane(ad), BorderLayout.LINE_END); } /** 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 c1369c10d0..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 @@ -181,7 +181,7 @@ public class TemplateThemeGridControlPane extends Basic content.setPreferredSize(new Dimension(content.getPreferredSize().width, 20)); UIToolbar toolBar = ToolBarDef.createJToolBar(); - toolBar.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 0, 0)); + toolBar.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); content.add(toolBar, BorderLayout.CENTER); MenuDef addMenuDef = createAddMenuDef(); @@ -208,7 +208,7 @@ public class TemplateThemeGridControlPane extends Basic } } }); - content.add(setTheme4NewTemplateButton, BidiUtils.rtl() ? BorderLayout.WEST : 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/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 295a689bbb..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 @@ -75,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(), BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + add(createRightPane(), BorderLayout.LINE_END); } @Override @@ -384,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, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); - titlePane.add(leftTitlePromptLabel, BidiUtils.rtl() ? BorderLayout.WEST : 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 397f845f36..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 @@ -84,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(), BidiUtils.rtl() ? SwingConstants.RIGHT : 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 64befe8b8e..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 @@ -24,7 +24,7 @@ public class BreadcrumbBar extends JPanel { private JButton currentCrumb; public BreadcrumbBar() { - setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : 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/menu/ToolBarDef.java b/designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java index 2bdee656f0..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 @@ -44,7 +44,7 @@ public class ToolBarDef { * 一个static的方法生成一个JToolBar */ public static UIToolbar createJToolBar() { - UIToolbar toolbar = new UIToolbar(BidiUtils.rtl() ? FlowLayout.RIGHT : 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/report/SelectImagePane.java b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java index 29cbab12b7..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 @@ -84,7 +84,7 @@ public class SelectImagePane extends BasicPane { previewOwnerPane.add(new JScrollPane(previewPane)); JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - previewContainerPane.add(selectFilePane, BidiUtils.rtl() ? BorderLayout.WEST : 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 8c9e280fea..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 @@ -97,7 +97,7 @@ public class WatermarkPane extends BasicPane { // 设置 JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - contentPane.add(rightPane, BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + contentPane.add(rightPane, BorderLayout.LINE_END); rightPane.add(initRightPane(), BorderLayout.NORTH); } 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 3e2ee65b2a..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 @@ -83,7 +83,7 @@ public abstract class AbstractSelectBox extends AbstractPopBox implements Mou triggleButton.addMouseListener(this); this.add(displayPane, BorderLayout.CENTER); - this.add(triggleButton, BidiUtils.rtl() ? BorderLayout.WEST : 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/impl/ImageBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java index 576884f94e..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 @@ -54,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(), BidiUtils.rtl() ? BorderLayout.WEST :BorderLayout.EAST); + previewContainerPane.add(initSelectFilePane(), BorderLayout.LINE_END); previewPane = new ImagePreviewPane(); previewOwnerPane.add(new JScrollPane(previewPane)); previewPane.addChangeListener(imageSizeChangeListener); 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 27306afbb4..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 @@ -51,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, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + this.add(titledefaultPane, BorderLayout.LINE_START); titledefaultPane.add(defaultPane); defaultPane.add(Box.createHorizontalStrut(4)); 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 3ab32dd75b..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 @@ -146,7 +146,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { private UILabel createColorSelectPaneLabel(String name) { UILabel label = new UILabel(name); - label.setHorizontalAlignment(BidiUtils.rtl() ? UILabel.LEFT : UILabel.RIGHT); + label.setHorizontalAlignment(UILabel.TRAILING); return label; } 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 b7eb704f56..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 @@ -536,7 +536,7 @@ public final class GUICoreUtils { } /** - * 生成一个左边是名字,右边是comp的一个JPanel + * 生成一个左边是名字,右边是comp的一个JPanel,支持rtl * @param comp 组件 * @param name 名称 * @return 面板 @@ -545,7 +545,7 @@ public final class GUICoreUtils { JPanel mainPane = new JPanel(); mainPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - mainPane.add(new UILabel(name), BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + mainPane.add(new UILabel(name), BorderLayout.LINE_START); mainPane.add(comp, BorderLayout.CENTER); return mainPane; @@ -672,7 +672,7 @@ public final class GUICoreUtils { } /** - * 生成一个边界布局的面板 + * 生成一个边界布局的面板,支持rtl * @param components 面板中的组件,第一个组件位置在中间,第二个组件位置再东边, * 第三个组件位置在南边,第四个组件位置在西边,第五个组件位置在北边 * @return 具有边界布局的容器 @@ -686,7 +686,7 @@ public final class GUICoreUtils { break; case 1: if (components[1] != null) { - pane.add(components[1], BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + pane.add(components[1], BorderLayout.LINE_END); } break; case 2: @@ -696,7 +696,7 @@ public final class GUICoreUtils { break; case 3: if (components[3] != null) { - pane.add(components[3], BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + pane.add(components[3], BorderLayout.LINE_START); } break; case CASE_FOUR: 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 18cbcf3df0..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 @@ -148,7 +148,7 @@ 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}, - BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 10); + 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); @@ -191,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), BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.LINE_END); for (UpdateAction action : actions) { controlBtnPane.add(new UIButton(action)); @@ -214,8 +214,8 @@ public class DBManipulationPane extends BasicBeanPane { } }); helpButton.set4ToolbarButton(); - checkBoxUpdatePane.add(UpdateCheckBox, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); - checkBoxUpdatePane.add(helpButton, BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); + checkBoxUpdatePane.add(UpdateCheckBox, BorderLayout.LINE_START); + checkBoxUpdatePane.add(helpButton, BorderLayout.LINE_END); BidiUtils.applyOrientationByLocale(checkBoxUpdatePane); } } @@ -353,7 +353,7 @@ public class DBManipulationPane extends BasicBeanPane { } protected String setControlBtnPanePosition() { - return BidiUtils.rtl() ? BorderLayout.WEST : 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 d571811233..a180f0aa3a 100644 --- a/designer-base/src/main/java/com/fr/env/LocalEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/LocalEnvPane.java @@ -34,7 +34,7 @@ public class LocalEnvPane extends BasicBeanPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.add(northPane, BorderLayout.NORTH); - northPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Location"), ":")), BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + northPane.add(new UILabel(BidiUtils.reverseConcatenateStrings(Toolkit.i18nText("Fine-Design_Basic_Location"), ":")), BorderLayout.LINE_START); pathTextField = new UITextField(); northPane.add(pathTextField, BorderLayout.CENTER);