|
|
|
@ -12,12 +12,14 @@ import com.fr.design.layout.FRGUIPaneFactory;
|
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
|
import com.fr.general.SiteCenter; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.report.core.ReportUtils; |
|
|
|
|
import com.fr.report.stable.LayerReportAttr; |
|
|
|
|
import com.fr.report.worksheet.WorkSheet; |
|
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
|
|
|
|
|
|
import javax.swing.AbstractButton; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
@ -26,13 +28,11 @@ import javax.swing.JLayeredPane;
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JRadioButton; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Desktop; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
@ -86,7 +86,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
outAdvicePane.add(createAdvicePane()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createReportEnginePane(){ |
|
|
|
|
private JPanel createReportEnginePane() { |
|
|
|
|
JPanel reportEnginePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
|
JPanel clientPagingPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
clientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page")); |
|
|
|
@ -102,7 +102,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
return reportEnginePane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPagingEngineSelectPane(){ |
|
|
|
|
private JPanel createPagingEngineSelectPane() { |
|
|
|
|
engineSettingPane = new JLayeredPane(); |
|
|
|
|
engineSettingPane.setPreferredSize(new Dimension(570, 240)); |
|
|
|
|
engineSettingPane.setBounds(0, 0, 570, 240); |
|
|
|
@ -121,8 +121,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 目前先屏蔽,后面新引擎显示页码再加上相关代码 |
|
|
|
|
* */ |
|
|
|
|
private void createEngineXSettingPane(){ |
|
|
|
|
*/ |
|
|
|
|
private void createEngineXSettingPane() { |
|
|
|
|
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); |
|
|
|
|
outEngineXSettingPane.setBounds(0, 0, 570, 240); |
|
|
|
|
JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
@ -146,7 +146,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
outEngineXSettingPane.add(engineXSettingPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createLineEngineSettingPane(){ |
|
|
|
|
private void createLineEngineSettingPane() { |
|
|
|
|
outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); |
|
|
|
|
outLineEngineSettingPane.setBounds(0, 0, 570, 240); |
|
|
|
|
JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
@ -166,9 +166,9 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
outLineEngineSettingPane.add(lineEngineSettingPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createTipPane(String tipText){ |
|
|
|
|
private JPanel createTipPane(String tipText) { |
|
|
|
|
JPanel tipPane = new JPanel(); |
|
|
|
|
UILabel tip = new UILabel(tipText, SwingConstants.LEFT); |
|
|
|
|
UILabel tip = FRWidgetFactory.createLineWrapLabel(tipText, 420); |
|
|
|
|
tip.setForeground(new Color(128, 128, 128)); |
|
|
|
|
tipPane.add(tip); |
|
|
|
|
return tipPane; |
|
|
|
@ -184,20 +184,19 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
return pageQueryPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createAdvicePane(){ |
|
|
|
|
JPanel advicePane = new JPanel(new BorderLayout()); |
|
|
|
|
FRExplainLabel topExplainLabel = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Report_Engine_Warnning_Info")); |
|
|
|
|
advicePane.add(topExplainLabel, BorderLayout.NORTH); |
|
|
|
|
private JPanel createAdvicePane() { |
|
|
|
|
JPanel advicePane = new JPanel(FRGUIPaneFactory.create1ColumnGridLayout()); |
|
|
|
|
// 上侧文字
|
|
|
|
|
UILabel topExplainLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Report_Engine_Warnning_Info"), 480); |
|
|
|
|
topExplainLabel.setForeground(new Color(0, 0, 0)); |
|
|
|
|
FlowLayout flowLayout = new FlowLayout(FlowLayout.LEADING); |
|
|
|
|
flowLayout.setHgap(0); |
|
|
|
|
flowLayout.setVgap(0); |
|
|
|
|
JPanel adviceDownPane = new JPanel(flowLayout); |
|
|
|
|
advicePane.add(adviceDownPane, BorderLayout.CENTER); |
|
|
|
|
FRExplainLabel downExplainLabel = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference")); |
|
|
|
|
advicePane.add(topExplainLabel); |
|
|
|
|
// 下侧文字及链接
|
|
|
|
|
JPanel adviceDownPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); |
|
|
|
|
advicePane.add(adviceDownPane); |
|
|
|
|
UILabel downExplainLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference")); |
|
|
|
|
adviceDownPane.add(downExplainLabel); |
|
|
|
|
downExplainLabel.setForeground(new Color(0, 0, 0)); |
|
|
|
|
JLabel helper = new FRExplainLabel( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")); |
|
|
|
|
JLabel helper = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Community_Help")); |
|
|
|
|
helper.setForeground(new Color(1, 159, 222)); |
|
|
|
|
adviceDownPane.add(helper); |
|
|
|
|
helper.addMouseListener(new MouseAdapter() { |
|
|
|
@ -213,7 +212,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
return advicePane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPagingEngineRadioPanel(){ |
|
|
|
|
private JPanel createPagingEngineRadioPanel() { |
|
|
|
|
UIRadioButton newEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"), true); |
|
|
|
|
UIRadioButton lineEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"), false); |
|
|
|
|
ButtonGroup buttonGroup = new ButtonGroup(); |
|
|
|
@ -225,7 +224,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
double[] columnSize = {p, p, p, p, p}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[] { |
|
|
|
|
new Component[]{ |
|
|
|
|
newEngine, |
|
|
|
|
lineEngine |
|
|
|
|
} |
|
|
|
@ -243,7 +242,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(LayerReportAttr ob) { |
|
|
|
|
if (ob == null){ |
|
|
|
|
if (ob == null) { |
|
|
|
|
setDefaultAttr(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -252,14 +251,14 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
engineSettingPane.setVisible(true); |
|
|
|
|
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X); |
|
|
|
|
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE); |
|
|
|
|
if (ob.getEngineState() == LayerReportAttr.ENGINE_X){ |
|
|
|
|
if (ob.getEngineState() == LayerReportAttr.ENGINE_X) { |
|
|
|
|
engineSettingPane.moveToFront(outEngineXSettingPane); |
|
|
|
|
outEngineXSettingPane.setVisible(true); |
|
|
|
|
outLineEngineSettingPane.setVisible(false); |
|
|
|
|
engineXCountPerPageEditor.setValue(new Integer(ob.getCountPerPage())); |
|
|
|
|
engineXPageQueryBox.setSelected(ob.isPageQuery()); |
|
|
|
|
engineXPageQueryPane.setVisible(ob.isPageQuery()); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
engineSettingPane.moveToFront(outLineEngineSettingPane); |
|
|
|
|
outEngineXSettingPane.setVisible(false); |
|
|
|
|
outLineEngineSettingPane.setVisible(true); |
|
|
|
@ -275,16 +274,16 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
//这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。
|
|
|
|
|
LayerReportAttr attr = new LayerReportAttr(); |
|
|
|
|
attr.setClientPaging(clientPaging.isSelected()); |
|
|
|
|
for (int i = 0; i < radioButtons.size(); i++){ |
|
|
|
|
if (radioButtons.get(i).isSelected()){ |
|
|
|
|
for (int i = 0; i < radioButtons.size(); i++) { |
|
|
|
|
if (radioButtons.get(i).isSelected()) { |
|
|
|
|
attr.setEngineState(i); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (attr.getEngineState() == LayerReportAttr.ENGINE_X){ |
|
|
|
|
if (attr.getEngineState() == LayerReportAttr.ENGINE_X) { |
|
|
|
|
attr.setEnableRowCount(rowCountBox.isSelected()); |
|
|
|
|
attr.setCountPerPage(engineXCountPerPageEditor.getValue().intValue()); |
|
|
|
|
attr.setPageQuery(engineXPageQueryBox.isSelected()); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
attr.setPageQuery(lineEnginePageQueryBox.isSelected()); |
|
|
|
|
attr.setCountPerPage(lineEngineCountPerPageEditor.getValue()); |
|
|
|
|
} |
|
|
|
@ -304,7 +303,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public void setDefaultAttr(){ |
|
|
|
|
|
|
|
|
|
public void setDefaultAttr() { |
|
|
|
|
clientPaging.setSelected(false); |
|
|
|
|
lineEngineCountPerPageEditor.setValue(30); |
|
|
|
|
lineEnginePageQueryBox.setSelected(false); |
|
|
|
@ -315,26 +315,29 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
private class SelectActionListener implements ActionListener { |
|
|
|
|
private AbstractButton source; |
|
|
|
|
private JPanel target; |
|
|
|
|
private SelectActionListener(AbstractButton source, JPanel target){ |
|
|
|
|
|
|
|
|
|
private SelectActionListener(AbstractButton source, JPanel target) { |
|
|
|
|
this.source = source; |
|
|
|
|
this.target = target; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
if (source.isSelected()){ |
|
|
|
|
if (source.isSelected()) { |
|
|
|
|
target.setVisible(true); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
target.setVisible(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class EngineSelectActionListener implements ActionListener{ |
|
|
|
|
private class EngineSelectActionListener implements ActionListener { |
|
|
|
|
private AbstractButton source; |
|
|
|
|
private JLayeredPane target; |
|
|
|
|
private JPanel showTarget; |
|
|
|
|
private JPanel notShowTarget; |
|
|
|
|
private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget){ |
|
|
|
|
|
|
|
|
|
private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget) { |
|
|
|
|
this.source = source; |
|
|
|
|
this.target = target; |
|
|
|
|
this.showTarget = showTarget; |
|
|
|
@ -344,15 +347,15 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
/** |
|
|
|
|
* 由于屏蔽了新引擎设置,由于新引擎设置界面是空的,行式引擎的设置界面会显示出来,因此每次界面转换时,将不需要显示的界面屏蔽。 |
|
|
|
|
* 不需要屏蔽新引擎设置时,就不需要showTarget.setVisible(true);notShowTarget.setVisible(false);这两行代码了 |
|
|
|
|
* **/ |
|
|
|
|
**/ |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
if (source.isSelected()){ |
|
|
|
|
if (source.isSelected()) { |
|
|
|
|
target.setVisible(true); |
|
|
|
|
showTarget.setVisible(true); |
|
|
|
|
notShowTarget.setVisible(false); |
|
|
|
|
target.moveToFront(showTarget); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
target.setVisible(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|