Browse Source

Pull request #13511: REPORT-111995 单元格属性=>数据列面板布局重绘

Merge in DESIGN/design from ~LEVY.XIE/design:newui to newui

* commit '8046a7668fe57143b262c7562754a1108635a001':
  REPORT-111995 代码质量
  REPORT-111995 单元格属性=>数据列面板布局重绘
newui
Levy.Xie-解安森 12 months ago
parent
commit
f04e131a67
  1. 2
      designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java
  2. 1
      designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java
  3. 5
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  4. 163
      designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  5. 28
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  6. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/AbstractDSCellEditorPane.java
  7. 2
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java
  8. 309
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

2
designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java

@ -1,9 +1,11 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class PlatformManagerAction extends UpdateAction { public class PlatformManagerAction extends UpdateAction {

1
designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java

@ -65,6 +65,7 @@ public class ReactiveCardPane extends JPanel {
} }
removeAll(); removeAll();
add(cardFactory.get(selectKey).get(), BorderLayout.CENTER); add(cardFactory.get(selectKey).get(), BorderLayout.CENTER);
setVisible(true);
revalidate(); revalidate();
repaint(); repaint();
} }

5
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -223,11 +223,8 @@ CombinationButton.borderColor = $Component.borderColor
CombinationButton.arc = $Button.arc CombinationButton.arc = $Button.arc
#---- CheckBox ---- #---- CheckBox ----
CheckBox.border = com.formdev.flatlaf.ui.FlatMarginBorder
CheckBox.icon = com.formdev.flatlaf.icons.FlatCheckBoxIcon
CheckBox.arc = 4 CheckBox.arc = 4
CheckBox.margin = 2,2,2,2 CheckBox.margin = 2,0,2,0
CheckBox.iconTextGap = 4 CheckBox.iconTextGap = 4
CheckBox.rollover = true CheckBox.rollover = true

