|
|
|
@ -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 |
|
|
|
|