Browse Source

Merge branch 'feature/x' of ssh://code.fineres.com:7999/~tommy/design into feature/x

research/11.0
kuangshuai 3 years ago
parent
commit
78ee0148e0
  1. 3
      designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java
  2. 7
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java
  4. 61
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java
  5. 44
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java
  6. 10
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  7. 2
      designer-base/src/main/java/com/fr/nx/app/designer/toolbar/TransformResultInfo.java
  8. 2
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  9. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  10. 2
      designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
  11. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_1.png
  12. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_10.png
  13. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_11.png
  14. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_12.png
  15. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_13.png
  16. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_14.png
  17. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_15.png
  18. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_16.png
  19. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_17.png
  20. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_3.png
  21. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_4.png
  22. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_5.png
  23. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_6.png
  24. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_7.png
  25. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_8.png
  26. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_9.png
  27. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_1.png
  28. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_10.png
  29. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_11.png
  30. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_12.png
  31. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_13.png
  32. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_14.png
  33. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_15.png
  34. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_16.png
  35. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_17.png
  36. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_18.png
  37. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_2.png
  38. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_3.png
  39. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_4.png
  40. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_5.png
  41. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_6.png
  42. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_7.png
  43. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_8.png
  44. 0
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_9.png
  45. 1
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  46. 248
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

3
designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java

@ -16,4 +16,7 @@ public interface ChartEditPaneProvider {
default void removeChartEditPaneActionListener(ChartEditPaneActionListener l) {
}
default void resetLastChartCollection() {
}
}

7
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -19,7 +19,6 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.TableDataSourceAction;
import com.fr.design.actions.edit.RedoAction;
import com.fr.design.actions.edit.UndoAction;
import com.fr.design.actions.file.BatchCompileAction;
import com.fr.design.actions.file.SaveAsTemplateAction;
import com.fr.design.actions.file.SaveTemplateAction;
import com.fr.design.actions.file.WebPreviewUtils;
@ -974,7 +973,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} else if (DesignerMode.isAuthorityEditing()) {
return new ShortCut[]{new SaveTemplateAction(this), new UndoAction(this), new RedoAction(this)};
} else {
return new ShortCut[]{new SaveTemplateAction(this), new SaveAsTemplateAction(this), new BatchCompileAction(), new UndoAction(this), new RedoAction(this)};
return new ShortCut[]{new SaveTemplateAction(this), new SaveAsTemplateAction(this), new UndoAction(this), new RedoAction(this)};
}
}
@ -1411,9 +1410,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* @return 按钮组
*/
public UIButton[] createExtraButtons() {
UIButton[] uiButtons = new UIButton[]{
(UIButton) new CompileAction().createToolBarComponent()
};
UIButton[] uiButtons = new UIButton[0];
Set<DesignerFrameUpButtonProvider> providers = ExtraDesignClassManager.getInstance().getArray(DesignerFrameUpButtonProvider.XML_TAG);
for (DesignerFrameUpButtonProvider provider : providers) {
uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState()));

4
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java

@ -65,7 +65,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane<FormTheme> {
}
};
columnChartPanel.setLayout(new BorderLayout());
columnChartPreviewPane = createChartPreviewPane(initColumnChart(), i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Column_Title"));
columnChartPreviewPane = createChartPreviewPane(initColumnChart(), i18nText("Fine-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<FormTheme> {
}
};
pieChartPanel.setLayout(new BorderLayout());
pieChartPreviewPane = createChartPreviewPane(initPieChart(), i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Pie_Title"));
pieChartPreviewPane = createChartPreviewPane(initPieChart(), i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Comp_Title2"));
pieChartPanel.add(pieChartPreviewPane, BorderLayout.CENTER);
chartContent.add(columnChartPanel, BorderLayout.CENTER);
chartContent.add(pieChartPanel, BorderLayout.EAST);

61
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,41 @@ 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<String[]> DATA_LIST = createDataList();
private static final String BLANK_CHAR = " ";
private List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private List<AbstractPreviewCell> hightLightCellList = new ArrayList<>();
private List<String[]> createDataList() {
List<String[]> 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<AbstractPreviewCell> headerCellList = new ArrayList<>();
private final List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private final List<AbstractPreviewCell> 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));
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 < COL_COUNT; 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);
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);
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 < 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);
hightLightCellList.add(cell);
highLightCellList.add(cell);
}
}
@Override
@ -96,7 +63,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));
}

