|
|
@ -1,25 +1,23 @@ |
|
|
|
package com.fr.design.dscolumn; |
|
|
|
package com.fr.design.dscolumn; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.data.TableDataSource; |
|
|
|
import com.fr.data.TableDataSource; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.expand.ConditionParentPane; |
|
|
|
import com.fr.design.expand.ConditionParentPane; |
|
|
|
import com.fr.design.expand.ExpandDirectionPane; |
|
|
|
import com.fr.design.expand.ExpandDirectionPane; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.report.cell.CellElement; |
|
|
|
import com.fr.report.cell.CellElement; |
|
|
|
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; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
public class DSColumnBasicPane extends BasicPane { |
|
|
|
public class DSColumnBasicPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
@ -30,54 +28,54 @@ public class DSColumnBasicPane extends BasicPane { |
|
|
|
private CellElement cellElement; |
|
|
|
private CellElement cellElement; |
|
|
|
|
|
|
|
|
|
|
|
public DSColumnBasicPane() { |
|
|
|
public DSColumnBasicPane() { |
|
|
|
this(DSColumnPane.SETTING_ALL); |
|
|
|
this(DSColumnPane.SETTING_ALL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DSColumnBasicPane(int setting) { |
|
|
|
public DSColumnBasicPane(int setting) { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); |
|
|
|
|
|
|
|
|
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
selectDataColumnPane = new SelectedDataColumnPane(); |
|
|
|
selectDataColumnPane = new SelectedDataColumnPane(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
selectDataColumnPane = new SelectedConfirmedDataColumnPane(); |
|
|
|
selectDataColumnPane = new SelectedConfirmedDataColumnPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
selectDataColumnPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Select_DataColumn"), null)); |
|
|
|
selectDataColumnPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Select_DataColumn"), null)); |
|
|
|
|
|
|
|
|
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
conditionParentPane = new ConditionParentPane(); |
|
|
|
conditionParentPane = new ConditionParentPane(); |
|
|
|
conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ParentCell_Setting"), null)); |
|
|
|
conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ParentCell_Setting"), null)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED); |
|
|
|
resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED); |
|
|
|
resultSetGroupPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Data_Setting"), null)); |
|
|
|
resultSetGroupPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Data_Setting"), null)); |
|
|
|
|
|
|
|
|
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
expandDirectionPane = new ExpandDirectionPane(); |
|
|
|
expandDirectionPane = new ExpandDirectionPane(); |
|
|
|
expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ExpandD-Expand_Direction"), null)); |
|
|
|
expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ExpandD-Expand_Direction"), null)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, |
|
|
|
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, |
|
|
|
TableLayout.PREFERRED, TableLayout.PREFERRED}; |
|
|
|
TableLayout.PREFERRED, TableLayout.PREFERRED}; |
|
|
|
double[] columnSize = {TableLayout.FILL}; |
|
|
|
double[] columnSize = {TableLayout.FILL}; |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = null; |
|
|
|
Component[][] components = null; |
|
|
|
|
|
|
|
|
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
if (setting > DSColumnPane.SETTING_DSRELATED) { |
|
|
|
components = new Component[][]{ |
|
|
|
components = new Component[][]{ |
|
|
|
{selectDataColumnPane}, |
|
|
|
{selectDataColumnPane}, |
|
|
|
{conditionParentPane}, |
|
|
|
{conditionParentPane}, |
|
|
|
{resultSetGroupPane}, |
|
|
|
{resultSetGroupPane}, |
|
|
|
{expandDirectionPane} |
|
|
|
{expandDirectionPane} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
components = new Component[][]{ |
|
|
|
components = new Component[][]{ |
|
|
|
{selectDataColumnPane}, |
|
|
|
{selectDataColumnPane}, |
|
|
|
{resultSetGroupPane}, |
|
|
|
{resultSetGroupPane}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); |
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
this.resultSetGroupPane.addListeners(summary_direction_ActionListener, otherGroup_direction_ActionListener, sdcUpdate_ActionListener); |
|
|
|
this.resultSetGroupPane.addListeners(summary_direction_ActionListener, otherGroup_direction_ActionListener, sdcUpdate_ActionListener); |
|
|
@ -85,24 +83,24 @@ public class DSColumnBasicPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return Inter.getLocText("Basic"); |
|
|
|
return Inter.getLocText("Basic"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(TableDataSource source, TemplateCellElement cellElement) { |
|
|
|
public void populate(TableDataSource source, TemplateCellElement cellElement) { |
|
|
|
if (cellElement == null) { |
|
|
|
if (cellElement == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.cellElement = cellElement; |
|
|
|
this.cellElement = cellElement; |
|
|
|
|
|
|
|
|
|
|
|
selectDataColumnPane.populate(source, cellElement); |
|
|
|
selectDataColumnPane.populate(source, cellElement); |
|
|
|
|
|
|
|
|
|
|
|
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); |
|
|
|
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); |
|
|
|
if (conditionParentPane != null) { |
|
|
|
if (conditionParentPane != null) { |
|
|
|
conditionParentPane.populate(cellExpandAttr); |
|
|
|
conditionParentPane.populate(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
expandDirectionPane.populate(cellExpandAttr); |
|
|
|
expandDirectionPane.populate(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
resultSetGroupPane.populate(cellElement); |
|
|
|
resultSetGroupPane.populate(cellElement); |
|
|
@ -128,27 +126,28 @@ public class DSColumnBasicPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (conditionParentPane != null) { |
|
|
|
if (conditionParentPane != null) { |
|
|
|
conditionParentPane.update(cellExpandAttr); |
|
|
|
conditionParentPane.update(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
expandDirectionPane.update(cellExpandAttr); |
|
|
|
expandDirectionPane.update(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
resultSetGroupPane.update(); |
|
|
|
resultSetGroupPane.update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ActionListener summary_direction_ActionListener = new ActionListener() { |
|
|
|
ActionListener summary_direction_ActionListener = new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
expandDirectionPane.setNoneRadioButtonSelected(true); |
|
|
|
expandDirectionPane.setNoneRadioButtonSelected(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
ActionListener otherGroup_direction_ActionListener = new ActionListener() { |
|
|
|
ActionListener otherGroup_direction_ActionListener = new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
if (expandDirectionPane != null) { |
|
|
|
expandDirectionPane.setNoneRadioButtonSelected(false); |
|
|
|
expandDirectionPane.setNoneRadioButtonSelected(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
ActionListener sdcUpdate_ActionListener = new ActionListener() { |
|
|
|
ActionListener sdcUpdate_ActionListener = new ActionListener() { |
|
|
@ -157,14 +156,16 @@ public class DSColumnBasicPane extends BasicPane { |
|
|
|
selectDataColumnPane.update(cellElement); |
|
|
|
selectDataColumnPane.update(cellElement); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
public void putElementcase(ElementCasePane t){ |
|
|
|
|
|
|
|
if (conditionParentPane != null) { |
|
|
|
public void putElementcase(ElementCasePane t) { |
|
|
|
conditionParentPane.putElementcase(t); |
|
|
|
if (conditionParentPane != null) { |
|
|
|
} |
|
|
|
conditionParentPane.putElementcase(t); |
|
|
|
} |
|
|
|
} |
|
|
|
public void putCellElement(TemplateCellElement tplEC2) { |
|
|
|
} |
|
|
|
if (conditionParentPane != null) { |
|
|
|
|
|
|
|
conditionParentPane.putCellElement(tplEC2); |
|
|
|
public void putCellElement(TemplateCellElement tplEC2) { |
|
|
|
} |
|
|
|
if (conditionParentPane != null) { |
|
|
|
} |
|
|
|
conditionParentPane.putCellElement(tplEC2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |