From 7eefd96056332210a20a974ed1b5d7b1e317e8b0 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Sep 2021 10:57:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-60012=20=E4=B8=BB=E9=A2=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E7=BC=96=E8=BE=91=E4=B8=BB=E9=A2=98-=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=95=8C=E9=9D=A2=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/preview/FormThemePreviewPane.java | 4 +- .../preview/ecpreview/ECPreviewPane.java | 65 +++++-------------- .../ecpreview/ECReportPreviewPane.java | 36 +++++----- 3 files changed, 36 insertions(+), 69 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java index 18ac4b962d..22b19cdf27 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java @@ -65,7 +65,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane { } }; columnChartPanel.setLayout(new BorderLayout()); - columnChartPreviewPane = createChartPreviewPane(initColumnChart(), i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Column_Title")); + columnChartPreviewPane = createChartPreviewPane(initColumnChart(), i18nText("Design_Basic_Template_Theme_Profile_Pane_Comp_Title1")); columnChartPanel.add(columnChartPreviewPane, BorderLayout.CENTER); JPanel pieChartPanel = new UINoOpaquePanel() { @@ -74,7 +74,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane { } }; pieChartPanel.setLayout(new BorderLayout()); - pieChartPreviewPane = createChartPreviewPane(initPieChart(), i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Pie_Title")); + pieChartPreviewPane = createChartPreviewPane(initPieChart(), i18nText("Design_Basic_Template_Theme_Profile_Pane_Comp_Title2")); pieChartPanel.add(pieChartPreviewPane, BorderLayout.CENTER); chartContent.add(columnChartPanel, BorderLayout.CENTER); chartContent.add(pieChartPanel, BorderLayout.EAST); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java index 4493ed2630..a1cfd2c88a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java @@ -2,20 +2,16 @@ package com.fr.design.mainframe.theme.preview.ecpreview; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyleList; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.preview.UINoOpaquePanel; import com.fr.design.mainframe.theme.preview.ecpreview.cell.AbstractPreviewCell; import com.fr.design.mainframe.theme.preview.ecpreview.cell.PreviewCell; -import com.fr.log.FineLoggerFactory; - import javax.swing.BorderFactory; import javax.swing.JPanel; - import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GridLayout; -import java.io.BufferedReader; -import java.io.StringReader; import java.util.ArrayList; import java.util.List; @@ -25,70 +21,39 @@ import java.util.List; * Created by Starryi on 2021/8/13 */ public class ECPreviewPane extends AbstractECPreviewPane { - private static String csv = - "城市 当月目标 当月完成 月完成率 年完成率\n" + - "合肥市 248,938 348,938 140% 140%\n" + - "邵阳市 248,938 348,938 140% 140%\n" + - "合计 1,071,460 1,371,460 128% 128%"; - private final List DATA_LIST = createDataList(); - private static final String BLANK_CHAR = " "; - private List headerCellList = new ArrayList<>(); - private List contentCellList = new ArrayList<>(); - private List hightLightCellList = new ArrayList<>(); - - private List createDataList() { - List data = new ArrayList<>(); - try (BufferedReader reader = new BufferedReader(new StringReader(csv))) { - String textLine; - while ((textLine = reader.readLine()) != null) { - String[] texts = textLine.split(BLANK_CHAR); - data.add(texts); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - return data; - } - + private final List headerCellList = new ArrayList<>(); + private final List contentCellList = new ArrayList<>(); + private final List highLightCellList = new ArrayList<>(); public ECPreviewPane() { this.setPreferredSize(new Dimension(517, 147)); this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1)); this.setLayout(FRGUIPaneFactory.createBorderLayout()); - String[] titleArr = DATA_LIST.get(0); - String[] endArr = DATA_LIST.get(DATA_LIST.size() - 1); JPanel titlePane = new UINoOpaquePanel(new GridLayout()); this.add(titlePane, BorderLayout.NORTH); - for (String title : titleArr) { - PreviewCell cell = new PreviewCell(title); + for (int i = 0; i < 5; i++) { + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); cell.setPreferredSize(new Dimension(103, 36)); titlePane.add(cell); headerCellList.add(cell); } - JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0)); this.add(contentPane, BorderLayout.CENTER); - for (int i = 1; i < DATA_LIST.size() - 1; i++) { - String[] textLine = DATA_LIST.get(i); - for (int j = 0; j < textLine.length; j++) { - String text = textLine[j]; - PreviewCell cell = new PreviewCell(text); - cell.setPreferredSize(new Dimension(103, 33)); - contentPane.add(cell); - contentCellList.add(cell); - } + for (int i = 0; i < 10; i++) { + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); + cell.setPreferredSize(new Dimension(103, 33)); + contentPane.add(cell); + contentCellList.add(cell); } JPanel endPane = new UINoOpaquePanel(new GridLayout()); this.add(endPane, BorderLayout.SOUTH); - for (String text : endArr) { - PreviewCell cell = new PreviewCell(text); + for (int i = 0; i < 5; i++) { + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); cell.setPreferredSize(new Dimension(103, 33)); endPane.add(cell); - hightLightCellList.add(cell); + highLightCellList.add(cell); } - - } @Override @@ -96,7 +61,7 @@ public class ECPreviewPane extends AbstractECPreviewPane { ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig)); - refresh(hightLightCellList, getHighLightStyle(cellStyleConfig)); + refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java index 281624ef32..51a7372fc6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java @@ -22,13 +22,13 @@ import java.util.ArrayList; import java.util.List; public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed { - private List headerTitleCellList = new ArrayList<>(); - private List headerCellList = new ArrayList<>(); - private List titleCellList = new ArrayList<>(); - private List contentCellList = new ArrayList<>(); - private List highLightCellList = new ArrayList<>(); + private final List headerTitleCellList = new ArrayList<>(); + private final List headerCellList = new ArrayList<>(); + private final List titleCellList = new ArrayList<>(); + private final List contentCellList = new ArrayList<>(); + private final List highLightCellList = new ArrayList<>(); - private PreviewPane previewPane; + private final PreviewPane previewPane; public ECReportPreviewPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -58,26 +58,26 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview private JPanel createNorthPane() { JPanel northPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); - AbstractPreviewCell bigTitleCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Big_Title")); + AbstractPreviewCell bigTitleCell = new PreviewCell(Toolkit.i18nText("Design_Basic_Template_Theme_Profile_Pane_Cell_Style_Big_Title")); bigTitleCell.setPreferredSize(new Dimension(615, 46)); headerTitleCellList.add(bigTitleCell); northPane.add(bigTitleCell, BorderLayout.NORTH); - CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Product"), - Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_Dimension")}, + CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{Toolkit.i18nText("Fine-Design_Basic_Column_Name"), + Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Design_Basic_Template_Theme_Profile_Pane_Row_Name")}, new Point2D[]{new Point(159, 71), new Point(225, 49)}); cornerCell.setPreferredSize(new Dimension(225, 71)); headerCellList.add(cornerCell); northPane.add(cornerCell, BorderLayout.WEST); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); northPane.add(centerPane, BorderLayout.CENTER); - PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_By_Area")); + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Small_Title")); titleCellList.add(cell); cell.setPreferredSize(new Dimension(308, 38)); centerPane.add(cell, BorderLayout.NORTH); JPanel eastSouthPane = new UINoOpaquePanel(new GridLayout()); - PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_East_China")); - PreviewCell cell2 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_South_China")); - PreviewCell cell3 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Subtotal")); + PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + PreviewCell cell2 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + PreviewCell cell3 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); headerCellList.add(cell1); headerCellList.add(cell2); headerCellList.add(cell3); @@ -92,13 +92,13 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); JPanel westPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); centerPane.add(westPane, BorderLayout.WEST); - PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Drink")); + PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Small_Title")); titleCellList.add(cell1); cell1.setPreferredSize(new Dimension(112, 153)); westPane.add(cell1, BorderLayout.WEST); JPanel gridPane = new UINoOpaquePanel(new GridLayout(5, 1)); for (int i = 0; i < 5; i++) { - PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Apple_Juice")); + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); cell.setPreferredSize(new Dimension(113, 31)); headerCellList.add(cell); gridPane.add(cell); @@ -108,13 +108,15 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(5, 3)); centerPane.add(innerCenterPane, BorderLayout.CENTER); for (int i = 0; i < 15; i++) { - PreviewCell cell = new PreviewCell("35600"); - cell.setPreferredSize(new Dimension(123, 31)); + PreviewCell cell ; if ((i + 1) % 3 == 0) { + cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); highLightCellList.add(cell); } else { + cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); contentCellList.add(cell); } + cell.setPreferredSize(new Dimension(123, 31)); innerCenterPane.add(cell); }