|
|
@ -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"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|