Browse Source

REPORT-111995 【NewUI】数据列面板翻新

newui
Levy.Xie-解安森 8 months ago
parent
commit
8eb2df765f
  1. 2
      designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java
  2. 19
      designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java
  3. 196
      designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
  4. 6
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  5. 4
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/bracket.svg
  6. 4
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/bracket_disable.svg
  7. 11
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/unBracket.svg
  8. 11
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/unBracket_disable.svg
  9. 176
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  10. 47
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnBasicPane.java
  11. 46
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnConditionsPane.java
  12. 41
      designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPopUpPane.java
  13. 41
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  14. 46
      designer-realize/src/main/java/com/fr/design/expand/ConditionParentPane.java
  15. 26
      designer-realize/src/main/java/com/fr/design/expand/ExpandDirectionPane.java

2
designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java

@ -187,6 +187,8 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("tool_more_hover", "com/fine/theme/icon/toolbar/more_hover.svg"), new SvgIconSource("tool_more_hover", "com/fine/theme/icon/toolbar/more_hover.svg"),
new SvgIconSource("tool_config", "com/fine/theme/icon/toolbar/config.svg", true), new SvgIconSource("tool_config", "com/fine/theme/icon/toolbar/config.svg", true),
new SvgIconSource("add_popup", "com/fine/theme/icon/toolbar/add_popup.svg", true), new SvgIconSource("add_popup", "com/fine/theme/icon/toolbar/add_popup.svg", true),
new SvgIconSource("bracket", "com/fine/theme/icon/toolbar/bracket.svg", true),
new SvgIconSource("unBracket", "com/fine/theme/icon/toolbar/unBracket.svg", true),
// 参数面板 // 参数面板
new SvgIconSource("param_edit", "com/fine/theme/icon/param/edit.svg", true, 24), new SvgIconSource("param_edit", "com/fine/theme/icon/param/edit.svg", true, 24),

19
designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java

