From 9abcb9db6d2bb308c7c1922cf234af1ad49dc356 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 7 Dec 2021 14:00:22 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-63808=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E6=A0=BC=E5=BC=8F=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E6=8B=BF=E5=87=BA=E6=9D=A5=E4=BB=A5=E5=90=8E=EF=BC=8C=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E6=95=B0=E6=8D=AE=E5=88=97=E7=9A=84=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=AD=E6=B2=A1=E6=9C=89=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 格式设置项从样式中分离出来后,数据列的弹窗 中需要增加格式设置 【改动思路】 同上 --- .../design/dscolumn/DSColumnAdvancedPane.java | 60 +++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 0941b4b22..fdc14efa3 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -9,21 +9,25 @@ import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.SortFormulaPane; import com.fr.design.formula.UIFormula; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.style.TextFormatPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.FormatPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.SelectCount; +import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; import javax.swing.*; import java.awt.*; @@ -40,6 +44,7 @@ public class DSColumnAdvancedPane extends BasicPane { private SortPane sortPane; private SelectCountPane selectCountPane; private ValuePane valuePane; + private FormatAttrPane formatAttrPane; private UICheckBox horizontalExtendableCheckBox; private UICheckBox verticalExtendableCheckBox; private UICheckBox useMultiplyNumCheckBox; @@ -64,6 +69,8 @@ public class DSColumnAdvancedPane extends BasicPane { valuePane = new ValuePane(); valuePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Custom_Data_Appearance"), null)); + formatAttrPane = new FormatAttrPane(); + JPanel extendablePane = null; if (setting > DSColumnPane.SETTING_DSRELATED) { @@ -96,25 +103,28 @@ public class DSColumnAdvancedPane extends BasicPane { }); } - double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, - TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; - double[] columnSize = {TableLayout.FILL}; - Component[][] components = null; if (setting > DSColumnPane.SETTING_DSRELATED) { components = new Component[][]{ {sortPane}, {selectCountPane}, {valuePane}, + {formatAttrPane}, {extendablePane}, {multiNumPane} }; } else { components = new Component[][]{ {sortPane}, - {valuePane} + {valuePane}, + {formatAttrPane} }; } + + double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, + TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; + double[] columnSize = {TableLayout.FILL}; + this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); } @@ -130,6 +140,7 @@ public class DSColumnAdvancedPane extends BasicPane { sortPane.populate(cellElement); valuePane.populate(cellElement); + formatAttrPane.populate(cellElement); if (selectCountPane != null) { selectCountPane.populate(cellElement); @@ -179,6 +190,7 @@ public class DSColumnAdvancedPane extends BasicPane { sortPane.update(cellElement); valuePane.update(cellElement); + formatAttrPane.update(cellElement); if (selectCountPane != null) { selectCountPane.update(cellElement); @@ -526,6 +538,44 @@ public class DSColumnAdvancedPane extends BasicPane { } } + public class FormatAttrPane extends AbstractAttrNoScrollPane { + private TextFormatPane formatPane; + + @Override + protected JPanel createContentPane() { + this.formatPane = new TextFormatPane(); + return this.formatPane; + } + + @Override + public Dimension getPreferredSize() { + if (formatPane == null) { + return super.getPreferredSize(); + } + return formatPane.getPreferredSize(); + } + + protected void initContentPane() { + leftContentPane = createContentPane(); + if (leftContentPane != null) { + leftContentPane.setBorder(BorderFactory.createEmptyBorder()); + this.add(leftContentPane, BorderLayout.CENTER); + } + } + + public void populate(CellElement cellElement) { + if (cellElement != null && formatPane != null) { + formatPane.populateBean(cellElement.getStyle()); + } + } + + public void update(CellElement cellElement) { + if (cellElement != null && formatPane != null) { + cellElement.setStyle(formatPane.update(cellElement.getStyle())); + } + } + } + private void checkButtonEnabled() { if (useMultiplyNumCheckBox.isSelected()) { multiNumSpinner.setEnabled(true);