|
|
|
@ -12,12 +12,13 @@ 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.itextfield.UITextField; |
|
|
|
|
import com.fr.design.layout.*; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.layout.VerticalFlowLayout; |
|
|
|
|
import com.fr.design.mainframe.EastRegionContainerPane; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import com.fr.design.utils.gui.UIComponentUtils; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
|
|
import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
|
import com.fr.report.cell.TemplateCellElement; |
|
|
|
|
import com.fr.report.cell.cellattr.CellGUIAttr; |
|
|
|
@ -26,10 +27,18 @@ import com.fr.report.cell.cellattr.CellPageAttr;
|
|
|
|
|
import com.fr.report.elementcase.TemplateElementCase; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.*; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.CardLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Insets; |
|
|
|
|
import java.awt.Rectangle; |
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
|
|
|
|
@ -41,8 +50,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
|
|
|
|
|
private static final int HEAD_WDITH = 290; |
|
|
|
|
private static final int HEAD_HEIGTH = 24; |
|
|
|
|
private static final Dimension NORMAL_DIMENSION = new Dimension(155, 20); |
|
|
|
|
private static final Dimension SMALL_DIMENSION = new Dimension(150, 20); |
|
|
|
|
private static final int COMBO_WIDTH = 154; |
|
|
|
|
// normal
|
|
|
|
|
private UIButtonGroup autoshrik; |
|
|
|
|
|
|
|
|
@ -77,7 +85,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
private ValueEditorPane valueEditor; |
|
|
|
|
private CardLayout insertRowLayout; |
|
|
|
|
private JPanel insertRowPane; |
|
|
|
|
private JPanel southContentPane; |
|
|
|
|
private JPanel insertRowPolicyPane; |
|
|
|
|
private JPanel defaultValuePane; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -129,6 +137,15 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel seniorPane() { |
|
|
|
|
initInsertRowPolicyPane(); |
|
|
|
|
JPanel seniorPane = new JPanel(new BorderLayout()); |
|
|
|
|
seniorPane.add(seniorUpPane(), BorderLayout.NORTH); |
|
|
|
|
seniorPane.add(insertRowPolicyPane, BorderLayout.CENTER); |
|
|
|
|
insertRowPolicyPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
|
return seniorPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initInsertRowPolicyPane() { |
|
|
|
|
// 插入行策略
|
|
|
|
|
insertRowPolicy = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_COPY")}); |
|
|
|
@ -161,16 +178,47 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"), SwingConstants.LEFT), insertRowPolicy}, |
|
|
|
|
new Component[]{null, insertRowPane}, |
|
|
|
|
}; |
|
|
|
|
southContentPane = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize1, columnSize1, rowCount1, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
JPanel seniorPane = new JPanel(new BorderLayout()); |
|
|
|
|
seniorPane.add(seniorUpPane(), BorderLayout.NORTH); |
|
|
|
|
seniorPane.add(southContentPane, BorderLayout.CENTER); |
|
|
|
|
southContentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
|
return seniorPane; |
|
|
|
|
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize1, columnSize1, rowCount1, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel seniorUpPane() { |
|
|
|
|
JPanel pane = new JPanel(new BorderLayout()); |
|
|
|
|
// TODO: 方法之间的耦合还比较严重。现在必须先执行 createShowContentPane,再执行 createSeniorCheckPane。否则出现 npe。
|
|
|
|
|
pane.add(createShowContentPane(), BorderLayout.CENTER); |
|
|
|
|
pane.add(createSeniorCheckPane(), BorderLayout.NORTH); |
|
|
|
|
return pane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createShowContentPane() { |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
double[] colSize = {f, COMBO_WIDTH}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
|
|
|
|
|
JPanel fileNamePane = createNormal(); |
|
|
|
|
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); |
|
|
|
|
|
|
|
|
|
UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT); |
|
|
|
|
UILabel toolTipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip")); |
|
|
|
|
UIComponentUtils.setLineWrap(toolTipLabel); |
|
|
|
|
|
|
|
|
|
JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout()); |
|
|
|
|
toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{showContentLabel, showContent}, |
|
|
|
|
new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板
|
|
|
|
|
new Component[]{toolTipLabel, toolTipTextFieldWrapper} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
JPanel showContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
showContentPane.setBorder(BorderFactory.createEmptyBorder(6, 0, 12, 0)); |
|
|
|
|
|
|
|
|
|
return showContentPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createSeniorCheckPane() { |
|
|
|
|
previewCellContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
printAndExportContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
printAndExportBackground.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
@ -185,34 +233,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
new Component[]{printAndExportContent, null}, |
|
|
|
|
new Component[]{printAndExportBackground, null}, |
|
|
|
|
}; |
|
|
|
|
JPanel upPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); |
|
|
|
|
|
|
|
|
|
double[] downRowSize = {p, p, p, p, p, p}; |
|
|
|
|
double[] downColumnSize = {p, f}; |
|
|
|
|
int[][] downRowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
|
|
|
|
|
JPanel showContentPane = new JPanel(FRGUIPaneFactory.createRightZeroLayout()); |
|
|
|
|
showContent.setPreferredSize(SMALL_DIMENSION); |
|
|
|
|
showContentPane.add(showContent); |
|
|
|
|
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); |
|
|
|
|
|
|
|
|
|
JPanel tooltipTextFieldPane = new JPanel(FRGUIPaneFactory.createRightZeroLayout()); |
|
|
|
|
tooltipTextField.setPreferredSize(NORMAL_DIMENSION); |
|
|
|
|
tooltipTextFieldPane.add(tooltipTextField); |
|
|
|
|
|
|
|
|
|
Component[][] downComponent = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT), showContentPane}, |
|
|
|
|
new Component[]{fileNamePane, null}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"), SwingConstants.LEFT), tooltipTextFieldPane}, |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
}; |
|
|
|
|
JPanel downPane = TableLayoutHelper.createGapTableLayoutPane(downComponent, downRowSize, downColumnSize, downRowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
JPanel pane = new JPanel(new BorderLayout()); |
|
|
|
|
pane.add(upPane, BorderLayout.NORTH); |
|
|
|
|
pane.add(downPane, BorderLayout.CENTER); |
|
|
|
|
return pane; |
|
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel pagePane() { |
|
|
|
@ -391,10 +412,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
insertRowLayout.show(insertRowPane, "none"); |
|
|
|
|
insertRowPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
} |
|
|
|
|
southContentPane.setVisible(true); |
|
|
|
|
insertRowPolicyPane.setVisible(true); |
|
|
|
|
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
if (!jTemplate.isJWorkBook()) { //表单中报表块编辑屏蔽掉 插入行策略
|
|
|
|
|
southContentPane.setVisible(false); |
|
|
|
|
insertRowPolicyPane.setVisible(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|