@ -3,7 +3,9 @@ package com.fine.theme.utils;
import com.fine.theme.light.ui.CollapsibleScrollBarLayerUI; import com.fine.theme.light.ui.CollapsibleScrollBarLayerUI;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.value.AtomicClearableLazyValue; import com.fr.value.AtomicClearableLazyValue;
@ -23,6 +25,8 @@ import java.awt.geom.Path2D;
import java.awt.geom.RoundRectangle2D; import java.awt.geom.RoundRectangle2D;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.theme.light.ui.FineButtonUI.isLeftRoundButton; import static com.fine.theme.light.ui.FineButtonUI.isLeftRoundButton;
import static com.formdev.flatlaf.util.UIScale.scale; import static com.formdev.flatlaf.util.UIScale.scale;
@ -380,6 +384,21 @@ public class FineUIUtils {
FineUIStyle.setStyle(label, FineUIStyle.LABEL_BOLD); FineUIStyle.setStyle(label, FineUIStyle.LABEL_BOLD);
} }
/**
* 面板元素头部添加小标题
*
* @param component 面板元素
* @param title 标题文本
* @return 包装面板
*/
public static Component wrapComponentWithTitle(Component component, String title) {
UILabel label = new UILabel(title);
wrapBoldLabelWithUnderline(label);
return column(LayoutConstants.VERTICAL_GAP,
cell(label), cell(component)
).getComponent();
}
/** /**
* 基于组件创建一个UIScrollPane的装饰层内部的ScrollPane仅当悬浮时显示滚动条 * 基于组件创建一个UIScrollPane的装饰层内部的ScrollPane仅当悬浮时显示滚动条
* *

196
designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java

@ -1,7 +1,12 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.data.DataConstants; import com.fr.data.DataConstants;
import com.fr.data.condition.CommonCondition; import com.fr.data.condition.CommonCondition;
import com.fr.data.condition.FormulaCondition; import com.fr.data.condition.FormulaCondition;
@ -9,6 +14,8 @@ import com.fr.data.condition.JoinCondition;
import com.fr.data.condition.ListCondition; import com.fr.data.condition.ListCondition;
import com.fr.data.condition.ObjectCondition; import com.fr.data.condition.ObjectCondition;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.FormulaFactory;
@ -20,7 +27,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -46,6 +52,11 @@ import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* peter: LiteCondition Pane. * peter: LiteCondition Pane.
*/ */
@ -60,6 +71,7 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
private JPanel conditionCardPane; private JPanel conditionCardPane;
protected BasicBeanPane<T> defaultConditionPane; protected BasicBeanPane<T> defaultConditionPane;
// card2 // card2
private UILabel conditionTitleLabel;
private UITextArea formulaTextArea; private UITextArea formulaTextArea;
private UIButton modifyButton; private UIButton modifyButton;
private UIButton addButton; private UIButton addButton;
@ -71,10 +83,6 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
private UIButton moveDownButton; private UIButton moveDownButton;
private UIButton bracketButton; private UIButton bracketButton;
private UIButton unBracketButton; private UIButton unBracketButton;
private static final int DOWN_PADDING = 4;
private static final int STRUT_ONE = 35;
private static final int STRUT_TWO = 4;
private static final int ADD_CONTROL_PANE_PADDING_RIGHT = -5;
private ActionListener actionListener1 = new ActionListener() { private ActionListener actionListener1 = new ActionListener() {
@ -407,74 +415,82 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
protected abstract VariableResolver variableResolver4FormulaPane(); protected abstract VariableResolver variableResolver4FormulaPane();
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
// north // north
initNorth(); initNorth();
//center //center
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
centerPane.setLayout(FRGUIPaneFactory.createBorderLayout());
// Control
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(controlPane, BorderLayout.NORTH);
// controlPane.setLayout(FRGUIPaneFactory.createBorderLayout());
// conditionCardPane // conditionCardPane
initConditionCardPane(controlPane); initConditionCardPane();
centerPane.add(conditionCardPane, BorderLayout.NORTH);
// addControlPane, contains or,and Radio, add,modify Button // northButtonPane, contains or,and Radio, add,modify Button
initControlPane(controlPane); JPanel northButtonPane = initNorthButtonPane();
// Preview // Preview
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel buttonPane = initButtonPane();
centerPane.add(previewPane, BorderLayout.CENTER); JScrollPane treeScrollPane = iniTreeScrollPane();
previewPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 2, 0)); // 滚动面板不能直接加入row-col布局,需设定宽高
treeScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 250)));
JPanel previewPane = column(
// conTreeScrollPane.setPreferredSize(new Dimension(400, 125)); cell(northButtonPane),
previewPane.add(iniTreeScrollPane(), BorderLayout.CENTER); row(
cell(treeScrollPane).weight(0.75), cell(buttonPane).weight(0.25)
)
).with(it -> {
it.setBorder(new FineRoundBorder());
it.setOpaque(true);
it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
}).getComponent();
conditionsTree.addTreeSelectionListener(treeSelectionListener); conditionsTree.addTreeSelectionListener(treeSelectionListener);
JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); centerPane.add(previewPane, BorderLayout.CENTER);
previewPane.add(GUICoreUtils.createBorderPane(buttonPane, BorderLayout.NORTH), BorderLayout.EAST);
initButtonPane(buttonPane);
// peter:必须要检查Enabled. // peter:必须要检查Enabled.
checkButtonEnabledForList(); checkButtonEnabledForList();
} }
private void initButtonPane(JPanel buttonPane) { private JPanel initButtonPane() {
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
buttonPane.add(removeButton); removeButton.setIcon(new LazyIcon("remove"));
removeButton.setIcon(BaseUtils.readIcon("com/fr/base/images/cell/control/remove.png")); removeButton.setDisabledIcon(new LazyIcon("remove").disabled());
removeButton.setEnabled(false); removeButton.setEnabled(false);
removeButton.addActionListener(actionListener3); removeButton.addActionListener(actionListener3);
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
buttonPane.add(moveUpButton); moveUpButton.setIcon(new LazyIcon("move_up"));
moveUpButton.setIcon(BaseUtils.readIcon("com/fr/design/images/control/up.png")); moveUpButton.setDisabledIcon(new LazyIcon("move_up").disabled());
moveUpButton.addActionListener(actionListener4); moveUpButton.addActionListener(actionListener4);
moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down")); moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
buttonPane.add(moveDownButton); moveDownButton.setIcon(new LazyIcon("move_down"));
moveDownButton.setIcon(BaseUtils.readIcon("com/fr/design/images/control/down.png")); moveDownButton.setDisabledIcon(new LazyIcon("move_down").disabled());
moveDownButton.addActionListener(actionListener5); moveDownButton.addActionListener(actionListener5);
// peter:加括号 // peter:加括号
bracketButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Add_bracket")); bracketButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Add_bracket"));
buttonPane.add(bracketButton); bracketButton.setIcon(new LazyIcon("bracket"));
bracketButton.setIcon(BaseUtils.readIcon("com/fr/design/images/condition/bracket.png")); bracketButton.setDisabledIcon(new LazyIcon("bracket").disabled());
bracketButton.addActionListener(actionListener6); bracketButton.addActionListener(actionListener6);
// peter:去掉括号 // peter:去掉括号
unBracketButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Remove_bracket")); unBracketButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Remove_bracket"));
buttonPane.add(unBracketButton); unBracketButton.setIcon(new LazyIcon("unBracket"));
unBracketButton.setIcon(BaseUtils.readIcon("com/fr/design/images/condition/unBracket.png")); unBracketButton.setDisabledIcon(new LazyIcon("unBracket").disabled());
unBracketButton.addActionListener(actionListener7); unBracketButton.addActionListener(actionListener7);
return column(LayoutConstants.VERTICAL_GAP,
cell(removeButton),
cell(moveUpButton),
cell(moveDownButton),
cell(bracketButton),
cell(unBracketButton)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 0, 5))).getComponent();
} }
private JScrollPane iniTreeScrollPane() { private JScrollPane iniTreeScrollPane() {
@ -484,26 +500,28 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
conditionsTree.setSelectionModel(new ContinuousTreeSelectionModel()); conditionsTree.setSelectionModel(new ContinuousTreeSelectionModel());
conditionsTree.addTreeExpansionListener(treeExpansionListener); conditionsTree.addTreeExpansionListener(treeExpansionListener);
conditionsTree.setShowsRootHandles(true); conditionsTree.setShowsRootHandles(true);
return new JScrollPane(conditionsTree); conditionsTree.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
JScrollPane scrollPane = new JScrollPane(conditionsTree);
scrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1,
FineUIUtils.getUIColor("Label.borderColor", "defaultBorderColor")));
return scrollPane;
} }
private void initNorth() { private void initNorth() {
conditonTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); conditionTitleLabel = new UILabel();
this.add(conditonTypePane, BorderLayout.NORTH); FineUIUtils.wrapBoldLabelWithUnderline(conditionTitleLabel);
conditonTypePane.setBorder(new ModLineBorder(ModLineBorder.BOTTOM));
UILabel conditionTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Type") + ":"); UILabel conditionTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Type") + ":");
conditonTypePane.add(conditionTypeLabel, BorderLayout.WEST);
conditionTypeLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, DOWN_PADDING, 0));
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
conditonTypePane.add(northPane, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, DOWN_PADDING, 0));
northPane.add(GUICoreUtils.createFlowPane(commonRadioButton, FlowLayout.CENTER));
northPane.add(GUICoreUtils.createFlowPane(formulaRadioButton, FlowLayout.CENTER));
commonRadioButton.addActionListener(radioActionListener); commonRadioButton.addActionListener(radioActionListener);
formulaRadioButton.addActionListener(radioActionListener); formulaRadioButton.addActionListener(radioActionListener);
conditonTypePane = row(10,
cell(conditionTypeLabel).weight(0.15), cell(commonRadioButton), cell(formulaRadioButton), flex()
).getComponent();
JPanel conditionWrapperPane = column(10,
cell(conditionTitleLabel),
cell(conditonTypePane)
).getComponent();
this.add(conditionWrapperPane, BorderLayout.NORTH);
ButtonGroup mainBg = new ButtonGroup(); ButtonGroup mainBg = new ButtonGroup();
mainBg.add(commonRadioButton); mainBg.add(commonRadioButton);
@ -511,74 +529,58 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
commonRadioButton.setSelected(true); commonRadioButton.setSelected(true);
} }
private void initConditionCardPane(JPanel controlPane) { private void initConditionCardPane() {
conditionCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); conditionCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
controlPane.add(conditionCardPane, BorderLayout.CENTER);
conditionCardPane.setLayout(new CardLayout()); conditionCardPane.setLayout(new CardLayout());
conditionCardPane.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0));
// defaultConditionPane // defaultConditionPane
conditionCardPane.add(defaultConditionPane = createUnFormulaConditionPane(), "DEFAULT"); conditionCardPane.add(defaultConditionPane = createUnFormulaConditionPane(), "DEFAULT");
// formulaConditionPane // formulaConditionPane
JPanel formulaConditionPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel formulaConditionPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
conditionCardPane.add(formulaConditionPane, "FORMULA"); conditionCardPane.add(formulaConditionPane, "FORMULA");
// formulaConditionPane.setLayout(FRGUIPaneFactory.createBorderLayout());
// formulaPane
JPanel formulaPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 95106 公式区域限定宽高, 显示两行即可, 在新窗口编辑.
formulaPane.setPreferredSize(new Dimension(450, 40));
formulaConditionPane.add(formulaPane, BorderLayout.CENTER);
formulaPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 2));
formulaPane.add(GUICoreUtils.createBorderPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Formula") + "="), BorderLayout.NORTH), BorderLayout.WEST);
formulaTextArea = new UITextArea(); formulaTextArea = new UITextArea();
formulaPane.add(new JScrollPane(formulaTextArea), BorderLayout.CENTER);
UIButton editFormulaButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Define")); UIButton editFormulaButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Define"));
formulaPane.add(GUICoreUtils.createBorderPane(editFormulaButton, BorderLayout.NORTH), BorderLayout.EAST); formulaConditionPane.add(row(10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Formula") + " =")),
cell(formulaTextArea).weight(2),
cell(editFormulaButton))
.getComponent());
editFormulaButton.addActionListener(actionListener1); editFormulaButton.addActionListener(actionListener1);
applyCardsPane(); applyCardsPane();
} }
private void initControlPane(JPanel controlPane) { private JPanel initNorthButtonPane() {
JPanel addControlPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
addControlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, ADD_CONTROL_PANE_PADDING_RIGHT));
JPanel splitPane = new JPanel();
splitPane.setBorder(new ModLineBorder(ModLineBorder.TOP));
JPanel addControlPaneWrapper = new JPanel(new BorderLayout());
addControlPaneWrapper.add(addControlPane, BorderLayout.CENTER);
addControlPaneWrapper.add(splitPane, BorderLayout.NORTH);
controlPane.add(addControlPaneWrapper, BorderLayout.SOUTH);
ButtonGroup bg = new ButtonGroup(); ButtonGroup bg = new ButtonGroup();
bg.add(andRadioButton); bg.add(andRadioButton);
bg.add(orRadioButton); bg.add(orRadioButton);
andRadioButton.setSelected(true); andRadioButton.setSelected(true);
JPanel radioPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"), new LazyIcon("add"));
addControlPane.add(radioPane); addButton.setDisabledIcon(new LazyIcon("add").disabled());
radioPane.add(andRadioButton);
radioPane.add(orRadioButton);
addControlPane.add(Box.createHorizontalStrut(STRUT_ONE));
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"), BaseUtils.readIcon("com/fr/base/images/cell/control/add.png"));
addButton.setMnemonic('A'); addButton.setMnemonic('A');
addControlPane.add(addButton);
addButton.addActionListener(actionListener2); addButton.addActionListener(actionListener2);
modifyButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"), new LazyIcon("edit"));
addControlPane.add(Box.createHorizontalStrut(STRUT_TWO)); modifyButton.setDisabledIcon(new LazyIcon("edit").disabled());
modifyButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"), BaseUtils.readIcon("com/fr/base/images/cell/control/rename.png"));
modifyButton.setMnemonic('M'); modifyButton.setMnemonic('M');
addControlPane.add(modifyButton);
modifyButton.addActionListener(actionListener8); modifyButton.addActionListener(actionListener8);
// peter:当鼠标进入修改按钮的时候,如果是ListCondition内容编辑区域不可编辑
// peter:当鼠标进入修改按钮的时候,如果是ListConditon内容编辑区域不可编辑
modifyButton.addMouseListener(mouseAdapter); modifyButton.addMouseListener(mouseAdapter);
return row(
row(5,
cell(andRadioButton).weight(0.5),
cell(orRadioButton).weight(0.5)
).weight(0.25),
flex(0.5),
row(5,
cell(addButton).weight(0.5),
cell(modifyButton).weight(0.5)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 8, 0, 0))).weight(0.25)
).with(it -> it.setBorder(BorderFactory.createCompoundBorder(
FineBorderFactory.createDefaultUnderlineBorder(),
new ScaledEmptyBorder(5, 5, 5, 5))
)).getComponent();
} }
@ -662,10 +664,10 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
private void applyCardsPane() { private void applyCardsPane() {
CardLayout cl = (CardLayout) (conditionCardPane.getLayout()); CardLayout cl = (CardLayout) (conditionCardPane.getLayout());
if (this.commonRadioButton.isSelected()) { if (this.commonRadioButton.isSelected()) {
this.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Common_Condition"), null)); conditionTitleLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Common_Condition"));
cl.show(conditionCardPane, "DEFAULT"); cl.show(conditionCardPane, "DEFAULT");
} else { } else {
this.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Formula_Condition"), null)); conditionTitleLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Formula_Condition"));
cl.show(conditionCardPane, "FORMULA"); cl.show(conditionCardPane, "FORMULA");
} }
} }

