帆软报表设计器源代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

157 lines
5.7 KiB

package com.fr.design.dscolumn;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.TableDataSource;
import com.fr.design.dialog.BasicPane;
import com.fr.design.expand.ConditionParentPane;
import com.fr.design.expand.ExpandDirectionPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class DSColumnBasicPane extends BasicPane {
private SelectedDataColumnPane selectDataColumnPane;
private ConditionParentPane conditionParentPane;
private ResultSetGroupPopUpPane resultSetGroupPane;
private ExpandDirectionPane expandDirectionPane;
private CellElement cellElement;
private ActionListener summaryDirectionActionlistener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
if (expandDirectionPane != null) {
expandDirectionPane.setNoneRadioButtonSelected(true);
}
}
};
private ActionListener othergroupDirectionActionlistener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
if (expandDirectionPane != null) {
expandDirectionPane.setNoneRadioButtonSelected(false);
}
}
};
private ActionListener sdcupdateActionlistener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
selectDataColumnPane.update(cellElement);
}
};
public DSColumnBasicPane() {
this(DSColumnPane.SETTING_ALL);
}
public DSColumnBasicPane(int setting) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
if (setting > DSColumnPane.SETTING_DSRELATED) {
selectDataColumnPane = new SelectedDataColumnPane();
} else {
selectDataColumnPane = new SelectedConfirmedDataColumnPane();
}
if (setting > DSColumnPane.SETTING_DSRELATED) {
conditionParentPane = new ConditionParentPane();
}
resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED);
if (setting > DSColumnPane.SETTING_DSRELATED) {
expandDirectionPane = new ExpandDirectionPane();
}
if (setting > DSColumnPane.SETTING_DSRELATED) {
this.add(column(20,
cell(wrapComponentWithTitle(selectDataColumnPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Data_Column"))),
cell(wrapComponentWithTitle(conditionParentPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ParentCell_Setting"))),
cell(wrapComponentWithTitle(resultSetGroupPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting"))),
cell(wrapComponentWithTitle(expandDirectionPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction")))
).getComponent());
} else {
this.add(column(20,
cell(wrapComponentWithTitle(selectDataColumnPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Data_Column"))),
cell(wrapComponentWithTitle(resultSetGroupPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting")))
).getComponent());
}
this.resultSetGroupPane.addListeners(summaryDirectionActionlistener, othergroupDirectionActionlistener, sdcupdateActionlistener);
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic");
}
public void populate(TableDataSource source, TemplateCellElement cellElement) {
if (cellElement == null) {
return;
}
this.cellElement = cellElement;
selectDataColumnPane.populate(source, cellElement, null);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (conditionParentPane != null) {
conditionParentPane.populate(cellExpandAttr);
}
if (expandDirectionPane != null) {
expandDirectionPane.populate(cellExpandAttr);
}
resultSetGroupPane.populate(cellElement);
if (expandDirectionPane != null && resultSetGroupPane.isSummaryRadioButtonSelected()) {
expandDirectionPane.setNoneRadioButtonSelected(true);
}
}
public void update(TemplateCellElement cellElement) {
if (cellElement == null) {
return;
}
selectDataColumnPane.update(cellElement);
// 设置父格和扩展方向
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (cellExpandAttr == null) {
cellExpandAttr = new CellExpandAttr();
cellElement.setCellExpandAttr(cellExpandAttr);
}
if (conditionParentPane != null) {
conditionParentPane.update(cellExpandAttr);
}
if (expandDirectionPane != null) {
expandDirectionPane.update(cellExpandAttr);
}
resultSetGroupPane.update();
}
public void putElementcase(ElementCasePane t) {
if (conditionParentPane != null) {
conditionParentPane.putElementcase(t);
}
}
public void putCellElement(TemplateCellElement tplCE) {
if (conditionParentPane != null) {
conditionParentPane.putCellElement(tplCE);
}
}
}