From 08c0be64ee889ca2777ef631e13fd8108a65b6fd Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 May 2022 17:01:17 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-70562=20=E5=AF=BC=E5=87=BA=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E5=AD=97=E5=8F=B7=E9=97=AE=E9=A2=98-=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ilable/ActionLabel.java | 11 ++- .../fr/design/report/ExportUniversalPane.java | 78 +++++++++++++++++++ .../design/report/ReportExportAttrPane.java | 13 ++++ 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java diff --git a/designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java b/designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java index ebccd24f45..85d73515e5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java @@ -13,11 +13,16 @@ import java.awt.event.MouseEvent; */ public class ActionLabel extends UILabel { private ActionListener actionListener; + private Color color; public ActionLabel(String text) { - super(text); + this(text, Color.blue); + } - this.setForeground(Color.blue); + public ActionLabel(String text, Color color) { + super(text); + this.color = color; + this.setForeground(color); this.addMouseListener(mouseInputAdapter); this.addMouseMotionListener(mouseInputAdapter); } @@ -33,7 +38,7 @@ public class ActionLabel extends UILabel { public void paintComponent(Graphics _gfx) { super.paintComponent(_gfx); - _gfx.setColor(Color.blue); + _gfx.setColor(this.color); _gfx.drawLine(0, this.getHeight() - 1, this.getWidth(), this.getHeight() - 1); } diff --git a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java new file mode 100644 index 0000000000..c95d372050 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java @@ -0,0 +1,78 @@ +package com.fr.design.report; + +import com.fr.base.CustomConfig; +import com.fr.config.Configuration; +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.ActionLabel; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.BrowseUtils; +import com.fr.transaction.Configurations; +import com.fr.transaction.WorkerFacade; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.BorderFactory; +import javax.swing.JPanel; + +/** + * @author hades + * @version 11.0 + * Created by hades on 2022/5/26 + */ +public class ExportUniversalPane extends BasicPane { + + private UICheckBox specialCharacterExport; + + public ExportUniversalPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + JPanel outerNorthPane =FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")); + JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); + JPanel specialCharacterExportPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + specialCharacterExport = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character")); + specialCharacterExport.setSelected(true); + specialCharacterExportPane.add(specialCharacterExport); + northPane.add(specialCharacterExportPane); + JPanel labelPane = new JPanel(new BorderLayout()); + labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + UILabel centerLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character_Tip")); + centerLabel.setForeground(Color.GRAY); + ActionLabel rightLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Report_Universal_Export_More_Alternative_Fonts"), UIConstants.FLESH_BLUE); + rightLabel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + BrowseUtils.browser("http://www.baidu.com"); + } + }); + labelPane.add(centerLabel, BorderLayout.CENTER); + labelPane.add(rightLabel, BorderLayout.EAST); + northPane.add(labelPane); + outerNorthPane.add(northPane); + this.add(outerNorthPane); + } + + @Override + protected String title4PopupWindow() { + return "ExportUniversalPane"; + } + + public void populate() { + this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); + } + + public void update() { + Configurations.modify(new WorkerFacade(CustomConfig.class) { + @Override + public void run() { + CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected()); + } + }); + } + + +} diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java index a284764d2c..2de520d273 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java @@ -5,6 +5,7 @@ import com.fr.design.beans.BasicStorePane; import com.fr.design.dialog.BasicPane; import com.fr.design.fun.ExportAttrTabProvider; import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.i18n.Toolkit; import com.fr.io.attr.ReportExportAttr; import javax.swing.*; @@ -18,12 +19,15 @@ public class ReportExportAttrPane extends BasicPane { private ExcelExportPane excelExportPane; private PDFExportPane pdfExportPane; private WordExportPane wordExportPane; + private ExportUniversalPane exportUniversalPane; private List> paneList; public ReportExportAttrPane() { uiTabbedPane = new UITabbedPane(); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + exportUniversalPane = new ExportUniversalPane(); + uiTabbedPane.addTab(Toolkit.i18nText("Fine-Design_Report_Universal_Export"), exportUniversalPane); excelExportPane = new ExcelExportPane(); uiTabbedPane.addTab("Excel", excelExportPane); pdfExportPane = new PDFExportPane(); @@ -56,6 +60,10 @@ public class ReportExportAttrPane extends BasicPane { reportExportAttr = new ReportExportAttr(); } + if (this.exportUniversalPane != null) { + this.exportUniversalPane.populate(); + } + if (this.excelExportPane != null) { this.excelExportPane.populate(reportExportAttr.getExcelExportAttr()); } @@ -76,6 +84,11 @@ public class ReportExportAttrPane extends BasicPane { public ReportExportAttr update() { ReportExportAttr reportExportAttr = new ReportExportAttr(); + + if (this.exportUniversalPane != null) { + this.exportUniversalPane.update(); + } + if (this.excelExportPane != null) { reportExportAttr.setExcelExportAttr(this.excelExportPane.update()); }