6
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -749,9 +749,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
public BasicDialog showLargeWindow(Window window, DialogActionListener l) { public BasicDialog showLargeWindow(Window window, DialogActionListener l) {
int width = 900; int width = 900;
int height = 900; int height = 640;
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(width, height)); BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, FineUIScale.scale(new Dimension(width, height)));
basicDialog.setMinimumSize(new Dimension(width, height)); basicDialog.setMinimumSize(FineUIScale.scale(new Dimension(width, height)));
basicDialog.setResizable(true); basicDialog.setResizable(true);
return basicDialog; return basicDialog;
} }

4
designer-base/src/main/resources/com/fine/theme/icon/toolbar/bracket.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30.0005 15.9863C30.0005 21.117 27.8277 25.2953 24.483 28.5692C24.2132 28.8332 23.8068 28.8947 23.4653 28.7339C22.8734 28.4552 22.7492 27.666 23.1984 27.1903C26.1013 24.1162 27.8405 20.4084 27.8405 15.9863C27.8405 11.5889 26.1013 7.88355 23.1984 4.80968C22.7492 4.33403 22.8734 3.54479 23.4653 3.2661C23.8068 3.1053 24.2132 3.1668 24.483 3.43084C27.8277 6.70464 30.0005 10.8818 30.0005 15.9863Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M2 15.9863C2 10.8818 4.17272 6.70464 7.51751 3.43084C7.78727 3.1668 8.19363 3.1053 8.53515 3.2661C9.12704 3.54479 9.25125 4.33403 8.80206 4.80968C5.89919 7.88355 4.16 11.5889 4.16 15.9863C4.16 20.4084 5.89919 24.1162 8.80207 27.1903C9.25124 27.666 9.12704 28.4552 8.53515 28.7339C8.19363 28.8947 7.78727 28.8332 7.51751 28.5692C4.17272 25.2953 2 21.117 2 15.9863Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 954 B

