Browse Source

REPORT-63808 【主题优化】格式单独拿出来以后,发现数据列的弹窗配置中没有格式项

【问题原因】
格式设置项从样式中分离出来后,数据列的弹窗
中需要增加格式设置

【改动思路】
同上
feature/x
Starryi 3 years ago
parent
commit
9abcb9db6d
  1. 60
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

60
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);

Loading…
Cancel
Save