Browse Source

REPORT-138420 & REPORT-138440 fix: 翻新面板,engine-x 国际文案修复

fbp/master
lemon 2 months ago
parent
commit
be1d034082
  1. 4
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java
  2. 5
      designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java
  3. 99
      designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java
  4. 7
      designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java

4
designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java

@ -35,8 +35,8 @@ public class ColumnRowVerticalPane extends ColumnRowPane {
initRowSpinner(); initRowSpinner();
pane.add(column(10, 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()); ).getComponent());
this.addDocumentListener(d); this.addDocumentListener(d);

5
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/report", LocaleScope.WEB),
LocaleMarker.create("com/fr/web/i18n/chart", 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插件接口适配 // WebLocaleProvider插件接口适配
LocaleUtils.registerLocaleParser((localeStr, defaulVal) -> { LocaleUtils.registerLocaleParser((localeStr, defaulVal) -> {

99
designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java

@ -1,5 +1,9 @@
package com.fr.nx.app.designer.menu; 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.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -56,9 +60,9 @@ public class CalculateAttrPane extends BasicBeanPane<CalculatorAttrMark> {
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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")); ActionLabel featureLabel = new ActionLabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Experimental_Feature"));
featureLabel.setFont(new Font(null, Font.PLAIN, 10)); featureLabel.setFont(new Font(null, Font.PLAIN, 10));
featureLabel.addActionListener(new ActionListener() { featureLabel.addActionListener(new ActionListener() {
@ -68,77 +72,60 @@ public class CalculateAttrPane extends BasicBeanPane<CalculatorAttrMark> {
wDialog.setVisible(true); wDialog.setVisible(true);
} }
}); });
featureFlagPanel.add(featureLabel); featureFlagPanel.add(Layouts.row(Layouts.flex(), Layouts.cell(featureLabel)).getComponent());
JPanel calculateAttrPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); initTreeConfigPanel();
calculateAttrPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
// JPanel calculatedEndPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); List<Component[]> components = new ArrayList<>();
// calculateEnd = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine-Calculate-End")); components.add(new Component[]{featureFlagPanel});
// calculatedEndPanel.add(calculateEnd); components.add(new Component[]{initCalculateAttrPanel()});
JPanel queryCachePanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); 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")); 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")); 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")); 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")); UILabel tipLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Prefer_SQL_Pagination_Tip"));
tipLabel.setForeground(Color.GRAY); FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
cursorPagePanel.add(cursorPage);
cursorPagePanel.add(tipLabel); JPanel calculateAttrPanel = Layouts.column(10,
Layouts.cell(queryCache),
// calculateAttrPanel.add(calculatedEndPanel); Layouts.cell(multiSourceMode),
calculateAttrPanel.add(queryCachePanel); Layouts.cell(cursorPage),
calculateAttrPanel.add(multiSourcePanel); Layouts.cell(tipLabel)).getComponent();
calculateAttrPanel.add(cursorPagePanel); calculateAttrPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
return calculateAttrPanel;
}
treeConfigPanel = FRGUIPaneFactory.createTitledBorderPane( private void initTreeConfigPanel() {
InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Config") treeConfigPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
);
treeConfigPanel.setVisible(FeatureManager.getInstance().isFlagEnable(FeatureFlags.TREE)); treeConfigPanel.setVisible(FeatureManager.getInstance().isFlagEnable(FeatureFlags.TREE));
treeConfigPanel.setLayout(new BoxLayout(treeConfigPanel, BoxLayout.Y_AXIS)); 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")); 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")); UILabel treeExpandLayerLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Expand_Layer"));
treeExpandLayer = new UISpinner(1, Integer.MAX_VALUE, 1, 1); treeExpandLayer = new UISpinner(1, Integer.MAX_VALUE, 1, 1);
// 功能不支持,设置先禁用 // 功能不支持,设置先禁用
treeExpandLayer.setEnabled(false); 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")); UILabel multilineLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Expand_Layer_Label"));
multilineLabel.setForeground(TIPS_FONT_COLOR); FineUIStyle.setStyle(multilineLabel, FineUIStyle.LABEL_TIP);
treeExpandLayerLabelPanel.add(multilineLabel); treeConfigPanel.add(FineUIUtils.wrapComponentWithTitle(Layouts.column(10,
Layouts.cell(treeAsyncQuery),
Layouts.row(10, Layouts.cell(treeExpandLayerLabel), Layouts.cell(treeExpandLayer)),
treeConfigPanel.add(treeAsyncQueryPanel); Layouts.cell(multilineLabel)).getComponent(),
treeConfigPanel.add(treeExpandLayerPanel); InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Config")));
treeConfigPanel.add(treeExpandLayerLabelPanel);
List<Component[]> 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);
} }
@Override @Override

7
designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java

@ -1,5 +1,6 @@
package com.fr.nx.app.designer.menu; package com.fr.nx.app.designer.menu;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -26,9 +27,8 @@ public class FeatureFlagsPanel extends BasicBeanPane<FeatureFlagBean> {
public FeatureFlagsPanel() { public FeatureFlagsPanel() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
JPanel content = JPanel content =
TableLayoutHelper.createGapTableLayoutPane( TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{mainPanel}}, new Component[][]{new Component[]{mainPanel}},
@ -47,7 +47,8 @@ public class FeatureFlagsPanel extends BasicBeanPane<FeatureFlagBean> {
for (Pair<FeatureFlag, Boolean> entry : featureFlagBean.getAllFlags()) { for (Pair<FeatureFlag, Boolean> entry : featureFlagBean.getAllFlags()) {
final FeatureFlag flag = entry.getFirst(); final FeatureFlag flag = entry.getFirst();
Boolean selected = entry.getSecond(); 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()); final UICheckBox cb = new UICheckBox(flag.getDisplayName());
cb.setSelected(selected); cb.setSelected(selected);
cb.addActionListener(new ActionListener() { cb.addActionListener(new ActionListener() {

Loading…
Cancel
Save