4
designer-base/src/main/resources/com/fine/theme/icon/toolbar/bracket_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30.0005 15.9863C30.0005 21.117 27.8277 25.2953 24.483 28.5692C24.2132 28.8332 23.8068 28.8947 23.4653 28.7339C22.8734 28.4552 22.7492 27.666 23.1984 27.1903C26.1013 24.1162 27.8405 20.4084 27.8405 15.9863C27.8405 11.5889 26.1013 7.88355 23.1984 4.80968C22.7492 4.33403 22.8734 3.54479 23.4653 3.2661C23.8068 3.1053 24.2132 3.1668 24.483 3.43084C27.8277 6.70464 30.0005 10.8818 30.0005 15.9863Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M2 15.9863C2 10.8818 4.17272 6.70464 7.51751 3.43084C7.78727 3.1668 8.19363 3.1053 8.53515 3.2661C9.12704 3.54479 9.25125 4.33403 8.80206 4.80968C5.89919 7.88355 4.16 11.5889 4.16 15.9863C4.16 20.4084 5.89919 24.1162 8.80207 27.1903C9.25124 27.666 9.12704 28.4552 8.53515 28.7339C8.19363 28.8947 7.78727 28.8332 7.51751 28.5692C4.17272 25.2953 2 21.117 2 15.9863Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 956 B

11
designer-base/src/main/resources/com/fine/theme/icon/toolbar/unBracket.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5516_63926)">
<path d="M0.706956 5.70711C1.09748 5.31658 1.73064 5.31658 2.12117 5.70711L26.1628 29.7487C26.5533 30.1393 26.5533 30.7724 26.1628 31.163C25.7723 31.5535 25.1391 31.5535 24.7486 31.163L0.706956 7.12132C0.316432 6.7308 0.316431 6.09763 0.706956 5.70711Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.81511 5.15826C6.33779 4.49534 6.9049 3.86268 7.51049 3.26012C7.78362 2.98835 8.19909 2.9251 8.54669 3.09133C9.13685 3.37356 9.26132 4.16056 8.81543 4.63923C8.23913 5.25788 7.70855 5.90176 7.22818 6.57132L5.81511 5.15826ZM2.26731 12.9242C2.09201 13.9115 2 14.9385 2 16.0055C2 21.2129 4.16968 25.4544 7.51049 28.7786C7.78362 29.0503 8.19909 29.1136 8.54669 28.9473C9.13685 28.6651 9.26131 27.8781 8.81544 27.3994C5.90453 24.2743 4.16 20.5038 4.16 16.0055C4.16 15.617 4.17316 15.2338 4.19909 14.8559L2.26731 12.9242ZM26.7642 26.1074C28.7816 23.2691 30.0005 19.9086 30.0005 16.0055C30.0005 10.8245 27.8308 6.58421 24.49 3.26013C24.2169 2.98836 23.8014 2.92511 23.4538 3.09134C22.8636 3.37357 22.7392 4.16058 23.1851 4.63924C26.096 7.76412 27.8405 11.5323 27.8405 16.0055C27.8405 19.2615 26.9265 22.1362 25.3177 24.6609L26.7642 26.1074Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5516_63926">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

11
designer-base/src/main/resources/com/fine/theme/icon/toolbar/unBracket_disable.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_167077)">
<path d="M0.706956 5.70711C1.09748 5.31658 1.73064 5.31658 2.12117 5.70711L26.1628 29.7487C26.5533 30.1393 26.5533 30.7724 26.1628 31.163C25.7723 31.5535 25.1391 31.5535 24.7486 31.163L0.706956 7.12132C0.316432 6.7308 0.316431 6.09763 0.706956 5.70711Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.81511 5.15826C6.33779 4.49534 6.9049 3.86268 7.51049 3.26012C7.78362 2.98835 8.19909 2.9251 8.54669 3.09133C9.13685 3.37356 9.26132 4.16056 8.81543 4.63923C8.23913 5.25788 7.70855 5.90176 7.22818 6.57132L5.81511 5.15826ZM2.26731 12.9242C2.09201 13.9115 2 14.9385 2 16.0055C2 21.2129 4.16968 25.4544 7.51049 28.7786C7.78362 29.0503 8.19909 29.1136 8.54669 28.9473C9.13685 28.6651 9.26131 27.8781 8.81544 27.3994C5.90453 24.2743 4.16 20.5038 4.16 16.0055C4.16 15.617 4.17316 15.2338 4.19909 14.8559L2.26731 12.9242ZM26.7642 26.1074C28.7816 23.2691 30.0005 19.9086 30.0005 16.0055C30.0005 10.8245 27.8308 6.58421 24.49 3.26013C24.2169 2.98836 23.8014 2.92511 23.4538 3.09134C22.8636 3.37357 22.7392 4.16058 23.1851 4.63924C26.096 7.76412 27.8405 11.5323 27.8405 16.0055C27.8405 19.2615 26.9265 22.1362 25.3177 24.6609L26.7642 26.1074Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_167077">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

