Browse Source

REPORT-70562 导出字体字号问题-添加配置

security/10.0
hades 3 years ago
parent
commit
af8cf0b541
  1. 11
      designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java
  2. 78
      designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java
  3. 13
      designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

11
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);
}

78
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());
}
});
}
}

13
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.*;
@ -17,12 +18,15 @@ public class ReportExportAttrPane extends BasicPane {
private ExcelExportPane excelExportPane;
private PDFExportPane pdfExportPane;
private WordExportPane wordExportPane;
private ExportUniversalPane exportUniversalPane;
private List<BasicStorePane<?>> paneList;
public ReportExportAttrPane() {
UITabbedPane 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();
@ -49,6 +53,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());
}
@ -69,6 +77,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());
}

Loading…
Cancel
Save