Browse Source

REPORT-82895 【11.0.11延期】单元格重复冻结优化

feature/x
Destiny.Lin 2 years ago
parent
commit
dc66634a7e
  1. 13
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java
  2. 16
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java
  3. 207
      designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

13
designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java

@ -3,6 +3,8 @@ package com.fr.design.report.freeze;
import java.awt.Dimension; import java.awt.Dimension;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
@ -27,6 +29,14 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
Dimension size = new Dimension(43, 21); Dimension size = new Dimension(43, 21);
if (start instanceof UISpinner) { if (start instanceof UISpinner) {
start.setPreferredSize(size); start.setPreferredSize(size);
((UISpinner) start).addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (end instanceof UISpinner) {
((UISpinner) end).setValue(Math.max(((UISpinner) start).getValue(), ((UISpinner) end).getValue()));
}
}
});
} }
if (end instanceof UISpinner) { if (end instanceof UISpinner) {
end.setPreferredSize(size); end.setPreferredSize(size);
@ -63,6 +73,9 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
* 给UISpinner添加Listener * 给UISpinner添加Listener
*/ */
public void addListener(ChangeListener l) { public void addListener(ChangeListener l) {
if (start instanceof UISpinner) {
((UISpinner) start).addChangeListener(l);
}
if (end instanceof UISpinner) { if (end instanceof UISpinner) {
((UISpinner) end).addChangeListener(l); ((UISpinner) end).addChangeListener(l);
} }

16
designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java

@ -9,6 +9,7 @@ import com.fr.stable.StableUtils;
public class FreezePagePane extends FreezeAndRepeatPane { public class FreezePagePane extends FreezeAndRepeatPane {
private boolean isNumber; private boolean isNumber;
private boolean isFoot;
public FreezePagePane(boolean isNumber) { public FreezePagePane(boolean isNumber) {
this.isNumber = isNumber; this.isNumber = isNumber;
@ -17,6 +18,14 @@ public class FreezePagePane extends FreezeAndRepeatPane {
super.initComponent(); super.initComponent();
} }
public FreezePagePane(boolean isNumber, boolean isFoot) {
this.isFoot = isFoot;
this.isNumber = isNumber;
start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER);
end = new UILabel(isNumber ? " 1"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") : " A"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"), SwingConstants.CENTER);
super.initComponent();
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "FreezePage"; return "FreezePage";
@ -29,6 +38,13 @@ public class FreezePagePane extends FreezeAndRepeatPane {
} else { } else {
((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); ((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"));
} }
if (isFoot) {
if (isNumber) {
((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+String.valueOf(ob.getFrom() + 1));
} else {
((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+StableUtils.convertIntToABC(ob.getFrom() + 1));
}
}
} }
@Override @Override

207
designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

@ -1,11 +1,14 @@
package com.fr.design.report.freeze; package com.fr.design.report.freeze;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.page.ReportPageAttrProvider; import com.fr.page.ReportPageAttrProvider;
@ -29,6 +32,9 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
//边框高度 //边框高度
private static final int LABEL_HEIGHT = 45; private static final int LABEL_HEIGHT = 45;
//tab
private UITabbedPane tabbedPane;
// 重复标题行 // 重复标题行
private RepeatRowPane repeatTitleRowPane; private RepeatRowPane repeatTitleRowPane;
// 重复标题列 // 重复标题列
@ -41,6 +47,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private FreezePagePane freezePageRowPane; private FreezePagePane freezePageRowPane;
// 分页冻结列 // 分页冻结列
private FreezePagePane freezePageColPane; private FreezePagePane freezePageColPane;
//分页冻结结尾行
private FreezePagePane freezeFootRowPane;
//分页冻结结尾列
private FreezePagePane freezeFootColPane;
// 填报冻结行 // 填报冻结行
private FreezeWriteRowPane freezeWriteRowPane; private FreezeWriteRowPane freezeWriteRowPane;
// 填报冻结列 // 填报冻结列
@ -53,12 +63,21 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private UICheckBox useRepeatFinisCCheckBox; private UICheckBox useRepeatFinisCCheckBox;
// 分页冻结 // 分页冻结
private UICheckBox usePageFrozenCCheckBox; private UICheckBox usePageHeadFrozenCCheckBox;
private UICheckBox usePageFrozenRCheckBox; private UICheckBox usePageHeadFrozenRCheckBox;
private UICheckBox usePageFootFrozenCCheckBox;
private UICheckBox usePageFootFrozenRCheckBox;
// 填报冻结 // 填报冻结
private UICheckBox useWriteFrozenCCheckBox; private UICheckBox useWriteFrozenCCheckBox;
private UICheckBox useWriteFrozenRCheckBox; private UICheckBox useWriteFrozenRCheckBox;
private static final int REPEAT_AND_FROZEN_WIDTH = 600, REPEAT_AND_FROZEN_HEIGHT = 100;
//标题区域
private static final String REPEAT_AND_FROZEN_HEAD = Toolkit.i18nText("Fine-Design_Report_Repeat_Head");
//结尾区域
private static final String REPEAT_AND_FROZEN_FOOT = Toolkit.i18nText("Fine-Design_Report_Repeat_Foot");
/** /**
* 重复标题行 * 重复标题行
*/ */
@ -137,30 +156,41 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* 分页冻结Pane * 分页冻结Pane
*/ */
private JPanel initPageFrozenPane() { private JPanel initPageFrozenPane() {
JPanel pagePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 分页冻结 // 分页冻结
UILabel pageLabel = new UILabel(getPageFrozenTitle());
JPanel pageLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageLabelPanel.add(pageLabel);
pagePanel.add(pageLabelPanel, BorderLayout.NORTH);
JPanel pagecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel pagecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
pagecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); pagecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
pagePanel.add(pagecon, BorderLayout.CENTER);
UILabel warningx = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Please_Set_Repeat_First") + ")");
warningx.setForeground(Color.red);
pageLabelPanel.add(warningx);
JPanel pageRowGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel pageRowGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageRowGridPane.add(this.usePageFrozenRCheckBox = new UICheckBox()); pageRowGridPane.add(this.usePageHeadFrozenRCheckBox = new UICheckBox());
pagecon.add(pageRowGridPane);
// 显示行冻结信息的panel // 显示行冻结信息的panel
freezePageRowPane = new FreezePagePane(true); freezePageRowPane = new FreezePagePane(true);
pageRowGridPane.add(freezePageRowPane); pageRowGridPane.add(freezePageRowPane);
pagecon.add(pageRowGridPane);
addPageFrozenCol(pagecon); addPageFrozenCol(pagecon);
addBorder(pagecon, REPEAT_AND_FROZEN_HEAD);
return pagecon;
}
return pagePanel; private JPanel initPageFrozenFootPane() {
JPanel pageContentPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
pageContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
// 行冻结
JPanel pageRowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageRowPane.add(this.usePageFootFrozenRCheckBox = new UICheckBox());
// 列冻结
JPanel pageColPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageColPane.add(this.usePageFootFrozenCCheckBox = new UICheckBox());
pageContentPanel.add(pageRowPane);
freezeFootRowPane = new FreezePagePane(true, true);
pageRowPane.add(freezeFootRowPane);
pageContentPanel.add(pageColPane);
freezeFootColPane = new FreezePagePane(false, true);
pageColPane.add(freezeFootColPane);
addBorder(pageContentPanel, REPEAT_AND_FROZEN_FOOT);
return pageContentPanel;
} }
/** /**
* 分页冻结列 * 分页冻结列
*/ */
@ -168,7 +198,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
// 显示列冻结信息的panel // 显示列冻结信息的panel
freezePageColPane = new FreezePagePane(false); freezePageColPane = new FreezePagePane(false);
JPanel pageColGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel pageColGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageColGridPane.add(this.usePageFrozenCCheckBox = new UICheckBox()); pageColGridPane.add(this.usePageHeadFrozenCCheckBox = new UICheckBox());
pagecon.add(pageColGridPane); pagecon.add(pageColGridPane);
pageColGridPane.add(freezePageColPane); pageColGridPane.add(freezePageColPane);
} }
@ -209,13 +239,17 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
outrepeatPanel.add(cenrepeatPanel); outrepeatPanel.add(cenrepeatPanel);
JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")); JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
this.add(outrepeatPanel, BorderLayout.NORTH); JPanel pagePanel = new JPanel(FRGUIPaneFactory.createBorderLayout());
this.add(outfreezePanel, BorderLayout.CENTER); JPanel repeatHeadPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel repeatFootPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); //添加上方的边界线
addBorder(repeatHeadPanel, REPEAT_AND_FROZEN_HEAD);
addBorder(repeatFootPanel, REPEAT_AND_FROZEN_FOOT);
pagePanel.add(outrepeatPanel, BorderLayout.NORTH);
pagePanel.add(outfreezePanel, BorderLayout.CENTER);
outfreezePanel.add(freezePanel);
// 重复打印部分 // 重复打印部分
// 重复打印标题的起始行 // 重复打印标题的起始行
JPanel labelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel labelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
@ -223,17 +257,26 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")"); UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")");
warning.setForeground(Color.red); warning.setForeground(Color.red);
labelPanel.add(warning); labelPanel.add(warning);
cenrepeatPanel.add(labelPanel, BorderLayout.NORTH); cenrepeatPanel.add(repeatHeadPanel, BorderLayout.NORTH);
cenrepeatPanel.add(repeatPanel, BorderLayout.CENTER); cenrepeatPanel.add(repeatFootPanel, BorderLayout.CENTER);
repeatPanel.add(initRowStartPane()); repeatHeadPanel.add(initRowStartPane());
addColStart(repeatPanel); addColStart(repeatHeadPanel);
repeatPanel.add(initFootRowStarPane()); repeatFootPanel.add(initFootRowStarPane());
addFootColStart(repeatPanel); addFootColStart(repeatFootPanel);
freezePanel.add(initPageFrozenPane(), BorderLayout.NORTH);
addWriteFrozen(freezePanel); outfreezePanel.add(initPageFrozenPane(), BorderLayout.NORTH);
outfreezePanel.add(initPageFrozenFootPane(),BorderLayout.CENTER);
JPanel writePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
addWriteFrozen(writePanel);
tabbedPane = new UITabbedPane();
//去除对应的焦点虚线边框
tabbedPane.setFocusable(false);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), writePanel);
this.add(tabbedPane);
initPageRwoListener(); initPageRwoListener();
initPageColListener(); initPageColListener();
initWriteListener(); initWriteListener();
@ -253,8 +296,11 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private void initPageRwoListener() { private void initPageRwoListener() {
repeatTitleRowPane.addListener(freezePageRowListener); repeatTitleRowPane.addListener(freezePageRowListener);
// 分页重复冻结行 repeatFinisRowPane.addListener(freezePageFootRowListener);
usePageFrozenRCheckBox.addChangeListener(usePageFrozenRListener); // 分页重复冻结标题行
usePageHeadFrozenRCheckBox.addChangeListener(usePageFrozenRListener);
//分页重复冻结结尾行
usePageFootFrozenRCheckBox.addChangeListener(freezePageFootRowListener);
//重复标题行 //重复标题行
useRepeatTitleRCheckBox.addChangeListener(useRepeatTitleRListener); useRepeatTitleRCheckBox.addChangeListener(useRepeatTitleRListener);
//重复结尾行 //重复结尾行
@ -263,8 +309,11 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
protected void initPageColListener() { protected void initPageColListener() {
repeatTitleColPane.addListener(freezePageColListener); repeatTitleColPane.addListener(freezePageColListener);
// 分页重复冻结列 repeatFinisColPane.addListener(freezePageFootColListener);
usePageFrozenCCheckBox.addChangeListener(usePageFrozenCListener); // 分页重复冻结标题列
usePageHeadFrozenCCheckBox.addChangeListener(usePageFrozenCListener);
//分页重复冻结结尾列
usePageFootFrozenCCheckBox.addChangeListener(freezePageFootColListener);
//重复标题列 //重复标题列
useRepeatTitleCCheckBox.addChangeListener(useRepeatTitleCListener); useRepeatTitleCCheckBox.addChangeListener(useRepeatTitleCListener);
//重复结尾列 //重复结尾列
@ -287,7 +336,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
repeatFinisColPane.setEnabled(useRepeatFinisCCheckBox.isSelected()); boolean flag = useRepeatFinisCCheckBox.isSelected();
repeatFinisColPane.setEnabled(flag);
if (!flag) {
usePageFootFrozenCCheckBox.setSelected(false);
usePageFootFrozenCCheckBox.setEnabled(false);
} else {
usePageFootFrozenCCheckBox.setEnabled(true);
}
} }
}; };
@ -296,8 +352,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
repeatFinisRowPane.setEnabled(useRepeatFinisRCheckBox.isSelected()); boolean flag = useRepeatFinisRCheckBox.isSelected();
repeatFinisRowPane.setEnabled(flag);
if (!flag) {
usePageFootFrozenRCheckBox.setSelected(false);
usePageFootFrozenRCheckBox.setEnabled(false);
} else {
usePageFootFrozenRCheckBox.setEnabled(true);
}
} }
}; };
@ -308,10 +370,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
boolean flag = useRepeatTitleCCheckBox.isSelected(); boolean flag = useRepeatTitleCCheckBox.isSelected();
repeatTitleColPane.setEnabled(flag); repeatTitleColPane.setEnabled(flag);
if (!flag) { if (!flag) {
usePageFrozenCCheckBox.setSelected(false); usePageHeadFrozenCCheckBox.setSelected(false);
usePageFrozenCCheckBox.setEnabled(false); usePageHeadFrozenCCheckBox.setEnabled(false);
} else { } else {
usePageFrozenCCheckBox.setEnabled(true); usePageHeadFrozenCCheckBox.setEnabled(true);
} }
} }
}; };
@ -323,10 +385,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
boolean flag = useRepeatTitleRCheckBox.isSelected(); boolean flag = useRepeatTitleRCheckBox.isSelected();
repeatTitleRowPane.setEnabled(flag); repeatTitleRowPane.setEnabled(flag);
if (!flag) { if (!flag) {
usePageFrozenRCheckBox.setSelected(false); usePageHeadFrozenRCheckBox.setSelected(false);
usePageFrozenRCheckBox.setEnabled(false); usePageHeadFrozenRCheckBox.setEnabled(false);
} else { } else {
usePageFrozenRCheckBox.setEnabled(true); usePageHeadFrozenRCheckBox.setEnabled(true);
} }
} }
}; };
@ -352,14 +414,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
ChangeListener usePageFrozenCListener = new ChangeListener() { ChangeListener usePageFrozenCListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
freezePageColPane.setEnabled(usePageFrozenCCheckBox.isSelected()); freezePageColPane.setEnabled(usePageHeadFrozenCCheckBox.isSelected());
} }
}; };
ChangeListener usePageFrozenRListener = new ChangeListener() { ChangeListener usePageFrozenRListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
freezePageRowPane.setEnabled(usePageFrozenRCheckBox.isSelected()); freezePageRowPane.setEnabled(usePageHeadFrozenRCheckBox.isSelected());
} }
}; };
@ -383,6 +445,28 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
} }
}; };
// 分页重复冻结列数据联动(结尾行)
ChangeListener freezePageFootRowListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
FT ft = repeatFinisRowPane.updateBean();
int to = ft.getTo();
int maxFrom = Math.max(ft.getFrom(), -1);
freezeFootRowPane.populateBean(new FT(maxFrom, Math.max(maxFrom, to)));
}
};
// 分页重复冻结列数据联动(结尾列)
ChangeListener freezePageFootColListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
FT ft = repeatFinisColPane.updateBean();
int to = ft.getTo();
int maxFrom = Math.max(ft.getFrom(), -1);
freezeFootColPane.populateBean(new FT(maxFrom, Math.max(maxFrom, to)));
}
};
/** /**
* 窗口标题 * 窗口标题
* *
@ -407,7 +491,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
if (isDefalut(ft)) { if (isDefalut(ft)) {
this.repeatTitleRowPane.populateBean(defaultFT); this.repeatTitleRowPane.populateBean(defaultFT);
this.repeatTitleRowPane.setEnabled(false); this.repeatTitleRowPane.setEnabled(false);
usePageFrozenRCheckBox.setEnabled(false); usePageHeadFrozenRCheckBox.setEnabled(false);
usePageFootFrozenRCheckBox.setEnabled(false);
} else { } else {
this.repeatTitleRowPane.populateBean(ft); this.repeatTitleRowPane.populateBean(ft);
useRepeatTitleRCheckBox.setSelected(true); useRepeatTitleRCheckBox.setSelected(true);
@ -423,7 +508,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
useRepeatFinisRCheckBox.setSelected(true); useRepeatFinisRCheckBox.setSelected(true);
} }
this.usePageFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); this.usePageHeadFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow());
this.usePageFootFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow());
this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow()); this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow());
} }
@ -432,7 +518,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
if (isDefalut(ft)) { if (isDefalut(ft)) {
this.repeatTitleColPane.populateBean(defaultFT); this.repeatTitleColPane.populateBean(defaultFT);
this.repeatTitleColPane.setEnabled(false); this.repeatTitleColPane.setEnabled(false);
usePageFrozenCCheckBox.setEnabled(false); usePageHeadFrozenCCheckBox.setEnabled(false);
usePageFootFrozenCCheckBox.setEnabled(false);
} else { } else {
this.repeatTitleColPane.populateBean(ft); this.repeatTitleColPane.populateBean(ft);
useRepeatTitleCCheckBox.setSelected(true); useRepeatTitleCCheckBox.setSelected(true);
@ -448,7 +535,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
useRepeatFinisCCheckBox.setSelected(true); useRepeatFinisCCheckBox.setSelected(true);
} }
this.usePageFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); this.usePageHeadFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn());
this.usePageFootFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn());
this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn()); this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn());
} }
@ -494,6 +582,17 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
return attribute; return attribute;
} }
/**
* 给内部的重复与冻结选项添加指定的边框
*
* @param jPanel 重复或冻结对应的界面
* @param title 边框的文字
*/
public static void addBorder(JPanel jPanel, String title) {
jPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1,0,0,0, UIConstants.TITLED_BORDER_COLOR), title));
jPanel.setPreferredSize(new Dimension(REPEAT_AND_FROZEN_WIDTH,REPEAT_AND_FROZEN_HEIGHT));
}
protected void updateRowPane(ReportPageAttrProvider attribute) { protected void updateRowPane(ReportPageAttrProvider attribute) {
// 重复标题行 // 重复标题行
int titleFrom = valid(useRepeatTitleRCheckBox, this.repeatTitleRowPane.updateBean().getFrom()); int titleFrom = valid(useRepeatTitleRCheckBox, this.repeatTitleRowPane.updateBean().getFrom());
@ -506,7 +605,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
attribute.setRepeatFooterRowFrom(finishFrom); attribute.setRepeatFooterRowFrom(finishFrom);
attribute.setRepeatFooterRowTo(finishTo); attribute.setRepeatFooterRowTo(finishTo);
attribute.setUsePageFrozenRow(this.usePageFrozenRCheckBox.isSelected()); attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected() || this.usePageFootFrozenRCheckBox.isSelected());
attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected());
} }
private int valid(UICheckBox checkBox, int num) { private int valid(UICheckBox checkBox, int num) {
@ -524,7 +624,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
attribute.setRepeatFooterColumnFrom(finishFrom); attribute.setRepeatFooterColumnFrom(finishFrom);
attribute.setRepeatFooterColumnTo(finishTo); attribute.setRepeatFooterColumnTo(finishTo);
attribute.setUsePageFrozenColumn(this.usePageFrozenCCheckBox.isSelected()); attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected());
attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected());
} }
/** /**

Loading…
Cancel
Save