176
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -1,7 +1,7 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.design.border.UITitledBorder;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -16,37 +16,31 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.sort.celldscolumn.CellDSColumnSortPane; import com.fr.design.sort.celldscolumn.CellDSColumnSortPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.TOP; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.TOP;
public class DSColumnAdvancedPane extends BasicPane { public class DSColumnAdvancedPane extends BasicPane {
private static final String InsetText = " ";
private SortPane sortPane; private SortPane sortPane;
private SelectCountPane selectCountPane; private SelectCountPane selectCountPane;
private ValuePane valuePane; private ValuePane valuePane;
@ -66,78 +60,55 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
private void initScrollPane() { private void initScrollPane() {
ScrollPane scrollPane = new ScrollPane(contentPane); this.setLayout(new BorderLayout());
UIScrollPane scrollPane = new UIScrollPane(contentPane);
this.add(scrollPane); this.add(scrollPane);
} }
private void initContentPane(int setting) { private void initContentPane(int setting) {
contentPane = new JPanel(); contentPane = new JPanel();
contentPane.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
contentPane.setLayout(FRGUIPaneFactory.createBorderLayout()); contentPane.setLayout(FRGUIPaneFactory.createBorderLayout());
sortPane = new SortPane(); sortPane = new SortPane();
sortPane.setBorder(UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order")));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
selectCountPane = new SelectCountPane(); selectCountPane = new SelectCountPane();
selectCountPane.setBorder(UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Results_Filter")));
} }
valuePane = new ValuePane(); valuePane = new ValuePane();
valuePane.setBorder(UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Custom_Data_Appearance")));
JPanel extendablePane = null; Component extendablePane = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
// extendableDirectionPane horizontalExtendableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"));
JPanel extendableDirectionPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); verticalExtendableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"));
extendablePane = row(10,
extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); cell(horizontalExtendableCheckBox), cell(verticalExtendableCheckBox)
extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))); ).getComponent();
extendablePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable"));
extendablePane.setLayout(new BorderLayout());
extendablePane.add(extendableDirectionPane, BorderLayout.CENTER);
} }
JPanel multiNumPane = null; Component multiNumPane = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
multiNumPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data"));
useMultiplyNumCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); useMultiplyNumCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Multiple"));
multiNumPane.add(useMultiplyNumCheckBox);
multiNumPane.add(new UILabel(InsetText));
multiNumSpinner = new UISpinner(1, 10000, 1, 1); multiNumSpinner = new UISpinner(1, 10000, 1, 1);
multiNumPane.add(multiNumSpinner); multiNumPane = row(10,
cell(useMultiplyNumCheckBox), cell(multiNumSpinner)
useMultiplyNumCheckBox.addActionListener(new ActionListener() { ).getComponent();
useMultiplyNumCheckBox.addActionListener(e -> checkButtonEnabled());
public void actionPerformed(ActionEvent e) {
checkButtonEnabled();
}
});
} }
// 基于row-column布局的特性,null面板不渲染
Component[][] components = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
components = new Component[][]{ contentPane.add(column(20,
{sortPane}, cell(wrapComponentWithTitle(sortPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order"))),
{selectCountPane}, cell(wrapComponentWithTitle(selectCountPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Results_Filter"))),
{valuePane}, cell(wrapComponentWithTitle(valuePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Custom_Data_Appearance"))),
{extendablePane}, cell(wrapComponentWithTitle(extendablePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable"))),
{multiNumPane} cell(wrapComponentWithTitle(multiNumPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")))
}; ).getComponent());
} else { } else {
components = new Component[][]{ contentPane.add(column(20,
{sortPane}, cell(wrapComponentWithTitle(sortPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order"))),
{valuePane}, cell(wrapComponentWithTitle(valuePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Custom_Data_Appearance")))
}; ).getComponent());
} }
contentPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED,
TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] columnSize = {TableLayout.FILL};
contentPane.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
} }
@Override @Override
@ -234,21 +205,8 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
} }
private static class ScrollPane extends UIScrollPane {
ScrollPane(Component component) {
super(component);
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
}
@Override
public Dimension getPreferredSize() {
return new Dimension(DSColumnPane.DEFAULT_DIMENSION.width - 20, DSColumnPane.DEFAULT_DIMENSION.height - 100);
}
}
private static class SortPane extends CellDSColumnSortPane { private static class SortPane extends CellDSColumnSortPane {
SortPane() { SortPane() {
this.setLayout(new FlowLayout(FlowLayout.LEFT));
} }
protected boolean needSortHeaderPane() { protected boolean needSortHeaderPane() {
@ -259,7 +217,6 @@ public class DSColumnAdvancedPane extends BasicPane {
private static class SelectCountPane extends JPanel { private static class SelectCountPane extends JPanel {
CellElement cellElement; CellElement cellElement;
// private Comparator sortComparator;
private UIComboBox selectCountComboBox; private UIComboBox selectCountComboBox;
private JPanel selectCountCardPane; private JPanel selectCountCardPane;
private UITextField serialTextField; private UITextField serialTextField;
@ -299,25 +256,24 @@ public class DSColumnAdvancedPane extends BasicPane {
}); });
selectCountCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); selectCountCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
this.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(InsetText), selectCountComboBox, this.add(row(10,
new UILabel(InsetText), selectCountCardPane}, FlowLayout.LEFT), BorderLayout.WEST); cell(selectCountComboBox),cell(selectCountCardPane)
// selectCountCardPane.setLayout(new CardLayout()); ).getComponent());
//not define pane //not define pane
JPanel undefinedPane = row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Undefined")))).getComponent();
JPanel undefinedPane = GUICoreUtils.createFlowPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Undefined")), FlowLayout.LEFT);
topFormulaPane = new JFormulaField("-1"); topFormulaPane = new JFormulaField("-1");
bottomFormulaPane = new JFormulaField("-1"); bottomFormulaPane = new JFormulaField("-1");
serialTextField = new UITextField(18); serialTextField = new UITextField(18);
JPanel oddPane = GUICoreUtils.createFlowPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Result_Serial_Number_Start_From_1")
+ " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Odd_Selected_(1,3,5...)")), FlowLayout.LEFT); JPanel oddPane = row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Result_Serial_Number_Start_From_1")
JPanel evenPane = GUICoreUtils.createFlowPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Result_Serial_Number_Start_From_1") + " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Odd_Selected_(1,3,5...)")))).getComponent();
+ " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Even_Selected_(2,4,6...)")), FlowLayout.LEFT); JPanel evenPane = row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Result_Serial_Number_Start_From_1")
JPanel specifyPane = GUICoreUtils.createFlowPane(new JComponent[]{ + " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Even_Selected_(2,4,6...)")))).getComponent();
serialTextField, new UILabel( JPanel specifyPane = row(10,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DSColumn_Result_Group_Format", "1,2-3,5,8", "$__count__") cell(serialTextField),
) cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DSColumn_Result_Group_Format", "1,2-3,5,8", "$__count__")))
}, FlowLayout.LEFT); ).getComponent();
serialTextField.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Format") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")"); serialTextField.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Format") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")");
selectCountCardPane.add(undefinedPane, "UNDEFINE"); selectCountCardPane.add(undefinedPane, "UNDEFINE");
selectCountCardPane.add(topFormulaPane, "TOP"); selectCountCardPane.add(topFormulaPane, "TOP");
@ -337,7 +293,7 @@ public class DSColumnAdvancedPane extends BasicPane {
this.cellElement = cellElement; this.cellElement = cellElement;
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); DSColumn dSColumn = (DSColumn) (cellElement.getValue());
@ -362,7 +318,7 @@ public class DSColumnAdvancedPane extends BasicPane {
return; return;
} }
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); DSColumn dSColumn = (DSColumn) (cellElement.getValue());
@ -394,19 +350,18 @@ public class DSColumnAdvancedPane extends BasicPane {
public JFormulaField(String defaultValue) { public JFormulaField(String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(new BorderLayout());
UILabel bottomLabel = new UILabel("="); UILabel bottomLabel = new UILabel("=");
bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12));
this.add(bottomLabel);
formulaTextField = new UITextField(24); formulaTextField = new UITextField(24);
this.add(formulaTextField);
formulaTextField.setText(defaultValue); formulaTextField.setText(defaultValue);
UIButton bottomFrmulaButton = new UIButton("..."); UIButton bottomFormulaButton = new UIButton("...");
this.add(bottomFrmulaButton); bottomFormulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "...");
bottomFrmulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "..."); bottomFormulaButton.addActionListener(formulaButtonActionListener);
bottomFrmulaButton.setPreferredSize(new Dimension(25, formulaTextField.getPreferredSize().height));
bottomFrmulaButton.addActionListener(formulaButtonActionListener); this.add(row(10,
cell(bottomLabel), cell(formulaTextField), cell(bottomFormulaButton)
).getComponent());
} }
public void populate(String formulaContent) { public void populate(String formulaContent) {
@ -438,7 +393,7 @@ public class DSColumnAdvancedPane extends BasicPane {
return; return;
} }
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn dsColumn = (DSColumn) value; DSColumn dsColumn = (DSColumn) value;
@ -465,11 +420,12 @@ public class DSColumnAdvancedPane extends BasicPane {
private JFormulaField formulaField; private JFormulaField formulaField;
public ValuePane() { public ValuePane() {
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(new BorderLayout());
formulaField = new JFormulaField("$$$");
this.add(new UILabel(InsetText + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") + ":")); this.add(row(10,
this.add(Box.createHorizontalStrut(2)); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") + ":")),
this.add((formulaField = new JFormulaField("$$$"))); cell(formulaField)
).getComponent());
} }
public void populate(CellElement cellElement) { public void populate(CellElement cellElement) {
@ -478,7 +434,7 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn dSColumn = (DSColumn) value; DSColumn dSColumn = (DSColumn) value;
@ -497,7 +453,7 @@ public class DSColumnAdvancedPane extends BasicPane {
return; return;
} }
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); DSColumn dSColumn = (DSColumn) (cellElement.getValue());
@ -508,10 +464,6 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
private void checkButtonEnabled() { private void checkButtonEnabled() {
if (useMultiplyNumCheckBox.isSelected()) { multiNumSpinner.setEnabled(useMultiplyNumCheckBox.isSelected());
multiNumSpinner.setEnabled(true);
} else {
multiNumSpinner.setEnabled(false);
}
} }
} }

