From 88790a4fec33864193006bf7e2e4908804133656 Mon Sep 17 00:00:00 2001 From: levy Date: Mon, 24 Oct 2022 18:53:38 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-79296=20=E6=8A=A5=E8=A1=A8=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E5=B1=9E=E6=80=A7=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E6=9C=AA=E8=80=83=E8=99=91i8n=E8=8B=B1=E6=96=87=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E7=9A=84Label=E8=87=AA=E5=8A=A8=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E5=B0=86=E6=B6=89=E5=8F=8A=E5=88=B0=E7=9A=84Label?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E7=95=A5=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8E=9F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=88=9B=E5=BB=BApanel=E7=9A=84=E5=B8=83=E5=B1=80=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E5=AE=9E=E9=99=85=E6=98=BE=E7=A4=BA=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E6=97=A0=E5=8F=98=E5=8C=96=E3=80=82=20=E3=80=90Review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/ReportEnginePane.java | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index b29de8855f..15dd2a3ea3 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -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 { 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 { 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 { /** * 目前先屏蔽,后面新引擎显示页码再加上相关代码 - * */ - 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 { 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 { 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 { 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 { 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 { 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 { @Override public void populateBean(LayerReportAttr ob) { - if (ob == null){ + if (ob == null) { setDefaultAttr(); return; } @@ -252,14 +251,14 @@ public class ReportEnginePane extends BasicBeanPane { 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 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 { } } } - public void setDefaultAttr(){ + + public void setDefaultAttr() { clientPaging.setSelected(false); lineEngineCountPerPageEditor.setValue(30); lineEnginePageQueryBox.setSelected(false); @@ -315,26 +315,29 @@ public class ReportEnginePane extends BasicBeanPane { 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 { /** * 由于屏蔽了新引擎设置,由于新引擎设置界面是空的,行式引擎的设置界面会显示出来,因此每次界面转换时,将不需要显示的界面屏蔽。 * 不需要屏蔽新引擎设置时,就不需要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); } }