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 a1cfd2c88..5f7725ffa 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 @@ -24,6 +24,8 @@ public class ECPreviewPane extends AbstractECPreviewPane { private final List headerCellList = new ArrayList<>(); private final List contentCellList = new ArrayList<>(); private final List highLightCellList = new ArrayList<>(); + private static final int COL_COUNT = 5; + private static final int CONTENT_ROW_COUNT = 2; public ECPreviewPane() { this.setPreferredSize(new Dimension(517, 147)); @@ -31,7 +33,7 @@ public class ECPreviewPane extends AbstractECPreviewPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel titlePane = new UINoOpaquePanel(new GridLayout()); this.add(titlePane, BorderLayout.NORTH); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < COL_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); cell.setPreferredSize(new Dimension(103, 36)); titlePane.add(cell); @@ -39,7 +41,7 @@ public class ECPreviewPane extends AbstractECPreviewPane { } JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0)); this.add(contentPane, BorderLayout.CENTER); - for (int i = 0; i < 10; i++) { + for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); cell.setPreferredSize(new Dimension(103, 33)); contentPane.add(cell); @@ -48,7 +50,7 @@ public class ECPreviewPane extends AbstractECPreviewPane { JPanel endPane = new UINoOpaquePanel(new GridLayout()); this.add(endPane, BorderLayout.SOUTH); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < COL_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); cell.setPreferredSize(new Dimension(103, 33)); endPane.add(cell); 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 51a7372fc..50ff6bab6 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 @@ -27,6 +27,8 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview private final List titleCellList = new ArrayList<>(); private final List contentCellList = new ArrayList<>(); private final List highLightCellList = new ArrayList<>(); + private static final int CONTENT_ROW_COUNT = 3; + private static final int COL_COUNT = 5; private final PreviewPane previewPane; @@ -97,7 +99,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview 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++) { + for (int i = 0; i < COL_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); cell.setPreferredSize(new Dimension(113, 31)); headerCellList.add(cell); @@ -107,9 +109,9 @@ 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++) { + for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { PreviewCell cell ; - if ((i + 1) % 3 == 0) { + if ((i + 1) % CONTENT_ROW_COUNT == 0) { cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); highLightCellList.add(cell); } else {