|
|
@ -1,6 +1,9 @@ |
|
|
|
package com.fr.quickeditor.cellquick; |
|
|
|
package com.fr.quickeditor.cellquick; |
|
|
|
|
|
|
|
|
|
|
|
import com.fine.swing.ui.layout.Layouts; |
|
|
|
import com.fine.swing.ui.layout.Layouts; |
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
|
|
|
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.design.actions.columnrow.DSColumnConditionAction; |
|
|
|
import com.fr.design.actions.columnrow.DSColumnConditionAction; |
|
|
|
import com.fr.design.actions.core.ActionFactory; |
|
|
|
import com.fr.design.actions.core.ActionFactory; |
|
|
@ -17,6 +20,7 @@ import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.formula.CustomVariableResolver; |
|
|
|
import com.fr.design.formula.CustomVariableResolver; |
|
|
|
import com.fr.design.formula.FormulaFactory; |
|
|
|
import com.fr.design.formula.FormulaFactory; |
|
|
|
import com.fr.design.formula.UIFormula; |
|
|
|
import com.fr.design.formula.UIFormula; |
|
|
|
|
|
|
|
import com.fr.design.gui.core.ReactiveCardPane; |
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIHeadGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIHeadGroup; |
|
|
@ -28,13 +32,9 @@ 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.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
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.cell.AbstractDSCellEditorPane; |
|
|
|
import com.fr.design.mainframe.cell.AbstractDSCellEditorPane; |
|
|
|
import com.fr.design.sort.celldscolumn.CellDSColumnSortPane; |
|
|
|
import com.fr.design.sort.celldscolumn.CellDSColumnSortPane; |
|
|
|
import com.fr.design.utils.gui.UIComponentUtils; |
|
|
|
|
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
import com.fr.grid.selection.CellSelection; |
|
|
|
import com.fr.grid.selection.CellSelection; |
|
|
|
import com.fr.quickeditor.CellQuickEditor; |
|
|
|
import com.fr.quickeditor.CellQuickEditor; |
|
|
|
import com.fr.report.cell.CellElement; |
|
|
|
import com.fr.report.cell.CellElement; |
|
|
@ -45,15 +45,12 @@ import com.fr.report.cell.cellattr.core.group.FilterTypeEnum; |
|
|
|
import com.fr.report.cell.cellattr.core.group.SelectCount; |
|
|
|
import com.fr.report.cell.cellattr.core.group.SelectCount; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JComponent; |
|
|
|
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.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
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; |
|
|
@ -63,6 +60,9 @@ import java.util.Arrays; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
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.row; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
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.EVEN; |
|
|
|
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.EVEN; |
|
|
|
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.ODD; |
|
|
|
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.ODD; |
|
|
@ -79,9 +79,6 @@ import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.UNDEFINE; |
|
|
|
* @since 9.0 |
|
|
|
* @since 9.0 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL; |
|
|
|
|
|
|
|
private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 基本和高级设置 |
|
|
|
* 基本和高级设置 |
|
|
@ -275,13 +272,6 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
).getComponent(); |
|
|
|
).getComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initContentPane() { |
|
|
|
|
|
|
|
leftContentPane = createContentPane(); |
|
|
|
|
|
|
|
if (leftContentPane != null) { |
|
|
|
|
|
|
|
this.add(leftContentPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initComponents(){ |
|
|
|
private void initComponents(){ |
|
|
|
dataPane = new SelectedDataColumnPane(true, true); |
|
|
|
dataPane = new SelectedDataColumnPane(true, true); |
|
|
|
groupPane = new ResultSetGroupDockingPane(); |
|
|
|
groupPane = new ResultSetGroupDockingPane(); |
|
|
@ -295,7 +285,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
condition.setSmallIcon(UIConstants.EMPTY_ICON); |
|
|
|
condition.setSmallIcon(UIConstants.EMPTY_ICON); |
|
|
|
condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); |
|
|
|
condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); |
|
|
|
conditionUIButton = new UIButton(condition); |
|
|
|
conditionUIButton = new UIButton(condition); |
|
|
|
conditionPane = Layouts.row(cell(uiLabel).weight(1.2),cell(conditionUIButton).weight(3)).getComponent(); |
|
|
|
conditionPane = row(cell(uiLabel).weight(1.2),cell(conditionUIButton).weight(3)).getComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initListener() { |
|
|
|
private void initListener() { |
|
|
@ -411,10 +401,8 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DSColumnAdvancedEditorPane() { |
|
|
|
public DSColumnAdvancedEditorPane() { |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getIconPath() { |
|
|
|
public String getIconPath() { |
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Advanced"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Advanced"); |
|
|
@ -425,8 +413,6 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Advanced"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Advanced"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void update() { |
|
|
|
public void update() { |
|
|
|
if (cellElement != null) { |
|
|
|
if (cellElement != null) { |
|
|
@ -548,49 +534,33 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected JPanel createContentPane() { |
|
|
|
protected JPanel createContentPane() { |
|
|
|
JPanel contentPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
JPanel contentPane = new JPanel(new BorderLayout()); |
|
|
|
//结果筛选
|
|
|
|
//结果筛选
|
|
|
|
filterPane = new ResultSetFilterConfigPane(); |
|
|
|
filterPane = new ResultSetFilterConfigPane(); |
|
|
|
|
|
|
|
|
|
|
|
//自定义值显示
|
|
|
|
//自定义值显示
|
|
|
|
valuePane = new CustomValuePane(); |
|
|
|
valuePane = new CustomValuePane(); |
|
|
|
|
|
|
|
|
|
|
|
//可扩展性
|
|
|
|
|
|
|
|
JPanel extendableDirectionPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
|
|
|
|
|
|
|
extendableDirectionPane.add(heCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); |
|
|
|
|
|
|
|
extendableDirectionPane.add(veCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//补充空白数据
|
|
|
|
//补充空白数据
|
|
|
|
JPanel multiNumPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
|
|
|
|
|
|
|
useMultiNumCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")); |
|
|
|
useMultiNumCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")); |
|
|
|
JPanel checkBoxPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
checkBoxPane.add(useMultiNumCheckBox, BorderLayout.WEST); |
|
|
|
|
|
|
|
multiNumPane.add(checkBoxPane); |
|
|
|
|
|
|
|
multiNumSpinner = new UISpinner(1, 10000, 1, 1); |
|
|
|
multiNumSpinner = new UISpinner(1, 10000, 1, 1); |
|
|
|
|
|
|
|
|
|
|
|
//数据倍数
|
|
|
|
//数据倍数
|
|
|
|
UILabel multipleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); |
|
|
|
UILabel multipleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); |
|
|
|
multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
multiPane = Layouts.row( |
|
|
|
new Component[]{ |
|
|
|
cell(multipleLabel).weight(1.2), cell(multiNumSpinner).weight(3) |
|
|
|
multipleLabel, multiNumSpinner |
|
|
|
).getComponent(); |
|
|
|
} |
|
|
|
JPanel multiNumPane = Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP |
|
|
|
cell(useMultiNumCheckBox), |
|
|
|
); |
|
|
|
cell(multiPane) |
|
|
|
multiPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); |
|
|
|
).getComponent(); |
|
|
|
multiNumPane.add(multiPane); |
|
|
|
|
|
|
|
|
|
|
|
// 核心面板
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
JPanel advancePropertyPane = Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
{filterPane}, |
|
|
|
cell(filterPane), |
|
|
|
{valuePane}, |
|
|
|
cell(valuePane), |
|
|
|
{extendableDirectionPane}, |
|
|
|
cell(heCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))), |
|
|
|
{multiNumPane} |
|
|
|
cell(veCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))), |
|
|
|
}; |
|
|
|
cell(multiNumPane) |
|
|
|
|
|
|
|
).getComponent(); |
|
|
|
double[] rowSize = new double[components.length]; |
|
|
|
|
|
|
|
Arrays.fill(rowSize, P); |
|
|
|
|
|
|
|
double[] columnSize = {F}; |
|
|
|
|
|
|
|
JPanel advancePropertyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); |
|
|
|
|
|
|
|
contentPane.add(advancePropertyPane, BorderLayout.NORTH); |
|
|
|
contentPane.add(advancePropertyPane, BorderLayout.NORTH); |
|
|
|
UIExpandablePane sortUIExpandablePane = |
|
|
|
UIExpandablePane sortUIExpandablePane = |
|
|
|
new UIExpandablePane(Toolkit.i18nText("Fine-Design_Sort_Data_Column_Sort"), |
|
|
|
new UIExpandablePane(Toolkit.i18nText("Fine-Design_Sort_Data_Column_Sort"), |
|
|
@ -619,8 +589,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
|
|
|
|
|
|
|
|
private JPanel contentPane; |
|
|
|
private JPanel contentPane; |
|
|
|
private UIComboBox rsComboBox; |
|
|
|
private UIComboBox rsComboBox; |
|
|
|
private JPanel setCardPane; |
|
|
|
private ReactiveCardPane setTipCardPane; |
|
|
|
private JPanel tipCardPane; |
|
|
|
|
|
|
|
private UITextField serialTextField; |
|
|
|
private UITextField serialTextField; |
|
|
|
private JFormulaField topFormulaPane; |
|
|
|
private JFormulaField topFormulaPane; |
|
|
|
private JFormulaField bottomFormulaPane; |
|
|
|
private JFormulaField bottomFormulaPane; |
|
|
@ -629,63 +598,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
int selectIndex = rsComboBox.getSelectedIndex(); |
|
|
|
int selectIndex = rsComboBox.getSelectedIndex(); |
|
|
|
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout(); |
|
|
|
changeSetTipCardPane(selectIndex); |
|
|
|
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout(); |
|
|
|
|
|
|
|
if (selectIndex == TOP.getValue()) { |
|
|
|
|
|
|
|
//前N个
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, TOP.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, TOP.name()); |
|
|
|
|
|
|
|
//隐藏tip 显示set
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
} else if (selectIndex == BOTTOM.getValue()) { |
|
|
|
|
|
|
|
//后N个
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, BOTTOM.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, BOTTOM.name()); |
|
|
|
|
|
|
|
//隐藏tip 显示set
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
} else if (selectIndex == ODD.getValue()) { |
|
|
|
|
|
|
|
//奇数
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, ODD.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, ODD.name()); |
|
|
|
|
|
|
|
//隐藏set 显示tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); |
|
|
|
|
|
|
|
} else if (selectIndex == EVEN.getValue()) { |
|
|
|
|
|
|
|
//偶数
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, EVEN.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, EVEN.name()); |
|
|
|
|
|
|
|
//隐藏set 显示tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); |
|
|
|
|
|
|
|
} else if (selectIndex == SPECIFY.getValue()) { |
|
|
|
|
|
|
|
//指定
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, SPECIFY.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, SPECIFY.name()); |
|
|
|
|
|
|
|
//显示set和tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 50)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//未定义
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, UNDEFINE.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name()); |
|
|
|
|
|
|
|
//隐藏set和tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -702,50 +615,47 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
Toolkit.i18nText("Fine-Design_Report_Specify") |
|
|
|
Toolkit.i18nText("Fine-Design_Report_Specify") |
|
|
|
}); |
|
|
|
}); |
|
|
|
rsComboBox.addActionListener(actionListener); |
|
|
|
rsComboBox.addActionListener(actionListener); |
|
|
|
//配置展示CardLayout
|
|
|
|
initSetTipCardPane(); |
|
|
|
setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
contentPane = Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
//提示信息展示CardLayout
|
|
|
|
row( |
|
|
|
tipCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
cell(filterLabel).weight(1.2), cell(rsComboBox).weight(3) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
cell(setTipCardPane) |
|
|
|
|
|
|
|
).getComponent(); |
|
|
|
|
|
|
|
this.add(contentPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initSetTipCardPane() { |
|
|
|
//前N个
|
|
|
|
//前N个
|
|
|
|
topFormulaPane = new JFormulaField(DEFAULT_VALUE); |
|
|
|
topFormulaPane = new JFormulaField(DEFAULT_VALUE); |
|
|
|
setCardPane.add(topFormulaPane, TOP.name()); |
|
|
|
|
|
|
|
tipCardPane.add(new JPanel(), TOP.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//后N个
|
|
|
|
//后N个
|
|
|
|
bottomFormulaPane = new JFormulaField(DEFAULT_VALUE); |
|
|
|
bottomFormulaPane = new JFormulaField(DEFAULT_VALUE); |
|
|
|
setCardPane.add(bottomFormulaPane, BOTTOM.name()); |
|
|
|
//自定义
|
|
|
|
tipCardPane.add(new JPanel(), BOTTOM.name()); |
|
|
|
serialTextField = new UITextField(16); |
|
|
|
|
|
|
|
|
|
|
|
//自定义值下方没有提示信息,也没有输入框
|
|
|
|
|
|
|
|
setCardPane.add(new JPanel(), UNDEFINE.name()); |
|
|
|
|
|
|
|
tipCardPane.add(new JPanel(), UNDEFINE.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//奇数 UILabel 占一行作为提示信息
|
|
|
|
|
|
|
|
setCardPane.add(new JPanel(), ODD.name()); |
|
|
|
|
|
|
|
MultilineLabel oddTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Odd_Tip")); |
|
|
|
MultilineLabel oddTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Odd_Tip")); |
|
|
|
oddTip.setForeground(TIP_FONT_COLOR); |
|
|
|
|
|
|
|
tipCardPane.add(oddTip, ODD.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//偶数 UILabel 占一行作为提示信息
|
|
|
|
|
|
|
|
setCardPane.add(new JPanel(), EVEN.name()); |
|
|
|
|
|
|
|
MultilineLabel evenTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Even_Tip")); |
|
|
|
MultilineLabel evenTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Even_Tip")); |
|
|
|
evenTip.setForeground(TIP_FONT_COLOR); |
|
|
|
|
|
|
|
tipCardPane.add(evenTip, EVEN.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//输入框占用右半边,提示信息占一行
|
|
|
|
|
|
|
|
serialTextField = new UITextField(16); |
|
|
|
|
|
|
|
setCardPane.add(serialTextField, SPECIFY.name()); |
|
|
|
|
|
|
|
MultilineLabel specifyTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Specify_Tip")); |
|
|
|
MultilineLabel specifyTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Specify_Tip")); |
|
|
|
specifyTip.setForeground(TIP_FONT_COLOR); |
|
|
|
Color tipColor = FlatUIUtils.getUIColor("Label.tipColor", Color.GRAY); |
|
|
|
tipCardPane.add(specifyTip, SPECIFY.name()); |
|
|
|
Arrays.asList(oddTip, evenTip, specifyTip).forEach(it -> it.setForeground(tipColor)); |
|
|
|
contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{ |
|
|
|
|
|
|
|
{filterLabel, rsComboBox}, |
|
|
|
setTipCardPane = ReactiveCardPane.create() |
|
|
|
{null, setCardPane}, |
|
|
|
.addSupplier(TOP.name(), () -> row(flex(1.2), cell(topFormulaPane).weight(3)).getComponent()) |
|
|
|
{tipCardPane, null} |
|
|
|
.addSupplier(BOTTOM.name(), () -> row(flex(1.2), cell(bottomFormulaPane).weight(3)).getComponent()) |
|
|
|
}, new double[]{P, P, P}, new double[]{P, F}, HGAP, new double[]{VGAP, VGAP_INNER}); |
|
|
|
.addSupplier(ODD.name(), () -> row( |
|
|
|
|
|
|
|
flex(1.2), |
|
|
|
this.add(contentPane, BorderLayout.CENTER); |
|
|
|
cell(oddTip).weight(3) |
|
|
|
|
|
|
|
).getComponent()) |
|
|
|
|
|
|
|
.addSupplier(EVEN.name(), () -> row( |
|
|
|
|
|
|
|
flex(1.2), |
|
|
|
|
|
|
|
cell(evenTip).weight(3) |
|
|
|
|
|
|
|
).getComponent()) |
|
|
|
|
|
|
|
.addSupplier(SPECIFY.name(), () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
|
|
|
row(flex(1.2), cell(serialTextField).weight(3)), |
|
|
|
|
|
|
|
row(flex(1.2), cell(specifyTip).weight(3)) |
|
|
|
|
|
|
|
).getComponent()); |
|
|
|
|
|
|
|
// 未定义不显示
|
|
|
|
|
|
|
|
setTipCardPane.setVisible(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(CellElement cellElement) { |
|
|
|
public void populate(CellElement cellElement) { |
|
|
@ -757,8 +667,6 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
SelectCount selectCount = dSColumn.getSelectCount(); |
|
|
|
SelectCount selectCount = dSColumn.getSelectCount(); |
|
|
|
this.topFormulaPane.populateElement(cellElement); |
|
|
|
this.topFormulaPane.populateElement(cellElement); |
|
|
|
this.bottomFormulaPane.populateElement(cellElement); |
|
|
|
this.bottomFormulaPane.populateElement(cellElement); |
|
|
|
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout(); |
|
|
|
|
|
|
|
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout(); |
|
|
|
|
|
|
|
// 重置默认值
|
|
|
|
// 重置默认值
|
|
|
|
this.topFormulaPane.populate(DEFAULT_VALUE); |
|
|
|
this.topFormulaPane.populate(DEFAULT_VALUE); |
|
|
|
this.bottomFormulaPane.populate(DEFAULT_VALUE); |
|
|
|
this.bottomFormulaPane.populate(DEFAULT_VALUE); |
|
|
@ -767,86 +675,28 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
if (selectCount != null) { |
|
|
|
if (selectCount != null) { |
|
|
|
int selectCountType = selectCount.getType(); |
|
|
|
int selectCountType = selectCount.getType(); |
|
|
|
this.rsComboBox.setSelectedIndex(selectCountType); |
|
|
|
this.rsComboBox.setSelectedIndex(selectCountType); |
|
|
|
switch (FilterTypeEnum.getFilterByValue(selectCountType)) { |
|
|
|
this.topFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
case TOP: |
|
|
|
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
this.topFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
this.serialTextField.setText(selectCount.getSerial()); |
|
|
|
//前N个
|
|
|
|
changeSetTipCardPane(selectCountType); |
|
|
|
setCardPaneLayout.show(setCardPane, TOP.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, TOP.name()); |
|
|
|
|
|
|
|
//隐藏tip 显示set
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case BOTTOM: |
|
|
|
|
|
|
|
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
|
|
|
|
//后N个
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, BOTTOM.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, BOTTOM.name()); |
|
|
|
|
|
|
|
//隐藏tip 显示set
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case SPECIFY: |
|
|
|
|
|
|
|
this.serialTextField.setText(selectCount.getSerial()); |
|
|
|
|
|
|
|
//指定
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, SPECIFY.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, SPECIFY.name()); |
|
|
|
|
|
|
|
//显示set和tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 50)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case EVEN: |
|
|
|
|
|
|
|
//偶数
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, EVEN.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, EVEN.name()); |
|
|
|
|
|
|
|
//隐藏set 显示tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case ODD: |
|
|
|
|
|
|
|
//奇数
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, ODD.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, ODD.name()); |
|
|
|
|
|
|
|
//隐藏set 显示tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
//未定义
|
|
|
|
|
|
|
|
setCardPaneLayout.show(setCardPane, UNDEFINE.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name()); |
|
|
|
|
|
|
|
//隐藏set和tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.rsComboBox.setSelectedIndex(0); |
|
|
|
this.rsComboBox.setSelectedIndex(0); |
|
|
|
//未定义
|
|
|
|
setTipCardPane.setVisible(false); |
|
|
|
setCardPaneLayout.show(setCardPane, UNDEFINE.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name()); |
|
|
|
|
|
|
|
//隐藏set和tip
|
|
|
|
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); |
|
|
|
|
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
rsComboBox.addActionListener(actionListener); |
|
|
|
rsComboBox.addActionListener(actionListener); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void changeSetTipCardPane(int index) { |
|
|
|
|
|
|
|
FilterTypeEnum type = FilterTypeEnum.getFilterByValue(index); |
|
|
|
|
|
|
|
if (type == UNDEFINE) { |
|
|
|
|
|
|
|
setTipCardPane.setVisible(false); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setTipCardPane.select(type.name()).populate(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void update(CellElement cellElement) { |
|
|
|
public void update(CellElement cellElement) { |
|
|
|
if (cellElement != null) { |
|
|
|
if (cellElement != null) { |
|
|
|
Object value = cellElement.getValue(); |
|
|
|
Object value = cellElement.getValue(); |
|
|
@ -912,10 +762,9 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
formulaTextField.setText(defaultValue); |
|
|
|
formulaTextField.setText(defaultValue); |
|
|
|
JPanel textFieldPane = new JPanel(new BorderLayout()); |
|
|
|
JPanel textFieldPane = new JPanel(new BorderLayout()); |
|
|
|
textFieldPane.add(formulaTextField, BorderLayout.CENTER); |
|
|
|
textFieldPane.add(formulaTextField, BorderLayout.CENTER); |
|
|
|
textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); |
|
|
|
textFieldPane.setBorder(new ScaledEmptyBorder(0, 0, 0, 5)); |
|
|
|
UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); |
|
|
|
UIButton formulaButton = new UIButton(new LazyIcon("formula")); |
|
|
|
formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); |
|
|
|
formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); |
|
|
|
formulaButton.setPreferredSize(new Dimension(20, formulaTextField.getPreferredSize().height)); |
|
|
|
|
|
|
|
formulaButton.addActionListener(formulaButtonActionListener); |
|
|
|
formulaButton.addActionListener(formulaButtonActionListener); |
|
|
|
|
|
|
|
|
|
|
|
JPanel pane = new JPanel(new BorderLayout()); |
|
|
|
JPanel pane = new JPanel(new BorderLayout()); |
|
|
@ -1000,11 +849,11 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
public CustomValuePane() { |
|
|
|
public CustomValuePane() { |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
UILabel customValueLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Display_Value")); |
|
|
|
UILabel customValueLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Display_Value")); |
|
|
|
customValueLabel.setPreferredSize(LABEL_DIMENSION); |
|
|
|
|
|
|
|
formulaField = new JFormulaField(DEFAULT_VALUE); |
|
|
|
formulaField = new JFormulaField(DEFAULT_VALUE); |
|
|
|
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
this.add(Layouts.row( |
|
|
|
new Component[]{customValueLabel, formulaField}, |
|
|
|
cell(customValueLabel).weight(1.2), |
|
|
|
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER); |
|
|
|
cell(formulaField).weight(3) |
|
|
|
|
|
|
|
).getComponent()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(CellElement cellElement) { |
|
|
|
public void populate(CellElement cellElement) { |
|
|
|