44
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java

@ -22,13 +22,15 @@ import java.util.ArrayList;
import java.util.List;
public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed<ReportTheme> {
private List<AbstractPreviewCell> headerTitleCellList = new ArrayList<>();
private List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private List<AbstractPreviewCell> titleCellList = new ArrayList<>();
private List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private List<AbstractPreviewCell> highLightCellList = new ArrayList<>();
private final List<AbstractPreviewCell> headerTitleCellList = new ArrayList<>();
private final List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private final List<AbstractPreviewCell> titleCellList = new ArrayList<>();
private final List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>();
private static final int CONTENT_ROW_COUNT = 3;
private static final int COL_COUNT = 5;
private PreviewPane previewPane;
private final PreviewPane previewPane;
public ECReportPreviewPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -58,26 +60,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("Fine-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("Fine-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 +94,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"));
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);
gridPane.add(cell);
@ -107,14 +109,16 @@ 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));
if ((i + 1) % 3 == 0) {
for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) {
PreviewCell cell ;
if ((i + 1) % CONTENT_ROW_COUNT == 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);
}

10
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -648,7 +648,7 @@ public class FILEChooserPane extends BasicPane {
this.suffix = suffix;
if (!text.endsWith(suffix)) {
text = text + suffix;
text = removeSuffix(text) + suffix;
}
fileNameTextField.removeDocumentListener();
fileNameTextField.setText(text);
@ -664,6 +664,14 @@ public class FILEChooserPane extends BasicPane {
fileNameTextField.setFilter(new DefaultCompletionFilter(names));
}
/**
* 移除文件后缀的方法
* 解决cptx文件的另存为操作默认会出现双后缀的bug(xxx.cptx.cpt)
**/
private String removeSuffix(String text){
return FileExtension.CPTX.matchExtension(text) ? text.substring(0, text.length() - FileExtension.CPTX.getSuffix().length()) : text;
}
/**
* 打开对话框

2
designer-base/src/main/java/com/fr/nx/app/designer/toolbar/TransformResultInfo.java

@ -57,7 +57,7 @@ public class TransformResultInfo {
return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Transform_Success_Tip");
case UNSUPPORT:
return transformLog + "\n"
+ InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Transform_Unsupport_Tip");
+ InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_X_Unsupport_Tip");
}
return transformLog;
}

2
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -55,6 +55,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
chartEditPane.setContainer(container);
currentID = plotID;
resetChartEditPane();
} else {
chartEditPane.resetLastChartCollection();
}
}

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -118,6 +118,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
this.listenerList.remove(ChartEditPaneActionListener.class, l);
}
public void resetLastChartCollection() {
this.lastCollection = null;
}
private void fireAttributeChange(ChartCollection chartCollection) {
// Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();

2
designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java

@ -43,8 +43,8 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate<?, ?> jt) {
MutilTempalteTabPane.getInstance().closeCurrentTpl();
super.onClick(jt);
MutilTempalteTabPane.getInstance().closeCurrentTpl();
}

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_1.png

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_10.png

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_11.png

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_12.png

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_13.png

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_14.png

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_15.png

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_16.png

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_17.png

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_3.png

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_4.png

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_5.png

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_6.png

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_7.png

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_8.png

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/real_style_9.png

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_1.png

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_10.png

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_11.png

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_12.png

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_13.png

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_14.png

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_15.png

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_16.png

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_17.png

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_18.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_2.png

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_3.png

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_4.png

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_5.png

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_6.png

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_7.png

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_8.png

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

0
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_9.png

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

1
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -1247,7 +1247,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
protected void addChooseFILEFilter(FILEChooserPane fileChooser) {
String appName = ProductConstants.APP_NAME;
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPTX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
addExtraChooseFILEFilter(fileChooser);
}

248
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -7,22 +7,38 @@ import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.FRExplainLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
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.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;
import javax.swing.JLabel;
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;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
@ -33,9 +49,12 @@ import java.util.List;
*/
public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private static final int LABEL_HEIGHT = 55;
private UICheckBox isClientPaging;
private UICheckBox isShowDataNumber;
private UICheckBox isPageQueryBox;
private UICheckBox clientPaging;
private UICheckBox showDataNumber;
private UICheckBox pageQueryBox;
private JPanel outPagingEngineSelectPane;
private JPanel outEngineXSettingPane;
private JPanel pageQueryPane;
private IntegerEditor countPerPageEditor;
private WorkSheet worksheet;
private List<JRadioButton> radioButtons = new ArrayList<>(2);
@ -51,81 +70,60 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel outlayerReportPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"));
JPanel layerReportPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
this.add(outlayerReportPane);
outlayerReportPane.add(layerReportPane);
JPanel isClientPagingPanle = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
isClientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page"));
isClientPaging.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
if (isClientPaging.isSelected()){
isPageQueryBox.setEnabled(true);
}else{
isPageQueryBox.setEnabled(false);
JPanel outReportEnginePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"));
outReportEnginePane.setPreferredSize(new Dimension(600, 370));
this.add(outReportEnginePane, BorderLayout.NORTH);
outReportEnginePane.add(createReportEnginePane());
JPanel outAdvicePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advice"));
this.add(outAdvicePane, BorderLayout.SOUTH);
outAdvicePane.setPreferredSize(new Dimension(600, 150));
outAdvicePane.add(createAdvicePane());
}
private JPanel createReportEnginePane(){
JPanel reportEnginePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel clientPagingpanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
clientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page"));
clientPaging.setSelected(false);
clientPagingpanel.add(clientPaging);
reportEnginePane.add(clientPagingpanel);
outPagingEngineSelectPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"));
reportEnginePane.add(outPagingEngineSelectPane);
outPagingEngineSelectPane.setVisible(false);
outPagingEngineSelectPane.setPreferredSize(new Dimension(600, 300));
outPagingEngineSelectPane.add(createPagingEngineSelectPane());
clientPaging.addActionListener(new SelectActionListener(clientPaging, outPagingEngineSelectPane));
return reportEnginePane;
}
});
isClientPaging.setSelected(false);
isClientPagingPanle.add(isClientPaging);
layerReportPane.add(isClientPagingPanle);
UIRadioButton lineEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"), false);
UIRadioButton newEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"), false);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(newEngine);
buttonGroup.add(lineEngine);
radioButtons.add(lineEngine);
radioButtons.add(newEngine);
private JPanel createPagingEngineSelectPane(){
JPanel pagingEngineSelectPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"));
outEngineXSettingPane.setVisible(false);
outEngineXSettingPane.setPreferredSize(new Dimension(570, 240));
outEngineXSettingPane.add(createEngineXSettingPane());
pagingEngineSelectPane.add(createPagingEngineRadioPanel());
pagingEngineSelectPane.add(outEngineXSettingPane);
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[] {
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Engine_Select")),
lineEngine,
newEngine
}
};
JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
layerReportPane.add(pagingEngineRadioPanel);
JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attention"));
FRExplainLabel label = new FRExplainLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Layer_Report_Warnning_Info"));
label.setPreferredSize(new Dimension(label.getPreferredSize().width, LABEL_HEIGHT));
infoPane.add(label);
layerReportPane.add(infoPane);
JPanel isShowDataNumberPanle = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
isShowDataNumber = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Data_Total_Number"));
isShowDataNumber.setSelected(false);
isShowDataNumberPanle.add(isShowDataNumber);
layerReportPane.add(isShowDataNumberPanle);
JPanel isPageQueryBoxPanle = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
isPageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
isPageQueryBox.setSelected(false);
isPageQueryBox.setEnabled(false);
isPageQueryBoxPanle.add(isPageQueryBox);
layerReportPane.add(isPageQueryBoxPanle);
isPageQueryBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (isPageQueryBox.isSelected()) {
countPerPageEditor.setEnabled(true);
} else {
countPerPageEditor.setEnabled(false);
return pagingEngineSelectPane;
}
}
});
JPanel pageQueryPane = createPageQueryPane();
layerReportPane.add(pageQueryPane);
private JPanel createEngineXSettingPane(){
JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
pageQueryBox.setSelected(false);
pageQueryBoxPanel.add(pageQueryBox);
engineXSettingPane.add(pageQueryBoxPanel);
pageQueryPane = createPageQueryPane();
pageQueryPane.setVisible(false);
engineXSettingPane.add(pageQueryPane);
pageQueryBox.addActionListener(new SelectActionListener(pageQueryBox, pageQueryPane));
JPanel tipPane = new JPanel();
UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Engine_tip"), SwingConstants.LEFT);
tipPane.add(tip);
engineXSettingPane.add(tipPane);
return engineXSettingPane;
}
private JPanel createPageQueryPane() {
@ -141,6 +139,58 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
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);
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"));
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"));
helper.setForeground(new Color(1, 159, 222));
adviceDownPane.add(helper);
helper.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
try {
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("standard.doc", ProductConstants.WEBSITE_URL)));
} catch (IOException | URISyntaxException ex) {
FineLoggerFactory.getLogger().error("io exception or not find website", ex);
}
}
});
return advicePane;
}
private JPanel createPagingEngineRadioPanel(){
UIRadioButton newEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"), false);
UIRadioButton lineEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"), false);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(newEngine);
buttonGroup.add(lineEngine);
radioButtons.add(newEngine);
radioButtons.add(lineEngine);
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[] {
newEngine,
lineEngine
}
};
JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
newEngine.addActionListener(new SelectActionListener(newEngine, outEngineXSettingPane));
lineEngine.addActionListener(new SelectActionListener(lineEngine, outEngineXSettingPane));
return pagingEngineRadioPanel;
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute");
@ -152,28 +202,35 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
setDefaultAttr();
return;
}
isClientPaging.setSelected(ob.isClientPaging());
isShowDataNumber.setSelected(ob.isShowDataNumber());
clientPaging.setSelected(ob.isClientPaging());
if (clientPaging.isSelected()){
outPagingEngineSelectPane.setVisible(true);
}
countPerPageEditor.setValue(new Integer(ob.getCountPerPage()));
if (ob.isPageQuery()) {
isPageQueryBox.setSelected(true);
pageQueryBox.setSelected(true);
countPerPageEditor.setEnabled(true);
} else {
isPageQueryBox.setSelected(false);
pageQueryBox.setSelected(false);
countPerPageEditor.setEnabled(false);
}
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X ? true : false);
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE ? true : false);
if (pageQueryBox.isSelected()){
pageQueryPane.setVisible(true);
}
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X);
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE);
//有一个默认值,一定会显示分页选项界面
outEngineXSettingPane.setVisible(true);
}
@Override
public LayerReportAttr updateBean() {
//这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。
LayerReportAttr attr = new LayerReportAttr();
attr.setPageQuery(isPageQueryBox.isSelected());
attr.setCountPerPage(Math.min(500, ((Integer)countPerPageEditor.getValue()).intValue()));
attr.setClientPaging(isClientPaging.isSelected());
attr.setShowDataNumber(isShowDataNumber.isSelected());
attr.setPageQuery(pageQueryBox.isSelected());
attr.setCountPerPage(Math.min(500, (countPerPageEditor.getValue()).intValue()));
attr.setClientPaging(clientPaging.isSelected());
for (int i = 0; i < radioButtons.size(); i++){
if (radioButtons.get(i).isSelected()){
attr.setEngineState(i);
@ -184,25 +241,40 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
@Override
public void checkValid() throws Exception {
if (isClientPaging.isSelected()) {
if (clientPaging.isSelected()) {
if (!ReportUtils.isLayerReportUsable(worksheet)) {
int value = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_After_Changed_Some_Attributes_Are_Different") + "?",
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION);
if (value != JOptionPane.YES_OPTION) {
isClientPaging.setSelected(false);
clientPaging.setSelected(false);
}
}
}
}
public void setDefaultAttr(){
isClientPaging.setSelected(false);
isShowDataNumber.setSelected(false);
countPerPageEditor.setValue(new Integer(30));
clientPaging.setSelected(false);
countPerPageEditor.setValue(30);
countPerPageEditor.setEnabled(false);
isPageQueryBox.setSelected(false);
isPageQueryBox.setEnabled(false);
pageQueryBox.setSelected(false);
radioButtons.get(0).setSelected(false);
radioButtons.get(1).setSelected(false);
}
private class SelectActionListener implements ActionListener {
private AbstractButton source;
private JPanel target;
private SelectActionListener(AbstractButton source, JPanel target){
this.source = source;
this.target = target;
}
@Override
public void actionPerformed(ActionEvent e) {
if (source.isSelected()){
target.setVisible(true);
}else {
target.setVisible(false);
}
}
}
}

Loading…
Cancel
Save