163
designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -1,14 +1,13 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import com.fine.swing.ui.layout.Layouts;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.FunctionComboBox; import com.fr.design.gui.icombobox.FunctionComboBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
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;
@ -21,13 +20,15 @@ import com.fr.stable.Constants;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
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.row;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
/** /**
* 这个pane是选中数据列后在上方QuickRegion处显示的pane * 这个pane是选中数据列后在上方QuickRegion处显示的pane
* *
@ -39,13 +40,11 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private static final int BIND_GROUP = 0; private static final int BIND_GROUP = 0;
private static final int BIND_SELECTED = 1; private static final int BIND_SELECTED = 1;
private static final int BIND_SUMMARY = 2; private static final int BIND_SUMMARY = 2;
private static final int DATA_SET_LABEL_WIDTH = 60;
private UIButton advancedButton; private UIButton advancedButton;
private JPanel advancedButtonRow;
private FunctionComboBox functionComboBox; private FunctionComboBox functionComboBox;
private JPanel contentPane; private ReactiveCardPane cardPane;
private JPanel cardPane;
private CardLayout cardLayout;
private UIComboBox goBox; private UIComboBox goBox;
private ItemListener listener; private ItemListener listener;
@ -56,70 +55,52 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
} }
public void initComponents() { public void initComponents() {
goBox = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Group"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Select"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Summary")}); goBox = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Group"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Select"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Summary")});
initCardPane(); initCardPane();
contentPane = layoutPane();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.CENTER); this.add(layoutPane(), BorderLayout.CENTER);
} }
private JPanel layoutPane() { private JPanel layoutPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
UILabel dataSetLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting")); UILabel dataSetLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting"));
Component[][] components = new Component[][] goBox.addItemListener(ee -> {
{ int i = goBox.getSelectedIndex();
new Component[]{dataSetLabel, UIComponentUtils.wrapWithBorderLayoutPane(goBox)}, if (i == BIND_GROUP) {
new Component[]{null, cardPane} cardPane.select("groupPane").populate();
}; } else if (i == BIND_SELECTED) {
goBox.addItemListener(new ItemListener() { cardPane.setVisible(false);
public void itemStateChanged(ItemEvent ee) { } else if (i == BIND_SUMMARY) {
int i = goBox.getSelectedIndex(); cardPane.select("summaryPane").populate();
if (i == BIND_GROUP) { CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cardLayout.show(cardPane, "groupPane"); cellExpandAttr.setDirection(Constants.NONE);
cardPane.setPreferredSize(new Dimension(158, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
} else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
} else if (i == BIND_SUMMARY) {
cardLayout.show(cardPane, "summaryPane");
cardPane.setPreferredSize(new Dimension(158, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE);
}
checkButtonEnabled();
} }
checkButtonEnabled();
}); });
return Layouts.column(LayoutConstants.VERTICAL_GAP,
double[] columnSize = {DATA_SET_LABEL_WIDTH, f}; row(
double[] rowSize = {p, p}; cell(dataSetLabel).weight(1.2), cell(goBox).weight(3)
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 8, 10); ),
cell(cardPane)
).getComponent();
} }
private void initCardPane() { private void initCardPane() {
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); groupComboBox.addItemListener(e -> checkButtonEnabled());
cardLayout = new CardLayout();
cardPane.setLayout(cardLayout);
groupComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
checkButtonEnabled();
}
});
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);
advancedButtonRow = row(flex(1.2), cell(advancedButton).weight(3)).getComponent();
JPanel pane = new JPanel(new BorderLayout(0, 10)); functionComboBox = new FunctionComboBox(GUICoreUtils.getFunctionArray());
pane.add(groupComboBox, BorderLayout.NORTH);
pane.add(advancedButton, BorderLayout.CENTER); cardPane = ReactiveCardPane.create()
cardPane.add(pane, "groupPane"); .addSupplier("groupPane", () -> column(LayoutConstants.VERTICAL_GAP,
row(flex(1.2), cell(groupComboBox).weight(3)),
cardPane.add(new JPanel(), "listPane"); cell(advancedButtonRow)
).getComponent())
cardPane.add(functionComboBox = new FunctionComboBox(GUICoreUtils.getFunctionArray()), "summaryPane"); .addSupplier("summaryPane", () -> row(
flex(1.2), cell(functionComboBox).weight(3)
).getComponent());
} }
@Override @Override
@ -132,38 +113,44 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
} }
DSColumn dSColumn = (DSColumn) cellElement.getValue(); DSColumn dSColumn = (DSColumn) cellElement.getValue();
recordGrouper = dSColumn.getGrouper(); recordGrouper = dSColumn.getGrouper();
if (recordGrouper instanceof FunctionGrouper && !((FunctionGrouper) recordGrouper).isCustom()) { if (recordGrouper instanceof FunctionGrouper) {
populateFunctionGrouper();
} else if (recordGrouper instanceof SummaryGrouper) {
cardPane.select("summaryPane").populate();
this.goBox.setSelectedIndex(BIND_SUMMARY);
this.functionComboBox.setFunction(((SummaryGrouper) recordGrouper).getFunction());
} else if (recordGrouper instanceof CustomGrouper) {
// 自定义分组 or 高级分组
cardPane.select("groupPane").populate();
this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(ADVANCED);
}
checkButtonEnabled();
//加上面板组件的交互事件监听
this.addListener();
}
private void populateFunctionGrouper() {
if (!((FunctionGrouper) recordGrouper).isCustom()) {
int mode = recordGrouper.getDivideMode(); int mode = recordGrouper.getDivideMode();
if (mode == FunctionGrouper.GROUPING_MODE) { if (mode == FunctionGrouper.GROUPING_MODE) {
cardLayout.show(cardPane, "groupPane"); cardPane.select("groupPane").populate();
this.goBox.setSelectedIndex(BIND_GROUP); this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(COMMON); this.groupComboBox.setSelectedIndex(COMMON);
} else if (mode == FunctionGrouper.CONTINUUM_MODE) { } else if (mode == FunctionGrouper.CONTINUUM_MODE) {
cardLayout.show(cardPane, "groupPane"); cardPane.select("groupPane").populate();
this.goBox.setSelectedIndex(BIND_GROUP); this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(CONTINUUM); this.groupComboBox.setSelectedIndex(CONTINUUM);
} else if (mode == FunctionGrouper.LIST_MODE) { } else if (mode == FunctionGrouper.LIST_MODE) {
cardLayout.show(cardPane, "listPane"); cardPane.setVisible(false);
this.goBox.setSelectedIndex(BIND_SELECTED); this.goBox.setSelectedIndex(BIND_SELECTED);
} }
} else if (recordGrouper instanceof FunctionGrouper && ((FunctionGrouper) recordGrouper).isCustom()) { } else {
// 这种情况也放到自定义分组里面 // 这种情况也放到自定义分组里面
cardLayout.show(cardPane, "groupPane"); cardPane.select("groupPane").populate();
this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(ADVANCED);
} else if (recordGrouper instanceof SummaryGrouper) {
cardLayout.show(cardPane, "summaryPane");
this.goBox.setSelectedIndex(BIND_SUMMARY);
this.functionComboBox.setFunction(((SummaryGrouper) recordGrouper).getFunction());
} else if (recordGrouper instanceof CustomGrouper) {
// 自定义分组 or 高级分组
cardLayout.show(cardPane, "groupPane");
this.goBox.setSelectedIndex(BIND_GROUP); this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(ADVANCED); this.groupComboBox.setSelectedIndex(ADVANCED);
} }
checkButtonEnabled();
//加上面板组件的交互事件监听
this.addListener();
} }
@Override @Override
@ -206,21 +193,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
advancedButton.setEnabled(true); advancedButton.setEnabled(true);
} }
} }
if (advancedButton.isEnabled()) { advancedButtonRow.setVisible(advancedButton.isEnabled());
cardPane.setPreferredSize(new Dimension(158, 50));
cardPane.revalidate();
cardPane.repaint();
return;
}
if (groupComboBox.isEnabled() || functionComboBox.isEnabled()) {
cardPane.setPreferredSize(new Dimension(158, 20));
cardPane.revalidate();
cardPane.repaint();
return;
}
cardPane.setPreferredSize(new Dimension(158, 0));
cardPane.revalidate();
cardPane.repaint();
} }

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

@ -1,8 +1,10 @@
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;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
@ -18,7 +20,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; 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.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.data.TableDataColumn; import com.fr.general.data.TableDataColumn;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
@ -41,6 +42,9 @@ import java.util.List;
import java.util.Objects; 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.row;
/** /**
* 数据集列动态参数设置组件 * 数据集列动态参数设置组件
* *
@ -192,20 +196,21 @@ public class SelectedDataColumnPane extends BasicPane {
} }
}; };
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel dsLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData")); UILabel dsLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData"));
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"));
double[] rowSize = new double[]{p, p, p};
double[] colSize = new double[]{60, f};
Component[][] components = {
{dsLabel, UIComponentUtils.wrapWithBorderLayoutPane(tableNameComboBox)},
{dpLabel, UIComponentUtils.wrapWithBorderLayoutPane(paramButton)},
{dcLabel, UIComponentUtils.wrapWithBorderLayoutPane(columnNameComboBox)}
};
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, 8, 10)); this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(dsLabel).weight(1.2), cell(tableNameComboBox).weight(3)
),
row(
cell(dpLabel).weight(1.2), cell(paramButton).weight(3)
),
row(
cell(dcLabel).weight(1.2), cell(columnNameComboBox).weight(3)
)
).getComponent());
} }
@ -331,7 +336,6 @@ public class SelectedDataColumnPane extends BasicPane {
protected void initTableNameComboBox() { protected void initTableNameComboBox() {
tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
tableNameComboBox.setPreferredSize(new Dimension(100, 20));
} }
@Override @Override

8
designer-realize/src/main/java/com/fr/design/mainframe/cell/AbstractDSCellEditorPane.java

@ -3,6 +3,8 @@ package com.fr.design.mainframe.cell;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.AbstractAttrPane; import com.fr.design.mainframe.AbstractAttrPane;
import java.awt.BorderLayout;
/** /**
* 右侧单元格元素面板抽象类 * 右侧单元格元素面板抽象类
* *
@ -24,6 +26,12 @@ public abstract class AbstractDSCellEditorPane extends AbstractAttrPane {
*/ */
public abstract void populate(); public abstract void populate();
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
this.add(leftContentPane, BorderLayout.CENTER);
}
}
/** /**
* 释放tc * 释放tc

2
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java

@ -4,7 +4,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.sort.header.SortHeaderPane; import com.fr.design.sort.header.SortHeaderPane;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.sort.common.CellSortAttr; import com.fr.report.core.sort.common.CellSortAttr;
import com.fr.report.core.sort.sortexpression.CellSortExpression;
import com.fr.report.core.sort.sortexpression.SortExpression; import com.fr.report.core.sort.sortexpression.SortExpression;
import com.fr.report.core.sort.header.SortHeader; import com.fr.report.core.sort.header.SortHeader;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
@ -33,6 +32,7 @@ public abstract class AbstractSortPane extends JPanel {
public AbstractSortPane(int sortPaneWidth, int sortPaneRightWidth) { public AbstractSortPane(int sortPaneWidth, int sortPaneRightWidth) {
this.sortPaneWidth = sortPaneWidth; this.sortPaneWidth = sortPaneWidth;
this.sortPaneRightWidth = sortPaneRightWidth; this.sortPaneRightWidth = sortPaneRightWidth;
this.setLayout(new BorderLayout());
initComponents(); initComponents();
} }

309
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

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

Loading…
Cancel
Save