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();
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);

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/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) -> {

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;
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<CalculatorAttrMark> {
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<CalculatorAttrMark> {
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<Component[]> 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<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);
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

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;
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<FeatureFlagBean> {
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<FeatureFlagBean> {
for (Pair<FeatureFlag, Boolean> 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() {

Loading…
Cancel
Save