47
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnBasicPane.java

@ -1,25 +1,23 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.expand.ConditionParentPane; import com.fr.design.expand.ConditionParentPane;
import com.fr.design.expand.ExpandDirectionPane; import com.fr.design.expand.ExpandDirectionPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class DSColumnBasicPane extends BasicPane { public class DSColumnBasicPane extends BasicPane {
private SelectedDataColumnPane selectDataColumnPane; private SelectedDataColumnPane selectDataColumnPane;
@ -57,7 +55,7 @@ public class DSColumnBasicPane extends BasicPane {
public DSColumnBasicPane(int setting) { public DSColumnBasicPane(int setting) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
selectDataColumnPane = new SelectedDataColumnPane(); selectDataColumnPane = new SelectedDataColumnPane();
@ -65,43 +63,30 @@ public class DSColumnBasicPane extends BasicPane {
selectDataColumnPane = new SelectedConfirmedDataColumnPane(); selectDataColumnPane = new SelectedConfirmedDataColumnPane();
} }
selectDataColumnPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Data_Column"), null));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
conditionParentPane = new ConditionParentPane(); conditionParentPane = new ConditionParentPane();
conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ParentCell_Setting"), null));
} }
resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED); resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED);
resultSetGroupPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting"), null));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
expandDirectionPane = new ExpandDirectionPane(); expandDirectionPane = new ExpandDirectionPane();
expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"), null));
} }
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED,
TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] columnSize = {TableLayout.FILL};
Component[][] components = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
components = new Component[][]{ this.add(column(20,
{selectDataColumnPane}, cell(wrapComponentWithTitle(selectDataColumnPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Data_Column"))),
{conditionParentPane}, cell(wrapComponentWithTitle(conditionParentPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ParentCell_Setting"))),
{resultSetGroupPane}, cell(wrapComponentWithTitle(resultSetGroupPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting"))),
{expandDirectionPane} cell(wrapComponentWithTitle(expandDirectionPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction")))
}; ).getComponent());
} else { } else {
components = new Component[][]{ this.add(column(20,
{selectDataColumnPane}, cell(wrapComponentWithTitle(selectDataColumnPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Data_Column"))),
{resultSetGroupPane}, cell(wrapComponentWithTitle(resultSetGroupPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting")))
}; ).getComponent());
} }
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
this.resultSetGroupPane.addListeners(summaryDirectionActionlistener, othergroupDirectionActionlistener, sdcupdateActionlistener); this.resultSetGroupPane.addListeners(summaryDirectionActionlistener, othergroupDirectionActionlistener, sdcupdateActionlistener);
} }

46
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnConditionsPane.java

@ -1,21 +1,22 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.condition.DSColumnLiteConditionPane; import com.fr.design.condition.DSColumnLiteConditionPane;
import com.fr.design.condition.DSColumnSimpleLiteConditionPane; import com.fr.design.condition.DSColumnSimpleLiteConditionPane;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.data.Condition; import com.fr.general.data.Condition;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.FlowLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class DSColumnConditionsPane extends BasicPane { public class DSColumnConditionsPane extends BasicPane {
//peter: Lite Condition. //peter: Lite Condition.
@ -24,15 +25,24 @@ public class DSColumnConditionsPane extends BasicPane {
//marks:是否继承父格条件 //marks:是否继承父格条件
private UICheckBox reselectExpandCheckBox; private UICheckBox reselectExpandCheckBox;
//marks:作为布局的空字符串 //marks:作为布局的空字符串
private static final String INSET_TEXT = " ";
public DSColumnConditionsPane() { public DSColumnConditionsPane() {
this(DSColumnPane.SETTING_ALL); this(DSColumnPane.SETTING_ALL);
} }
public DSColumnConditionsPane(int setting) { public DSColumnConditionsPane(int setting) {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(new BorderLayout());
Column column = new Column();
column.setSpacing(10);
if (setting > DSColumnPane.SETTING_DSRELATED) {
//alex:ReSelect
reselectExpandCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Extend_The_Conditions_of_Father_Cell(Applied_To_The_Data_Contains_Other_Data)"), false);
reselectExpandCheckBox.setSelected(true);
column.add(FineUIUtils.wrapComponentWithTitle(
row(cell(reselectExpandCheckBox)).getComponent(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_The_Conditions_Of_Father_Cell")));
}
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
liteConditionPane = new DSColumnLiteConditionPane() { liteConditionPane = new DSColumnLiteConditionPane() {
protected boolean isNeedDoWithCondition(Condition liteCondition) { protected boolean isNeedDoWithCondition(Condition liteCondition) {
@ -42,22 +52,10 @@ public class DSColumnConditionsPane extends BasicPane {
} else { } else {
liteConditionPane = new DSColumnSimpleLiteConditionPane(); liteConditionPane = new DSColumnSimpleLiteConditionPane();
} }
this.add(liteConditionPane, BorderLayout.CENTER); column.add(liteConditionPane);
column.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(column);
if (setting > DSColumnPane.SETTING_DSRELATED) {
//alex:ReSelect
JPanel pane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
// pane.setLayout(new BoxLayout(pane, BoxLayout.X_AXIS));
pane.add(new UILabel(INSET_TEXT));
reselectExpandCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Extend_The_Conditions_of_Father_Cell(Applied_To_The_Data_Contains_Other_Data)"), false);
pane.add(reselectExpandCheckBox);
reselectExpandCheckBox.setSelected(true);
JPanel reSelectPane = GUICoreUtils.createFlowPane(pane, FlowLayout.LEFT);
this.add(reSelectPane, BorderLayout.NORTH);
reSelectPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_The_Conditions_Of_Father_Cell"), null));
}
} }
@Override @Override
@ -70,7 +68,7 @@ public class DSColumnConditionsPane extends BasicPane {
return; return;
} }
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn linearDSColumn = (DSColumn) value; DSColumn linearDSColumn = (DSColumn) value;
@ -90,7 +88,7 @@ public class DSColumnConditionsPane extends BasicPane {
return; return;
} }
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value == null || !(value instanceof DSColumn)) { if (!(value instanceof DSColumn)) {
return; return;
} }
DSColumn linearDSColumn = (DSColumn) value; DSColumn linearDSColumn = (DSColumn) value;

41
designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPopUpPane.java

@ -1,37 +1,38 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.icombobox.FunctionComboBox; import com.fr.design.gui.icombobox.FunctionComboBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.core.group.*;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.cellattr.core.group.CustomGrouper;
import javax.swing.*; import com.fr.report.cell.cellattr.core.group.DSColumn;
import java.awt.*; import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.RecordGrouper;
import com.fr.report.cell.cellattr.core.group.SummaryGrouper;
import javax.swing.ButtonGroup;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
public class ResultSetGroupPopUpPane extends ResultSetGroupPane { public class ResultSetGroupPopUpPane extends ResultSetGroupPane {
private UIRadioButton groupRadioButton; private UIRadioButton groupRadioButton;
private UIButton advancedButton; private UIButton advancedButton;
private UIRadioButton listRadioButton; private UIRadioButton listRadioButton;
private UIRadioButton summaryRadioButton; private UIRadioButton summaryRadioButton;
private FunctionComboBox functionComboBox; private FunctionComboBox functionComboBox;
private String InsertText = StringUtils.BLANK;
public ResultSetGroupPopUpPane() { public ResultSetGroupPopUpPane() {
this(true); this(true);
} }
@ -43,7 +44,7 @@ public class ResultSetGroupPopUpPane extends ResultSetGroupPane {
} }
public void initComponents(boolean isGroup) { public void initComponents(boolean isGroup) {
this.setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); this.setLayout(new BorderLayout());
// 分组 // 分组
groupRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Group(Merger_The_Items_Which_Have_The_Same_Value_in_Column)")); groupRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Group(Merger_The_Items_Which_Have_The_Same_Value_in_Column)"));
@ -56,22 +57,25 @@ public class ResultSetGroupPopUpPane extends ResultSetGroupPane {
}); });
advancedButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")); advancedButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"));
advancedButton.addActionListener(groupAdvancedListener); advancedButton.addActionListener(groupAdvancedListener);
this.add(GUICoreUtils.createFlowPane(
new JComponent[]{new UILabel(InsertText), groupRadioButton, groupComboBox, advancedButton}, FlowLayout.LEFT));
// 列表 // 列表
listRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Select(Regardless_of_Having_the_Same_Value,Display_All_Item_in_Column)")); listRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Select(Regardless_of_Having_the_Same_Value,Display_All_Item_in_Column)"));
listRadioButton.addActionListener(checkEnabledActionListener); listRadioButton.addActionListener(checkEnabledActionListener);
this.add(GUICoreUtils.createFlowPane(
new JComponent[]{new UILabel(InsertText), listRadioButton}, FlowLayout.LEFT));
// 汇总 // 汇总
summaryRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Summary(Including_SUM_,_AVERAGE_,_MAX_,_MIN_And_So_On)"), true); summaryRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Summary(Including_SUM_,_AVERAGE_,_MAX_,_MIN_And_So_On)"), true);
summaryRadioButton.addActionListener(checkEnabledActionListener); summaryRadioButton.addActionListener(checkEnabledActionListener);
functionComboBox = new FunctionComboBox(GUICoreUtils.getFunctionArray()); functionComboBox = new FunctionComboBox(GUICoreUtils.getFunctionArray());
this.add(GUICoreUtils.createFlowPane(
new JComponent[]{new UILabel(InsertText), summaryRadioButton, functionComboBox}, FlowLayout.LEFT));
this.add(column(LayoutConstants.VERTICAL_GAP,
row(10,
cell(groupRadioButton), cell(groupComboBox), cell(advancedButton)
),
cell(listRadioButton),
row(10,
cell(summaryRadioButton), cell(functionComboBox)
)
).getComponent());
ButtonGroup resultSetGroupButtonGroup = new ButtonGroup(); ButtonGroup resultSetGroupButtonGroup = new ButtonGroup();
resultSetGroupButtonGroup.add(groupRadioButton); resultSetGroupButtonGroup.add(groupRadioButton);
@ -142,7 +146,6 @@ public class ResultSetGroupPopUpPane extends ResultSetGroupPane {
SummaryGrouper summaryGrouper = new SummaryGrouper(); SummaryGrouper summaryGrouper = new SummaryGrouper();
summaryGrouper.setFunction(functionComboBox.getFunction()); summaryGrouper.setFunction(functionComboBox.getFunction());
recordGrouper = summaryGrouper; recordGrouper = summaryGrouper;
} else {
} }
dSColumn.setGrouper(recordGrouper); dSColumn.setGrouper(recordGrouper);

41
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -1,6 +1,5 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.data.SimpleDSColumn; import com.fr.data.SimpleDSColumn;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
@ -16,8 +15,6 @@ import com.fr.design.gui.icombobox.LazyComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
@ -29,9 +26,7 @@ import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -43,6 +38,7 @@ import java.util.Objects;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
/** /**
@ -157,28 +153,21 @@ public class SelectedDataColumnPane extends BasicPane {
}; };
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
double p = TableLayout.PREFERRED;
UILabel dsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData") + ":"); UILabel dsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData") + ":");
UILabel dcLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column") + ":"); UILabel dcLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column") + ":");
if (showParameterButton) { paramButton.setVisible(showParameterButton);
dsLabel.setPreferredSize(new Dimension(200, 25)); this.setLayout(new BorderLayout());
dcLabel.setPreferredSize(new Dimension(200, 25)); this.add(row(10,
} row(
if (showParameterButton) { cell(dsLabel).weight(0.1),
Component[][] comps = {{dsLabel, null, dcLabel}, {tableNameComboBox, paramButton, columnNameComboBox}}; cell(tableNameComboBox).weight(0.3)
this.add(TableLayoutHelper.createTableLayoutPane(comps, new double[]{p, p}, new double[]{p, p, p})); ).weight(0.3),
} else { cell(paramButton).weight(0.2),
double f = TableLayout.FILL; row(
double[] columnSize = {p, f}; cell(dcLabel).weight(0.1),
double[] rowSize = {p, p}; cell(columnNameComboBox).weight(0.3)
Component[][] components = new Component[][]{ ).weight(0.3)
new Component[]{dsLabel, tableNameComboBox}, ).getComponent());
new Component[]{dcLabel, columnNameComboBox}
};
JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(jPanel, BorderLayout.CENTER);
}
} }
@ -200,7 +189,7 @@ public class SelectedDataColumnPane extends BasicPane {
UILabel dpLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Dynamic_Parameter")); UILabel dpLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Dynamic_Parameter"));
UILabel dcLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column")); UILabel dcLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column"));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, this.add(column(LayoutConstants.VERTICAL_GAP,
row( row(
cell(dsLabel).weight(1.2), cell(tableNameComboBox).weight(3) cell(dsLabel).weight(1.2), cell(tableNameComboBox).weight(3)
), ),

46
designer-realize/src/main/java/com/fr/design/expand/ConditionParentPane.java

@ -1,19 +1,18 @@
package com.fr.design.expand; package com.fr.design.expand;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class ConditionParentPane extends JPanel { public class ConditionParentPane extends JPanel {
private ParentPane leftParentPane; private ParentPane leftParentPane;
@ -29,21 +28,20 @@ public class ConditionParentPane extends JPanel {
public void initComponents(ActionListener listener) { public void initComponents(ActionListener listener) {
JPanel innerthis=FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); this.setLayout(new BorderLayout());
this.add(innerthis); leftParentPane = new ParentPane(ParentPane.LEFT, listener);
upParentPane = new ParentPane(ParentPane.UP, listener);
this.add(row(10,
JPanel eastPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); row(
innerthis.add(eastPane); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Left_Parent") + ": ")).weight(0.1),
cell(leftParentPane).weight(0.3)
eastPane.add(GUICoreUtils.createFlowPane(new JComponent[] { ).weight(0.3),
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Left_Parent") + ": "), row(
leftParentPane = new ParentPane(ParentPane.LEFT, listener) }, FlowLayout.LEFT)); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Up_Parent") + ": ")).weight(0.1),
cell(upParentPane).weight(0.3)
eastPane.add(GUICoreUtils.createFlowPane( ).weight(0.3),
new JComponent[] { flex(0.2)
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Up_Parent") + ": "), ).getComponent());
upParentPane = new ParentPane(ParentPane.UP, listener) }, FlowLayout.LEFT));
} }
public void putElementcase(ElementCasePane t){ public void putElementcase(ElementCasePane t){
leftParentPane.putElementcase(t); leftParentPane.putElementcase(t);

26
designer-realize/src/main/java/com/fr/design/expand/ExpandDirectionPane.java

@ -1,18 +1,16 @@
package com.fr.design.expand; package com.fr.design.expand;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Component; import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* *
* @editor zhou * @editor zhou
@ -23,7 +21,6 @@ public class ExpandDirectionPane extends JPanel {
private UIRadioButton t2bRadioButton; private UIRadioButton t2bRadioButton;
private UIRadioButton l2rRadioButton; private UIRadioButton l2rRadioButton;
private UIRadioButton noneRadioButton; private UIRadioButton noneRadioButton;
private String InsertText = StringUtils.BLANK;
public ExpandDirectionPane() { public ExpandDirectionPane() {
super(); super();
@ -31,9 +28,7 @@ public class ExpandDirectionPane extends JPanel {
} }
public void initComponents() { public void initComponents() {
this.setLayout(new GridLayout(1, 3)); this.setLayout(new BorderLayout());
JPanel innerthis=FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
this.add(innerthis);
t2bRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom")); t2bRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom"));
l2rRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right")); l2rRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right"));
noneRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Not_Expand")); noneRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Not_Expand"));
@ -41,12 +36,9 @@ public class ExpandDirectionPane extends JPanel {
bg.add(t2bRadioButton); bg.add(t2bRadioButton);
bg.add(l2rRadioButton); bg.add(l2rRadioButton);
bg.add(noneRadioButton); bg.add(noneRadioButton);
innerthis.add(GUICoreUtils.createFlowPane(new Component[]{new UILabel(InsertText), t2bRadioButton}, this.add(row(10,
FlowLayout.LEFT)); cell(t2bRadioButton), cell(l2rRadioButton), cell(noneRadioButton)
innerthis.add(GUICoreUtils.createFlowPane(new Component[]{new UILabel(InsertText), l2rRadioButton}, ).getComponent());
FlowLayout.LEFT));
innerthis.add(GUICoreUtils.createFlowPane(new Component[]{new UILabel(InsertText), noneRadioButton},
FlowLayout.LEFT));
} }
public void populate(CellExpandAttr cellExpandAttr) { public void populate(CellExpandAttr cellExpandAttr) {

Loading…
Cancel
Save