From be1d034082ad0e7f18c0f64b4cb73159f92a16a3 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 24 Oct 2024 09:41:29 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-138420=20&=20REPORT-138440=20fix:=20?= =?UTF-8?q?=E7=BF=BB=E6=96=B0=E9=9D=A2=E6=9D=BF=EF=BC=8Cengine-x=20?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E6=96=87=E6=A1=88=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/columnrow/ColumnRowVerticalPane.java | 4 +- .../boot/init/DesignPreLoadComponent.java | 5 + .../app/designer/menu/CalculateAttrPane.java | 99 ++++++++----------- .../app/designer/menu/FeatureFlagsPanel.java | 7 +- 4 files changed, 54 insertions(+), 61 deletions(-) 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 4e19650e73..898f9bb68f 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 @@ -35,8 +35,8 @@ public class ColumnRowVerticalPane extends ColumnRowPane { initRowSpinner(); pane.add(column(10, - row(cell(rowLabel).weight(0.15), cell(rowSpinner).weight(0.85)), - row(cell(colLabel).weight(0.15), cell(columnSpinner).weight(0.85)) + row(cell(colLabel).weight(0.15), cell(columnSpinner).weight(0.85)), + row(cell(rowLabel).weight(0.15), cell(rowSpinner).weight(0.85)) ).getComponent()); this.addDocumentListener(d); diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java index 8656695ecc..a107548fbf 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java @@ -172,6 +172,11 @@ public class DesignPreLoadComponent { LocaleMarker.create("com/fr/web/i18n/report", LocaleScope.WEB), LocaleMarker.create("com/fr/web/i18n/chart", LocaleScope.WEB) ); + Carina.getApplicationContext().group(InterMutableKey.class).addAll( + LocaleMarker.create("com/fr/plugin/locale/locale", LocaleScope.DESIGN), + LocaleMarker.create("com/fr/plugin/locale/locale", LocaleScope.WEB), + LocaleMarker.create("com/fr/plugin/locale/locale", LocaleScope.SERVER) + ); // WebLocaleProvider插件接口适配 LocaleUtils.registerLocaleParser((localeStr, defaulVal) -> { diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java index bc4648de4b..cf720b37b0 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java @@ -1,5 +1,9 @@ package com.fr.nx.app.designer.menu; +import com.fine.swing.ui.layout.Layouts; +import com.fine.theme.utils.FineUIStyle; +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.icheckbox.UICheckBox; @@ -56,9 +60,9 @@ public class CalculateAttrPane extends BasicBeanPane { private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); - JPanel featureFlagPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + JPanel featureFlagPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); ActionLabel featureLabel = new ActionLabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Experimental_Feature")); featureLabel.setFont(new Font(null, Font.PLAIN, 10)); featureLabel.addActionListener(new ActionListener() { @@ -68,77 +72,60 @@ public class CalculateAttrPane extends BasicBeanPane { wDialog.setVisible(true); } }); - featureFlagPanel.add(featureLabel); + featureFlagPanel.add(Layouts.row(Layouts.flex(), Layouts.cell(featureLabel)).getComponent()); - JPanel calculateAttrPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - calculateAttrPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); + initTreeConfigPanel(); -// JPanel calculatedEndPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); -// calculateEnd = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine-Calculate-End")); -// calculatedEndPanel.add(calculateEnd); - JPanel queryCachePanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + List components = new ArrayList<>(); + components.add(new Component[]{featureFlagPanel}); + components.add(new Component[]{initCalculateAttrPanel()}); + components.add(new Component[]{treeConfigPanel}); + + JPanel content = + TableLayoutHelper.createGapTableLayoutPane( + components.toArray(new Component[0][]), + TableLayoutHelper.FILL_LASTCOLUMN, + 5, + 5 + ); + + this.add(content, BorderLayout.CENTER); + } + + private JPanel initCalculateAttrPanel() { queryCache = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Query_Cache")); - queryCachePanel.add(queryCache); - JPanel multiSourcePanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); multiSourceMode = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Feature_Multi_Source")); - multiSourcePanel.add(multiSourceMode); - - JPanel cursorPagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); cursorPage = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Prefer_Cursor_Pagination")); UILabel tipLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Prefer_SQL_Pagination_Tip")); - tipLabel.setForeground(Color.GRAY); - cursorPagePanel.add(cursorPage); - cursorPagePanel.add(tipLabel); - -// calculateAttrPanel.add(calculatedEndPanel); - calculateAttrPanel.add(queryCachePanel); - calculateAttrPanel.add(multiSourcePanel); - calculateAttrPanel.add(cursorPagePanel); - + FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP); + + JPanel calculateAttrPanel = Layouts.column(10, + Layouts.cell(queryCache), + Layouts.cell(multiSourceMode), + Layouts.cell(cursorPage), + Layouts.cell(tipLabel)).getComponent(); + calculateAttrPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); + return calculateAttrPanel; + } - treeConfigPanel = FRGUIPaneFactory.createTitledBorderPane( - InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Config") - ); + private void initTreeConfigPanel() { + treeConfigPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); treeConfigPanel.setVisible(FeatureManager.getInstance().isFlagEnable(FeatureFlags.TREE)); treeConfigPanel.setLayout(new BoxLayout(treeConfigPanel, BoxLayout.Y_AXIS)); - - JPanel treeAsyncQueryPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); treeAsyncQuery = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Async_Query")); - treeAsyncQueryPanel.add(treeAsyncQuery); - JPanel treeExpandLayerPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); UILabel treeExpandLayerLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Expand_Layer")); treeExpandLayer = new UISpinner(1, Integer.MAX_VALUE, 1, 1); // 功能不支持,设置先禁用 treeExpandLayer.setEnabled(false); - treeExpandLayerPanel.add(treeExpandLayerLabel); - treeExpandLayerPanel.add(treeExpandLayer); - - JPanel treeExpandLayerLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); UILabel multilineLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Expand_Layer_Label")); - multilineLabel.setForeground(TIPS_FONT_COLOR); - treeExpandLayerLabelPanel.add(multilineLabel); - - - treeConfigPanel.add(treeAsyncQueryPanel); - treeConfigPanel.add(treeExpandLayerPanel); - treeConfigPanel.add(treeExpandLayerLabelPanel); - - List components = new ArrayList<>(); - components.add(new Component[]{featureFlagPanel}); - components.add(new Component[]{calculateAttrPanel}); - components.add(new Component[]{treeConfigPanel}); - - JPanel content = - TableLayoutHelper.createGapTableLayoutPane( - components.toArray(new Component[0][]), - TableLayoutHelper.FILL_LASTCOLUMN, - 5, - 5 - ); - - this.add(content, BorderLayout.CENTER); + FineUIStyle.setStyle(multilineLabel, FineUIStyle.LABEL_TIP); + treeConfigPanel.add(FineUIUtils.wrapComponentWithTitle(Layouts.column(10, + Layouts.cell(treeAsyncQuery), + Layouts.row(10, Layouts.cell(treeExpandLayerLabel), Layouts.cell(treeExpandLayer)), + Layouts.cell(multilineLabel)).getComponent(), + InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Config"))); } @Override diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java index eaee455511..ef7d942fbe 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java @@ -1,5 +1,6 @@ package com.fr.nx.app.designer.menu; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; @@ -26,9 +27,8 @@ public class FeatureFlagsPanel extends BasicBeanPane { public FeatureFlagsPanel() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); mainPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); JPanel content = TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[]{mainPanel}}, @@ -47,7 +47,8 @@ public class FeatureFlagsPanel extends BasicBeanPane { for (Pair entry : featureFlagBean.getAllFlags()) { final FeatureFlag flag = entry.getFirst(); Boolean selected = entry.getSecond(); - JPanel itemPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + JPanel itemPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + itemPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); final UICheckBox cb = new UICheckBox(flag.getDisplayName()); cb.setSelected(selected); cb.addActionListener(new ActionListener() {