From 629ac607aba6d19a2470524152a169a457af19fe Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 6 Aug 2024 13:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D=E7=BD=AE-?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=BB=E9=A2=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/theme/TemplateThemeEditorPane.java | 5 +++-- .../mainframe/theme/TemplateThemeGridControlPane.java | 5 +++-- .../mainframe/theme/TemplateThemeGridPagesPane.java | 2 ++ .../design/mainframe/theme/TemplateThemeProfilePane.java | 9 +++++---- .../com/fr/design/mainframe/theme/ui/BreadcrumbBar.java | 3 ++- 5 files changed, 15 insertions(+), 9 deletions(-) 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..c1369c10d0 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(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 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, BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); 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..295a689bbb 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(), BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); } @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, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST); + titlePane.add(leftTitlePromptLabel, BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); return titlePane; } } \ No newline at end of file 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..64befe8b8e 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(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 0, 0)); } public void addCrumb(final String text, final BreadcrumbBackListener backListener) {