Browse Source

Pull request #14279: REPORT-127436【NewUI】设计器样式翻新-模板相关/服务器配置/数据集

Merge in DESIGN/design from ~RICHARD.FANG/design:newui to newui

* commit 'fc4d6f26db77061b316ec592f8aa76808d896cdf':
  REPORT-127436【NewUI】设计器样式翻新-模板相关/服务器配置/数据集
  REPORT-127436【NewUI】设计器样式翻新-模板相关/服务器配置/数据集
  REPORT-127436【NewUI】设计器样式翻新-模板相关/服务器配置/数据集
  REPORT-127436【NewUI】设计器样式翻新-模板相关/服务器配置/数据集
newui
Richard.Fang-方超 4 months ago
parent
commit
35414ec8ab
  1. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  2. 99
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java
  3. 12
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  4. 116
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java
  5. 7
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java
  6. 58
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  7. 6
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  8. 321
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  9. 9
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallHeightPane.java
  10. 9
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallPane.java
  11. 82
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  12. 24
      designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java
  13. 27
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  14. 87
      designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java
  15. 5
      designer-base/src/main/java/com/fr/design/gui/ilable/FRExplainLabel.java
  16. 42
      designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java
  17. 170
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java
  18. 2
      designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java
  19. 47
      designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java
  20. 25
      designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java
  21. 3
      designer-base/src/main/java/com/fr/design/report/fit/NewFitPreviewPane.java
  22. 49
      designer-base/src/main/java/com/fr/design/report/fit/ReportFitConfigPane.java
  23. 11
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  24. 42
      designer-base/src/main/java/com/fr/design/widget/IconDefinePane.java
  25. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash.svg
  26. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash_disable.svg
  27. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton.svg
  28. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton_disable.svg
  29. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify.svg
  30. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify_disable.svg
  31. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/email.svg
  32. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/email_disable.svg
  33. 11
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up.svg
  34. 11
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up_disable.svg
  35. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first.svg
  36. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first_disable.svg
  37. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last.svg
  38. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last_disbale.svg
  39. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi.svg
  40. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi_disable.svg
  41. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next.svg
  42. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next_disable.svg
  43. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous.svg
  44. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous_disable.svg
  45. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet.svg
  46. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet_disable.svg
  47. 6
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf.svg
  48. 6
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf_disable.svg
  49. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview.svg
  50. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview_disable.svg
  51. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset.svg
  52. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset_disable.svg
  53. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale.svg
  54. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale_disable.svg
  55. 14
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  56. 4
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  57. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  58. 26
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  59. 99
      designer-realize/src/main/java/com/fr/design/report/ExcelExportPane.java
  60. 23
      designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java
  61. 78
      designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java
  62. 32
      designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java
  63. 290
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  64. 29
      designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java
  65. 76
      designer-realize/src/main/java/com/fr/design/report/WordExportPane.java
  66. 25
      designer-realize/src/main/java/com/fr/design/report/mobile/AppFitBrowserPane.java
  67. 26
      designer-realize/src/main/java/com/fr/design/report/mobile/AppFitPreviewPane.java
  68. 18
      designer-realize/src/main/java/com/fr/design/report/mobile/MobileOthersPane.java
  69. 44
      designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java
  70. 28
      designer-realize/src/main/java/com/fr/design/report/mobile/MobileToolBarPane.java
  71. 30
      designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java
  72. 58
      designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java
  73. 53
      designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java
  74. 56
      designer-realize/src/main/java/com/fr/design/webattr/DragToolBarPane.java
  75. 30
      designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java
  76. 237
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  77. 60
      designer-realize/src/main/java/com/fr/design/webattr/ErrorTemplatePane.java
  78. 27
      designer-realize/src/main/java/com/fr/design/webattr/EventPane.java
  79. 86
      designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java
  80. 69
      designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java
  81. 4
      designer-realize/src/main/java/com/fr/design/webattr/ReportServerPrinterPane.java
  82. 34
      designer-realize/src/main/java/com/fr/design/webattr/ReportWebAttrPane.java
  83. 115
      designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java
  84. 10
      designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java
  85. 64
      designer-realize/src/main/java/com/fr/design/webattr/ServerPrinterPane.java
  86. 31
      designer-realize/src/main/java/com/fr/design/webattr/SettingToolBar.java
  87. 21
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java
  88. 131
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java
  89. 3
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java
  90. 38
      designer-realize/src/main/java/com/fr/design/webattr/ViewToolBarPane.java
  91. 19
      designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java
  92. 47
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  93. 79
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java
  94. 92
      designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java
  95. 78
      designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java
  96. 58
      designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java
  97. 211
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java
  98. 76
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java
  99. 75
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/NoClientPrintSettingPane.java
  100. 43
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java
  101. Some files were not shown because too many files have changed in this diff Show More

1
designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java

@ -29,6 +29,7 @@ public interface FineUIStyle {
String BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel";
String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel";
String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton";

99
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.impl.RecursionTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
@ -18,19 +20,21 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class TreeTableDataDictPane extends BasicPane implements Previewable {
private UILabel selectTableDataLabel;
@ -54,23 +58,28 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
}
public TreeTableDataDictPane(String treeName) {
this.setLayout(new BorderLayout(5, 30));
this.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 0));
selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") + " :");
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
//请选择一个数据集
selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") );
setTableDataNameComboBox(treeName);
tableDataNameComboBox.setPreferredSize(new Dimension(180, 20));
JPanel tableFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
tableFlowPane.add(selectTableDataLabel);
tableFlowPane.add(tableDataNameComboBox);
tableDataNameComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
tdChange(true);
}
});
tableFlowPane.add(new PreviewLabel(this));
this.add(tableFlowPane, BorderLayout.NORTH);
JPanel tableFlowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
tableFlowPane.add(row(LayoutConstants.HGAP_LARGE,
cell(selectTableDataLabel).weight(0.12),
row(LayoutConstants.HGAP_LARGE,
cell(tableDataNameComboBox).weight(0.9),
cell(new PreviewLabel(this)).weight(0.1)
).weight(0.3),
flex(0.58)
).getComponent());
//中心面板
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
parentMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Parent_Marked_Filed"), true);
lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length"));
parentMarkRadio.addItemListener(new ItemListener() {
@ -95,45 +104,44 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
markButtonGroup.add(parentMarkRadio);
markButtonGroup.add(lengthMarkRadio);
originFieldDependsOnParentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed") + " :", SwingConstants.RIGHT);
parentFieldLabel = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field") + " :", SwingConstants.RIGHT);
treeDataFieldLabel1 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT);
originFieldDependsOnLengthLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed") + " :", SwingConstants.RIGHT);
treeDataFieldLabel2 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT);
//原始标记字段
originFieldDependsOnParentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"));
//父标记字段
parentFieldLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field"));
treeDataFieldLabel1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field"));
originFieldDependsOnLengthLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"));
treeDataFieldLabel2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field"));
// originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))});
// parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))});
// originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))});
originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
makeParentEnable();
JPanel p1 = createCenterFlowZeroGapBorderPane(originFieldDependsOnParentLabel, originFieldDependsOnParentPane);
JPanel p2 = createCenterFlowZeroGapBorderPane(parentFieldLabel, parentFieldPane);
JPanel border1 = new JPanel();
border1.setLayout(new BorderLayout(0, 10));
border1.add(p1, BorderLayout.NORTH);
border1.add(p2, BorderLayout.CENTER);
JPanel p4 = createCenterFlowZeroGapBorderPane(originFieldDependsOnLengthLabel, originFieldDependsOnLengthPane);
JPanel border2 = new JPanel();
border2.setLayout(new BorderLayout(0, 20));
border2.add(p4, BorderLayout.NORTH);
//树数据集面板
centerPane.add(column(10,
cell(parentMarkRadio),
row(LayoutConstants.HGAP_LARGE,
cell(originFieldDependsOnParentLabel).weight(0.12),
cell(originFieldDependsOnParentPane).weight(0.3),
flex(0.58)
),
row(LayoutConstants.HGAP_LARGE,
cell(parentFieldLabel).weight(0.12),
cell(parentFieldPane).weight(0.3),
flex(0.58)
),
cell(lengthMarkRadio),
row(LayoutConstants.HGAP_LARGE,
cell(originFieldDependsOnLengthLabel).weight(0.12),
cell(originFieldDependsOnLengthPane).weight(0.3),
flex(0.58)
)
).getComponent());
JPanel xx = FRGUIPaneFactory.createBorderLayout_S_Pane();
xx.add(parentMarkRadio, BorderLayout.NORTH);
xx.add(border1, BorderLayout.CENTER);
JPanel xxx = FRGUIPaneFactory.createBorderLayout_S_Pane();
xxx.add(lengthMarkRadio, BorderLayout.NORTH);
xxx.add(border2, BorderLayout.CENTER);
JPanel buildTreePanel = new JPanel(new BorderLayout(5, 30));
buildTreePanel.add(xx, BorderLayout.NORTH);
buildTreePanel.add(xxx, BorderLayout.CENTER);
centerPane.add(buildTreePanel, BorderLayout.NORTH);
JPanel previewPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
//预览
JPanel previewPanel = new JPanel(new BorderLayout());
UIButton treeDataPreviewButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
previewPanel.add(treeDataPreviewButton);
previewPanel.add(treeDataPreviewButton, BorderLayout.WEST);
treeDataPreviewButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -163,7 +171,8 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
PreviewTablePane.previewTableData(rtd);
}
});
centerPane.add(previewPanel, BorderLayout.CENTER);
this.add(column(LayoutConstants.VERTICAL_GAP, cell(tableFlowPane),cell(centerPane), cell(previewPanel)).getComponent());
}
protected void setTableDataNameComboBox(String treeName) {

12
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -69,8 +69,10 @@ import java.net.URI;
import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Database Connection pane.
@ -280,9 +282,13 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
// ChartSet
String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")};
charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY));
JPanel chartSetPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
chartSetPane.add(GUICoreUtils.createNamedPane(charSetComboBox, Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":"));
advancedPanel.add(chartSetPane);
JPanel chartSetPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
chartSetPane.add(row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset"))).weight(0.15),
cell(charSetComboBox).weight(0.3),
flex(0.55)
).getComponent());
advancedPanel.add(wrapComponentWithTitle(chartSetPane, Toolkit.i18nText("Fine-Design_Basic_Advanced")));
}
private void initJDBCLayout(JPanel corePane, JPanel advancedPanel) {

116
designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java

@ -1,38 +1,40 @@
package com.fr.design.data.datapane.connect;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;
import javax.naming.Context;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.FRExplainLabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class JNDIDefPane extends JPanel {
private static Map<String, String> jndiMap = new HashMap<String, String>();
@ -66,57 +68,51 @@ public class JNDIDefPane extends JPanel {
private JDialog otherAttrDialog;
public JNDIDefPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(UITitledBorder.createBorderWithTitle("JNDI" + ":"));
JPanel innerthis = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(innerthis);
// NorthPane
JPanel nContentPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
innerthis.add(nContentPane);
nContentPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_Name") + ":"));
jndiNameTextField = new UITextField(20);
nContentPane.add(jndiNameTextField, BorderLayout.NORTH);
// CenterPane
JPanel outcenterPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Context"));
innerthis.add(outcenterPane);
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
outcenterPane.add(centerPane);
this.setLayout(new BorderLayout());
jndiNameTextField = new UITextField(20);
JNDIFactoryComboBox = new UIComboBox(new String[] { "", "weblogic.jndi.WLInitialContextFactory", "com.ibm.websphere.naming.WsnInitialContextFactory",
"org.jboss.naming.HttpNamingContextFactory", "org.jnp.interfaces.NamingContextFactory", "com.caucho.burlap.BurlapContextFactory", });
JNDIFactoryComboBox.setEditable(true);
JNDIFactoryComboBox.addActionListener(jndiListener);
JNDIFactoryComboBox.setPreferredSize(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2));
// ContextPane
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = { p, p, p, p };
double[] columnSize = { f, f };
Component[][] comps = { { new UILabel("INITIAL_CONTEXT_FACTORY:", SwingConstants.RIGHT), JNDIFactoryComboBox },
{ new UILabel("PROVIDER_URL:", SwingConstants.RIGHT), PROVIDER_URL_TF }, { new UILabel("SECURITY_PRINCIPAL:", SwingConstants.RIGHT), SECURITY_PRINCIPAL_TF },
{ new UILabel("SECURITY_CREDENTIALS:", SwingConstants.RIGHT), SECURITY_CREDENTIALS_TF } };
centerPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, columnSize, 2));
// ActionLabel
JPanel actionPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(actionPane);
actionPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 6));
JNDIFactoryComboBox.setPreferredSize(FineUIScale.scale(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2)));
// 上下文
JPanel contextPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contextPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("INITIAL_CONTEXT_FACTORY")).weight(0.35), cell(JNDIFactoryComboBox).weight(0.65)),
row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("PROVIDER_URL")).weight(0.35), cell(PROVIDER_URL_TF).weight(0.65)),
row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("SECURITY_PRINCIPAL")).weight(0.35), cell(SECURITY_PRINCIPAL_TF).weight(0.65)),
row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("SECURITY_CREDENTIALS")).weight(0.35), cell(SECURITY_CREDENTIALS_TF).weight(0.65))
).getComponent());
//其他属性
JPanel otherAttributePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
ActionLabel actionLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Other_Attributes"));
actionPane.add(actionLabel, BorderLayout.EAST);
actionLabel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
//其他属性弹窗
JDialog wDialog = createJDialog();
wDialog.setVisible(true);
}
});
otherAttributePanel.add(actionLabel, BorderLayout.EAST);
//注意描述
JPanel jndiDesPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jndiDesPanel.add(new JScrollPane(new FRExplainLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_DES"))), BorderLayout.WEST);
//JNDI面板
JPanel centerPanel = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_Name"))).weight(0.15), cell(jndiNameTextField).weight(0.85)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Context"))).weight(0.15), cell(contextPane).weight(0.85)),
cell(otherAttributePanel),
cell(jndiDesPanel)
).getComponent();
this.add(wrapComponentWithTitle(centerPanel,"JNDI"));
}
// South Description
UILabel explainLabe11l = new FRExplainLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_DES"));
innerthis.add(new JScrollPane(explainLabe11l));
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText)))
.with(it -> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
public void populate(JNDIDatabaseConnection jndiDatabase) {
@ -216,21 +212,23 @@ public class JNDIDefPane extends JPanel {
class OtherAttrPane extends BasicPane {
public OtherAttrPane() {
// JPanel northFlowPane
JPanel northFlowPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(northFlowPane, BorderLayout.NORTH);
JPanel northFlowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northFlowPane.setBorder(new ScaledEmptyBorder(10,10,10,10));
// ContextPane
double f = TableLayout.FILL;
double[] rowSize = { f, f, f, f, f, f, f, f, f, f, f };
double[] columnSize = { f, f };
Component[][] comps = { { new UILabel("OBJECT_FACTORIES:", SwingConstants.RIGHT), OBJECT_FACTORIES_TF },
{ new UILabel("STATE_FACTORIES:", SwingConstants.RIGHT), STATE_FACTORIES_TF }, { new UILabel("URL_PKG_PREFIXES:", SwingConstants.RIGHT), URL_PKG_PREFIXES_TF },
{ new UILabel("DNS_URL:", SwingConstants.RIGHT), DNS_URL_TF }, { new UILabel("AUTHORITATIVE:", SwingConstants.RIGHT), AUTHORITATIVE_TF },
{ new UILabel("BATCHSIZE:", SwingConstants.RIGHT), BATCHSIZE_TF }, { new UILabel("REFERRAL:", SwingConstants.RIGHT), REFERRAL_TF },
{ new UILabel("SECURITY_PROTOCOL:", SwingConstants.RIGHT), SECURITY_PROTOCOL_TF },
{ new UILabel("SECURITY_AUTHENTICATION:", SwingConstants.RIGHT), SECURITY_AUTHENTICATION_TF }, { new UILabel("LANGUAGE:", SwingConstants.RIGHT), LANGUAGE_TF },
{ new UILabel("APPLET:", SwingConstants.RIGHT), APPLET_TF } };
northFlowPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, columnSize, 2));
northFlowPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("OBJECT_FACTORIES")).weight(0.35), cell(OBJECT_FACTORIES_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("STATE_FACTORIES")).weight(0.35), cell(STATE_FACTORIES_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("URL_PKG_PREFIXES")).weight(0.35), cell(URL_PKG_PREFIXES_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("DNS_URL")).weight(0.35), cell(DNS_URL_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("AUTHORITATIVE")).weight(0.35), cell(AUTHORITATIVE_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("BATCHSIZE")).weight(0.35), cell(BATCHSIZE_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("REFERRAL")).weight(0.35), cell(REFERRAL_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("SECURITY_PROTOCOL")).weight(0.35), cell(SECURITY_PROTOCOL_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("SECURITY_AUTHENTICATION")).weight(0.35), cell(SECURITY_AUTHENTICATION_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("LANGUAGE")).weight(0.35), cell(LANGUAGE_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("APPLET")).weight(0.35), cell(APPLET_TF)).weight(0.65)
).getComponent());
this.add(northFlowPane, BorderLayout.NORTH);
}
@Override

7
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java

@ -5,7 +5,8 @@ import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ibutton.UIButton;
@ -16,7 +17,7 @@ public class PreviewLabel extends UIButton {
Previewable previewable;
public PreviewLabel(Previewable previewable) {
super(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png"));
super(new LazyIcon("preview"));
this.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.previewable = previewable;
@ -27,7 +28,7 @@ public class PreviewLabel extends UIButton {
PreviewLabel.this.previewable.preview();
}
});
this.setPreferredSize(new Dimension(24, 20));
this.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
}
public static interface Previewable {

58
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -1,7 +1,9 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
import com.fr.data.impl.ClassTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
@ -11,8 +13,6 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.IOUtils;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
@ -23,35 +23,29 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private UITextField classNameTextField;
private UITableEditorPane<ParameterProvider> editorPane;
public ClassTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, p};
//Reportlet.
JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(36);
reportletNamePane.add(classNameTextField);
this.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
//类名
classNameTextField = new UITextField();
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select"));
browserButton.setPreferredSize(new Dimension(
browserButton.getPreferredSize().width,
classNameTextField.getPreferredSize().height));
reportletNamePane.add(browserButton);
browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height));
browserButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final ClassNameSelectPane bPane = new ClassNameSelectPane();
@ -69,15 +63,26 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
}
});
Component[][] components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name") + ":"), reportletNamePane},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")},
{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME)))}
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel tipPanel = column(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME))))
).getComponent();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12),
row(LayoutConstants.HGAP_LARGE,
cell(classNameTextField).weight(0.85),
cell(browserButton).weight(0.15)
).weight(0.58),
flex(0.3)
),
row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(tipPanel).weight(0.88))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0,10, 0))).getComponent());
this.add(northPane, BorderLayout.NORTH);
this.add(initSouthPanel(), BorderLayout.SOUTH);
this.add(initSouthPanel(), BorderLayout.CENTER);
}
private JPanel initSouthPanel() {
JPanel jpanel = new JPanel();
@ -95,7 +100,6 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para"));
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
}

6
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -52,7 +53,8 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// additional methods
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
// prepare the data in this way as default if no arguments is passed in
dataJTable = new JTable(new EmbeddedTableModel(new EmbeddedTableData()));
@ -84,7 +86,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// peter:控制Panel
JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.add(northPane, BorderLayout.NORTH);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0));
//northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0));
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0");

321
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -1,6 +1,9 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.Utils;
@ -12,6 +15,7 @@ import com.fr.data.impl.FileTableData;
import com.fr.data.impl.TextTableData;
import com.fr.data.impl.XMLTableData;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
@ -27,9 +31,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
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.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
@ -47,7 +48,6 @@ import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLableReader;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
@ -62,9 +62,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -80,6 +78,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private static final int TEXT = 0;
private static final int EXCEL = 1;
@ -104,8 +108,6 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIButton testConnection;
private XMLNodeTree xmlNodeTree;
private Parameter[] params;
private JPanel filePath;
private XMLNodeTreePane nodeTreePane;
private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题
private UIRadioButton tableDismemberRadioButton;// 制表符
@ -116,41 +118,32 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一
private UIComboBox charsetComboBox;
private UILabel encodeLabel;
private UILabel dismenberLabel;
private UILabel keyPointLaber;
private ExpandMutableTreeNode selectedNode = null;
private ExpandMutableTreeNode finalSelectedNode = null;
private ArrayList<String> xmlColumnsList = new ArrayList<String>();
private static final int SETPANELWIDTH = 337;
private static final int WIDTH = 317;
private static final int HEIGHT = 453;
private static final int GAP = 23;
private static final double LOCAL_WIDTH_RATIO = 0.62;
private static final double URL_WIDTH_RATIO = 0.56;
public FileTableDataPane() {
this(SETPANELWIDTH, WIDTH, HEIGHT, GAP);
this(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
}
public FileTableDataPane(int setPanelWidth, int width, int height, int gap) {
this.setLayout(new BorderLayout(gap, 0));
JPanel northPanel = new JPanel(new BorderLayout());
JPanel type = new JPanel();
type.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type") + ":"));
public FileTableDataPane(double localWidthRatio, double urlWidthRatio) {
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
//文件类型
JPanel fileType = new JPanel(new BorderLayout());
String[] item = {"TXT", "Excel", "XML"};
fileTypeComboBox = new UIComboBox(item);
fileTypeComboBox.setPreferredSize(new Dimension(100, 20));
type.add(fileTypeComboBox);
northPanel.add(type, BorderLayout.WEST);
fileType.add(row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"))).weight(0.12),
cell(fileTypeComboBox).weight(0.18),
flex(0.7)
).getComponent());
// 最上面的pane,文件选择
JPanel centerPanel = new JPanel();
centerPanel.setPreferredSize(new Dimension(522, 200));
centerPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File_Address")));
addToCenterPanel(centerPanel);
// 下面的pane,参数面板
//参数面板
ParameterTableModel model = new ParameterTableModel() {
@Override
public UITableEditAction[] createAction() {
@ -158,65 +151,75 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
};
editorPane = new UITableEditorPane<ParameterProvider>(model);
editorPane.setPreferredSize(new Dimension(355, 130));
centerPanel.add(editorPane, BorderLayout.SOUTH);
JPanel southPanel = new JPanel(new BorderLayout());
JPanel setPanel = new JPanel();
southPanel.add(setPanel, BorderLayout.CENTER);
setPanel.setPreferredSize(new Dimension(setPanelWidth, 460));
setPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set")));
JPanel controlPane = textSetPanel(width, height);
setPanel.add(controlPane, BorderLayout.NORTH);
fileTypeComboBox.addActionListener(getFileTypeListener(setPanel, width, height));
this.add(northPanel, BorderLayout.NORTH);
this.add(centerPanel, BorderLayout.CENTER);
this.add(southPanel, BorderLayout.EAST);
}
private void addToCenterPanel(JPanel centerPanel) {
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File") + ":", true);
urlFileRadioButton = new UIRadioButton("URL:", false);
editorPane.setBorder(new ScaledEmptyBorder(0,0,0,10));
editorPane.setPreferredSize(FineUIScale.scale(new Dimension(-1, 150)));
//左侧文件地址pane
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.add(column(
LayoutConstants.VERTICAL_GAP,
cell(getCenterPanel(localWidthRatio, urlWidthRatio)),
cell(editorPane)
).getComponent());
//右侧设定pane
JPanel rightPanel = new JPanel(new BorderLayout());
rightPanel.setBorder(new ScaledEmptyBorder(0,0,0,10));
rightPanel.add(getTextSetPanel());
fileTypeComboBox.addActionListener(getFileTypeListener(rightPanel));
//文件数据集整体布局,服务器数据集/模板数据集下的文件数据集,创建文件数据集,三处面板通用布局
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(fileType),
row(20,
cell(wrapComponentWithTitle(leftPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File_Address"))).weight(0.5),
cell(wrapComponentWithTitle(rightPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"))).weight(0.5)
)
).getComponent());
}
/**
* 文件地址上方的面板-文件选择
* @return
*/
private JPanel getCenterPanel(double localWidthRatio, double urlWidthRatio) {
// 本地文件/URL
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File"), true);
urlFileRadioButton = new UIRadioButton("URL", false);
ButtonGroup bg = new ButtonGroup();
bg.add(localFileRadioButton);
bg.add(urlFileRadioButton);
localFileRadioButton.addActionListener(radioActionListener);
urlFileRadioButton.addActionListener(radioActionListener);
urlFileRadioButton.setForeground(new Color(143, 142, 139));
localFileRadioButton.setForeground(Color.black);
localText = new UITextField();
localText.setPreferredSize(new Dimension(195, 20));
urlText = new UITextField();
urlText.setPreferredSize(new Dimension(195, 20));
urlText.setEditable(false);
// 选择按钮
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Selection"));
chooseFile.addActionListener(chooseFileListener);
// 测试连接按钮
testConnection = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"));
testConnection.setEnabled(false);
testConnection.addActionListener(testConnectionListener);// 测试连接按钮
JPanel textPanel = new JPanel(new GridLayout(2, 1, 15, 15));
JPanel textFieldPanel = new JPanel(new GridLayout(2, 1, 15, 15));
JPanel buttonPanel = new JPanel(new GridLayout(2, 1, 15, 15));
textPanel.add(localFileRadioButton);
textPanel.add(urlFileRadioButton);
textFieldPanel.add(localText);
textFieldPanel.add(urlText);
buttonPanel.add(chooseFile);
buttonPanel.add(testConnection);
filePath = FRGUIPaneFactory.createBorderLayout_S_Pane();
filePath.add(textPanel, BorderLayout.WEST);
filePath.add(textFieldPanel, BorderLayout.CENTER);
filePath.add(buttonPanel, BorderLayout.EAST);
centerPanel.add(filePath, BorderLayout.NORTH);
// 中间的pane,提示信息
testConnection.addActionListener(testConnectionListener);
// 提示信息
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips = new UILabel(tipContent);
centerPanel.add(tips, BorderLayout.CENTER);
return column(
LayoutConstants.VERTICAL_GAP,
row(
LayoutConstants.HGAP_LARGE,
cell(localFileRadioButton).weight(0.25),
cell(localText).weight(localWidthRatio),
cell(chooseFile).weight(0.75 - localWidthRatio)
),
row(
LayoutConstants.HGAP_LARGE,
cell(urlFileRadioButton).weight(0.25),
cell(urlText).weight(urlWidthRatio),
cell(testConnection).weight(0.75 - urlWidthRatio)
),
cell(tips).weight(1)
).with(it -> it.setBorder(new ScaledEmptyBorder(0,0,0,10))).getComponent();
}
private ActionListener testConnectionListener = new ActionListener() {
@ -249,7 +252,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
};
private void previewPanel(JPanel jPanel) {
private JPanel getPreviewPanel() {
JPanel previewPanel = new JPanel(new BorderLayout());
UIButton preview = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
preview.addActionListener(new ActionListener() {
@ -259,56 +262,33 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
});
previewPanel.add(preview, BorderLayout.EAST);
jPanel.add(previewPanel, BorderLayout.SOUTH);
return previewPanel;
}
private JPanel xmlSetPanel(int width, int height) {
/**
* XML设定Pane
* @return
*/
private JPanel getXmlSetPanel() {
// xml设置pane
JPanel controlPane = new JPanel();
JPanel northPane = new JPanel(new BorderLayout(8, 8));
JPanel northTopPane = new JPanel(new BorderLayout(8, 8));
JPanel southPane = new JPanel(new BorderLayout(8, 8));
JPanel southTopPane = new JPanel(new BorderLayout(8, 8));
controlPane.setLayout(new BorderLayout(8, 8));
controlPane.setPreferredSize(new Dimension(width, height));
JPanel comboboxPanel = new JPanel(new BorderLayout(8, 8));
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":");
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
encodingComboBox.setSelectedIndex(4);
encodingComboBox.setPreferredSize(new Dimension(90, 20));
JPanel treeContainerPane = new JPanel();
treeContainerPane.setLayout(new BorderLayout(8, 8));
nodeTreePane = new XMLNodeTreePane();
treeContainerPane.add(nodeTreePane, BorderLayout.CENTER);
comboboxPanel.add(encodeLabel, BorderLayout.WEST);
comboboxPanel.add(encodingComboBox, BorderLayout.CENTER);
northPane.add(comboboxPanel, BorderLayout.EAST);
northTopPane.add(northPane, BorderLayout.WEST);
southTopPane.add(southPane, BorderLayout.WEST);
southTopPane.add(treeContainerPane, BorderLayout.CENTER);
controlPane.add(northTopPane, BorderLayout.NORTH);
controlPane.add(southTopPane, BorderLayout.CENTER);
previewPanel(controlPane);
return controlPane;
}
private JPanel excelSetPanel(int width, int height) {
// excel设置pane
int checkBoxWidth = width - EIGHT;
JPanel controlPane = new JPanel();
JPanel northPane = new JPanel(new BorderLayout(8, 8));
controlPane.setLayout(new BorderLayout());
controlPane.setPreferredSize(new Dimension(width, height));
return column(
LayoutConstants.VGAP_MEDIUM,
row(LayoutConstants.HORIZONTAL_GAP, cell(encodeLabel).weight(0.2), cell(encodingComboBox).weight(0.8)),
cell(new XMLNodeTreePane()),
cell(getPreviewPanel())
).getComponent();
}
/**
* Excel设定Pane
* @return
*/
private JPanel getExcelSetPanel() {
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false);
needColumnNameCheckBox.setPreferredSize(new Dimension(checkBoxWidth, 20));
northPane.add(needColumnNameCheckBox, BorderLayout.EAST);
controlPane.add(northPane, BorderLayout.NORTH);
previewPanel(controlPane);
return controlPane;
return column(cell(needColumnNameCheckBox), cell(getPreviewPanel())).getComponent();
}
private String getFilePathFromUrlOrLocal() {
@ -346,34 +326,31 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
// return (uri.matches("https*://.+|\\$\\{.+\\}.*"));
}
private JPanel textSetPanel(int width, int height) {
// text设置pane
JPanel controlPane = new JPanel();
controlPane.setLayout(new BorderLayout());
controlPane.setPreferredSize(new Dimension(width, height));
JPanel northPane = new JPanel(new BorderLayout(8, 8));
addToNorthPane(northPane);
controlPane.add(northPane, BorderLayout.WEST);
previewPanel(controlPane);
return controlPane;
/**
* TXT设定Pane
* @return
*/
private JPanel getTextSetPanel() {
initRatioButton();
//编码类型
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
return column(cell(getTxtCenterPane()), cell(getPreviewPanel())).getComponent();
}
private void addToNorthPane(JPanel northPane) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] columnSize = {f, p, p};
double[] rowSize = {B, B, B, B, B, B, B};
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), true);
dismenberLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dismenber") + ":");
/**
* 初始化Button
*/
private void initRatioButton(){
tableDismemberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"), false);
tableDismemberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"));
spaceDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space"), true);
spaceDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space"));
commaDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber"), false);
commaDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber"));
otherDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other") + ":", false);
otherDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), false);
otherDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"));
otherDismenberTextField = new UITextField(8);
otherDismenberTextField = new UITextField();
otherDismenberTextField.setEditable(false);
otherDismenberRadioButton.addChangeListener(new ChangeListener() {
@Override
@ -385,6 +362,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
}
});
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), true);
ButtonGroup bg2 = new ButtonGroup();
bg2.add(tableDismemberRadioButton);
bg2.add(spaceDismenberRadioButton);
@ -392,18 +370,38 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
bg2.add(otherDismenberRadioButton);
ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true);
UIComponentUtils.setLineWrap(ignoreOneMoreDelimiterCheckBox);
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":");
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
Component[][] comps = {
{encodeLabel, charsetComboBox, null},
{needColumnNameCheckBox, null, null},
{dismenberLabel, tableDismemberRadioButton, null},
{null, spaceDismenberRadioButton, null},
{null, commaDismenberRadioButton, null},
{null, otherDismenberRadioButton, otherDismenberTextField},
{ignoreOneMoreDelimiterCheckBox, null, null}
};
northPane.add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.EAST);
}
/**
* 获取TXT中心Pane
* @return
*/
private JPanel getTxtCenterPane(){
//分隔符选项
JPanel separatorOptionsPanel = column(
LayoutConstants.VERTICAL_GAP,
cell(tableDismemberRadioButton),
cell(spaceDismenberRadioButton),
cell(commaDismenberRadioButton),
row(cell(otherDismenberRadioButton).weight(0.2), cell(otherDismenberTextField).weight(0.8))
).getComponent();
//TXT设定主要面板
return column(
LayoutConstants.VERTICAL_GAP,
row(10, cell(encodeLabel).weight(0.2), cell(charsetComboBox).weight(0.8)),
cell(needColumnNameCheckBox),
row(10,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dismenber"))).weight(0.2),
cell(separatorOptionsPanel).weight(0.8)
),
cell(ignoreOneMoreDelimiterCheckBox)
).getComponent();
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText)))
.with(it-> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
private ActionListener radioActionListener = new ActionListener() {
@ -480,24 +478,24 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
return suffixToString;
}
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) {
private ActionListener getFileTypeListener(final JPanel rightPanel) {
ActionListener fileTypeListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setPanel.removeAll();
rightPanel.removeAll();
localText.setText("");
urlText.setText("");
if (fileTypeComboBox.getSelectedIndex() == XML) {
setPanel.add(xmlSetPanel(width, height), BorderLayout.NORTH);
rightPanel.add(getXmlSetPanel());
} else if (fileTypeComboBox.getSelectedIndex() == EXCEL) {
setPanel.add(excelSetPanel(width, height), BorderLayout.NORTH);
rightPanel.add(getExcelSetPanel());
} else {
setPanel.add(textSetPanel(width, height), BorderLayout.NORTH);
rightPanel.add(getTextSetPanel());
}
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips.setText(tipContent);
setPanel.revalidate();
rightPanel.revalidate();
}
};
@ -507,7 +505,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private class RefreshAction extends UITableEditAction {
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override
@ -818,9 +816,10 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
JPanel toolbarPanel = new JPanel(new BorderLayout());
this.setLayout(new BorderLayout());
xmlNodeTree = new XMLNodeTree();
xmlNodeTree.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
this.add(new JScrollPane(xmlNodeTree));
keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point") + ":");
keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point"));
refreshAction = new RefreshParameterAction();
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(refreshAction);
@ -840,7 +839,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
public RefreshParameterAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setMnemonic('r');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override

9
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallHeightPane.java

@ -9,11 +9,10 @@ package com.fr.design.data.tabledata.tabledatapane;
*/
public class FileTableDataSmallHeightPane extends FileTableDataPane{
//wikky:文件数据集在模板数据集下面的界面参数。
private static final int SETPANELWIDTH = 265;
private static final int WIDTH = 245;
private static final int HEIGHT = 475;
private static final int GAP = 13;
private static final double LOCAL_WIDTH_RATIO = 0.58;
private static final double URL_WIDTH_RATIO = 0.51;
public FileTableDataSmallHeightPane(){
super(SETPANELWIDTH,WIDTH,HEIGHT,GAP);
super(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
}
}

9
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallPane.java

@ -9,11 +9,10 @@ package com.fr.design.data.tabledata.tabledatapane;
*/
public class FileTableDataSmallPane extends FileTableDataPane{
//wikky:文件数据集在服务器数据集下面的界面参数。
private static final int SETPANELWIDTH = 265;
private static final int WIDTH = 245;
private static final int HEIGHT = 436;
private static final int GAP = 13;
private static final double LOCAL_WIDTH_RATIO = 0.59;
private static final double URL_WIDTH_RATIO = 0.52;
public FileTableDataSmallPane(){
super(SETPANELWIDTH,WIDTH,HEIGHT,GAP);
super(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
}
}

82
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -1,9 +1,13 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.*;
import com.fr.data.impl.ConditionTableData;
import com.fr.data.impl.MultiTDTableData;
import com.fr.data.impl.UnionTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
@ -39,6 +43,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData> {
private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...”
@ -52,28 +60,25 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
public MultiTDTableDataPane() {
this(StringUtils.EMPTY);
}
public MultiTDTableDataPane(String multiName) {
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(initNorthPane(multiName), BorderLayout.CENTER);
this.add(initSouthPanel(), BorderLayout.SOUTH);
}
private JPanel initNorthPane(String multiName) {
JPanel jpanel = new JPanel();
jpanel.setLayout(new BorderLayout());
JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
jpanel.setBorder(new ScaledEmptyBorder(0,0,10,0));
//选择要合并的数据集-预览
JPanel northPanel = new JPanel(new BorderLayout());
UILabel chooseTableData = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Select_To_Merge"));
UIButton previewButton = new UIButton();
previewButton.setIcon(BaseUtils.readIcon("/com/fr/web/images/preview.png"));
previewButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UIButton previewButton = new UIButton(new LazyIcon("preview"));
previewButton.addActionListener(getPreviewActionListener());
northPanel.add(chooseTableData);
northPanel.add(previewButton);
northPanel.add(row(cell(chooseTableData), cell(previewButton)).getComponent());
centerPanel = new JPanel();
JScrollPane js = new JScrollPane(centerPanel);
@ -84,17 +89,19 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
jpanel.add(northPanel, BorderLayout.NORTH);
jpanel.add(js, BorderLayout.CENTER);
return jpanel;
}
private void initAllBarPane(String multiName) {
UILabel headLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Nam_Formula"));
setResMap();
int len = resMap.size();
// 10个正好不会出现滚动条
centerPanel.setLayout(new GridLayout(len < MIN_BAR_NUMBER ? MIN_BAR_NUMBER : len + 1, 1));
centerPanel.add(headLabel);
centerPanel.add(row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Name"))).weight(0.2),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Conditions"))).weight(0.2),
flex(0.6)
).getComponent());
for (Entry<String, TableDataWrapper> stringTableDataWrapperEntry : resMap.entrySet()) {
TableDataWrapper tableDataWrappe = stringTableDataWrapperEntry.getValue();
@ -103,7 +110,6 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
centerPanel.add(new BarPanel(tmp, tableDataWrappe.getIcon()));
}
}
}
protected void setResMap() {
@ -131,14 +137,13 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
}, StringUtils.BLANK + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Default_Parameter"));
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
}
private class RefreshAction extends UITableEditAction {
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override
@ -249,9 +254,6 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
}
class BarPanel extends JPanel {
private static final int BAR_HEIGHT = 33;
private String name;
private Icon icon;
private UICheckBox chekbox;
@ -283,10 +285,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
private void initUI() {
String tmp = name;
this.setLayout(new FlowLayout(FlowLayout.LEFT));
JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
leftPanel.setPreferredSize(new Dimension(190, BAR_HEIGHT));
this.setLayout(new BorderLayout());
chekbox = new UICheckBox();
UILabel tabledataName = new UILabel(tmp);
while (tabledataName.getPreferredSize().width > MAX_LENTH_OF_DATASET) {
@ -299,25 +298,40 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
chekbox.addActionListener(tableDataCheckboxListener);
iconLabel.addMouseListener(chooseTableDataListener);
tabledataName.addMouseListener(chooseTableDataListener);
leftPanel.add(chekbox);
leftPanel.add(iconLabel);
leftPanel.add(tabledataName);
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.add(row(LayoutConstants.HORIZONTAL_GAP, cell(chekbox), cell(iconLabel), cell(tabledataName)).getComponent());
JPanel rightPanel = new JPanel();
formulaContentTextField = new UITextField(BAR_HEIGHT);
formulaContentTextField = new UITextField();
formulaContentTextField.setEnabled(false);
formulaContentTextField.getDocument().addDocumentListener(documentListener);
formulaButton = new UIButton("...");
formulaButton.setEnabled(false);
formulaButton.setPreferredSize(new Dimension(25, 23));
formulaButton.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
formulaButton.addActionListener(getFormulaActionListener());
rightPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + " ="));
rightPanel.add(formulaContentTextField);
rightPanel.add(formulaButton);
this.setPreferredSize(new Dimension(-1, BAR_HEIGHT));
this.add(leftPanel, BorderLayout.WEST);
this.add(rightPanel, BorderLayout.CENTER);
rightPanel.add(
row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + "=")),
row(LayoutConstants.HGAP_LARGE, cell(formulaContentTextField), cell(formulaButton))
).getComponent()
);
JPanel linePanel = new JPanel(new BorderLayout());
linePanel.add(row(10,
row(10,
cell(chekbox),
cell(iconLabel),
cell(tabledataName)
).weight(0.2),
//条件公式
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + "=")).weight(0.15),
row(5, cell(formulaContentTextField).weight(0.95), cell(formulaButton).weight(0.05)).weight(0.85)
).weight(0.77),
flex(0.03)
).getComponent());
linePanel.setBorder(new ScaledEmptyBorder(4, 0, 4, 0));
this.add(linePanel, BorderLayout.CENTER);
}
public void populate() {

24
designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java

@ -1,17 +1,21 @@
package com.fr.design.dialog;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 封装了"为该模版单独设置、采用服务器设置"选项功能的设置面板
* Created by plough on 2018/11/7.
@ -36,16 +40,16 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
private void initComponents() {
chooseComboBox = new UIComboBox(CHOOSEITEM);
chooseComboBox.addItemListener(itemListener);
//以下设置,部分面板通用
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
belowSetLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
buttonPane = GUICoreUtils.createFlowPane(new Component[] {
belowSetLabel, chooseComboBox}, FlowLayout.LEFT, 0, 0);
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 0));
buttonPane = row(
FineUIScale.scale(32),
cell(belowSetLabel),
cell(chooseComboBox)
).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
this.setLayout(new BorderLayout());
this.add(buttonPane, BorderLayout.NORTH);
this.contentPane = getContentPane();
this.add(contentPane, BorderLayout.CENTER);
this.add(column(cell(buttonPane), cell(contentPane)).getComponent());
}
/**

27
designer-base/src/main/java/com/fr/design/dialog/BasicPane.java

@ -1,6 +1,9 @@
package com.fr.design.dialog;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.common.annotations.Open;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
@ -17,6 +20,9 @@ import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Window;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
@Open
public abstract class BasicPane extends JPanel {
@ -299,16 +305,19 @@ public abstract class BasicPane extends JPanel {
private PropertyChangeAdapter changeListener;
public NamePane(BasicPane bPane) {
this.setLayout(new BorderLayout(4, 4));
nameTextField = new UITextField(30);
Name = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Name") + ":");
JPanel northPane = new JPanel(new BorderLayout(4, 4));
northPane.add(Name, BorderLayout.WEST);
northPane.add(nameTextField, BorderLayout.CENTER);
northPane.add(showfield = new UILabel(" "), BorderLayout.EAST);
this.setLayout(new BorderLayout());
nameTextField = new UITextField();
Name = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Name"));
JPanel northPane = new JPanel(new BorderLayout());
northPane.setBorder(new ScaledEmptyBorder(0,10,0,10));
northPane.add(row(
LayoutConstants.HGAP_LARGE,
cell(Name).weight(0.12),
cell(nameTextField).weight(0.58),
cell(showfield = new UILabel(" ")).weight(0.3)
).getComponent());
showfield.setForeground(new Color(204, 0, 1));
showfield.setPreferredSize(new Dimension(220, showfield.getPreferredSize().height));
showfield.setPreferredSize(FineUIScale.scale(new Dimension(220, showfield.getPreferredSize().height)));
this.add(northPane, BorderLayout.NORTH);
this.centerPane = bPane;
this.add(bPane, BorderLayout.CENTER);

87
designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java

@ -1,27 +1,33 @@
package com.fr.design.gui.frpane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.JListUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.JOptionPane;
import javax.swing.DefaultListCellRenderer;
import javax.swing.SwingUtilities;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -29,13 +35,17 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public abstract class EditingStringListPane extends BasicBeanPane<List<String>> {
private static final long serialVersionUID = 1L;
private DefaultListModel model;
private JList jlist;
private UIButton addButton;
private UIButton editButton;
private UIButton modifyButton;
private UIButton removeButton;
private UIButton moveUpButton;
private UIButton moveDownButton;
@ -43,6 +53,11 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
public EditingStringListPane() {
super();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
//按钮
JPanel buttonPane = initButtonPane();
buttonPane.setBorder(new ScaledEmptyBorder(0,0,10,0));
this.add(buttonPane, BorderLayout.NORTH);
//列表
model = new DefaultListModel();
jlist = new JList(model);
jlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@ -56,34 +71,43 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
}
});
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"));
editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"));
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
JPanel eastPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
eastPane.add(editButton);
eastPane.add(removeButton);
eastPane.add(moveUpButton);
eastPane.add(moveDownButton);
this.add(GUICoreUtils.createBorderPane(eastPane, BorderLayout.NORTH), BorderLayout.EAST);
JPanel centerPane = new JPanel(new BorderLayout(0, 5));
this.add(centerPane, BorderLayout.CENTER);
JPanel northcenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northcenterPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
northcenterPane.add(addButton, BorderLayout.EAST);
centerPane.add(northcenterPane, BorderLayout.NORTH);
centerPane.add(new JScrollPane(jlist), BorderLayout.CENTER);
jlist.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
JScrollPane scrollPane = new JScrollPane(jlist);
scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(620,350)));
scrollPane.setBorder(new FineRoundBorder());
this.add(scrollPane, BorderLayout.CENTER);
//统一加按钮事件
this.addListener();
this.addButton.setEnabled(false);
this.checkEnableState();
}
private JPanel initButtonPane() {
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"), new LazyIcon("add"));
addButton.setDisabledIcon(new LazyIcon("add").disabled());
modifyButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"), new LazyIcon("edit"));
modifyButton.setDisabledIcon(new LazyIcon("edit").disabled());
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), new LazyIcon("remove"));
removeButton.setDisabledIcon(new LazyIcon("remove").disabled());
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"), new LazyIcon("move_up"));
moveUpButton.setDisabledIcon(new LazyIcon("move_up").disabled());
moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"), new LazyIcon("move_down"));
moveDownButton.setDisabledIcon(new LazyIcon("move_down").disabled());
return row(LayoutConstants.HORIZONTAL_GAP,
flex(),
cell(addButton),
cell(modifyButton),
cell(removeButton),
cell(moveUpButton),
cell(moveDownButton)
).getComponent();
}
private void addListener() {
addListener1();
@ -119,7 +143,6 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
private void addListener1() {
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String newvalue = getAddOrEditString();
@ -133,7 +156,7 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
}
}
});
editButton.addActionListener(new ActionListener() {
modifyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -174,7 +197,7 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
private void setEditEnabled(boolean enabled) {
this.removeButton.setEnabled(enabled);
this.editButton.setEnabled(enabled);
this.modifyButton.setEnabled(enabled);
this.moveUpButton.setEnabled(enabled);
this.moveDownButton.setEnabled(enabled);
}

5
designer-base/src/main/java/com/fr/design/gui/ilable/FRExplainLabel.java

@ -1,10 +1,9 @@
package com.fr.design.gui.ilable;
import java.awt.Color;
import com.fine.theme.utils.FineUIStyle;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import com.fr.design.gui.ilable.UILabel;
public class FRExplainLabel extends UILabel {
@ -19,6 +18,6 @@ public class FRExplainLabel extends UILabel {
private void init(){
setIcon(icon);
setForeground(new Color(255, 0, 0));
FineUIStyle.setStyle(this, FineUIStyle.LABEL_WARNING_TIP);
}
}

42
designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java

@ -1,18 +1,21 @@
package com.fr.design.parameter;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class ParameterPane extends BasicBeanPane<Parameter> {
@ -34,27 +37,24 @@ public class ParameterPane extends BasicBeanPane<Parameter> {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(new BorderLayout());
//名字
nameTextField = new UITextField(10);
nameTextField.setEditable(false);
JPanel textFieldPanel=FRGUIPaneFactory.createBorderLayout_S_Pane();
textFieldPanel.add(nameTextField,BorderLayout.CENTER);
//默认值
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
// richer:要排列显示的控件
Component[][] components = {{null},
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"),textFieldPanel },
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":"),valueEditor }
};
double p =TableLayout.PREFERRED;
double f =TableLayout.FILL;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, p, f, p, p};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(
components, rowSize, columnSize, 20, 10);
JPanel centerPane = column(LayoutConstants.VERTICAL_GAP,
row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(0.1),
cell(nameTextField).weight(0.8),
flex(0.1)),
row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":")).weight(0.1),
cell(valueEditor).weight(0.8),
flex(0.1))
).getComponent();
centerPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 0));
this.add(centerPane, BorderLayout.CENTER);
}

170
designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

@ -1,46 +1,52 @@
package com.fr.design.report;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.gui.style.FRFontPane;
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.style.color.NewColorSelectPane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.SwingConstants;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusAdapter;
import java.awt.Dialog;
import java.awt.FlowLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
@ -57,7 +63,7 @@ public class WatermarkPane extends BasicPane {
private UIComboBox fontSizeComboBox;
//横向间距
private UISpinner horizontalGapSpinner;
//向间距
//向间距
private UISpinner verticalGapSpinner;
// 文字颜色
private NewColorSelectPane colorPane;
@ -69,7 +75,7 @@ public class WatermarkPane extends BasicPane {
//纵向间距最小值
public static final int VERTICAL_GAP_MIX = 50;
private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20);
private JPanel leftPane;
public WatermarkPane() {
initComponents();
@ -77,26 +83,45 @@ public class WatermarkPane extends BasicPane {
private void initComponents() {
message = new UILabel();
this.setBorder(BorderFactory.createEmptyBorder(4, 4, -5, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(contentPane, BorderLayout.CENTER);
// 预览
JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(leftPane, BorderLayout.CENTER);
leftPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"), null));
//左侧预览面板
JPanel previewPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
leftPane.add(previewPaneWrapper, BorderLayout.CENTER);
previewPaneWrapper.setBorder(BorderFactory.createEmptyBorder(2, 8, 4, 8));
//预览外边框,宽度跟随全局权重
previewPaneWrapper.setBorder(new FineRoundBorder());
previewPaneWrapper.setPreferredSize(FineUIScale.scale(new Dimension(-1,415)));
previewPaneWrapper.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
watermarkPreviewPane = new WatermarkPreviewPane();
watermarkPreviewPane.setOpaque(false);
previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER);
// 设置
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(rightPane, BorderLayout.EAST);
rightPane.add(initRightPane(), BorderLayout.NORTH);
leftPane = column(
LayoutConstants.VGAP_SMALL,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))),
cell(previewPaneWrapper)
).getComponent();
// 分割线
JPanel separatorLine = new JPanel();
separatorLine.setBorder(FineBorderFactory.createDefaultUnderlineBorder());
//在预览与配置外创建一个大的外边框并设置边距
JPanel innerPanel = row(
LayoutConstants.HORIZONTAL_GAP,
cell(leftPane).weight(0.55),
cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent();
JPanel outerPanel = new JPanel(new BorderLayout());
outerPanel.setBorder(new FineRoundBorder());
outerPanel.setBackground(FineUIUtils.getUIColor("fill.gray", "defaultBorderColor"));
outerPanel.add(innerPanel);
// 分割线下方,左侧预览,右侧配置
JPanel centerPanel = column(LayoutConstants.VERTICAL_GAP,
cell(separatorLine),
cell(outerPanel)
).getComponent();
centerPanel.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.add(centerPanel, BorderLayout.CENTER);
}
public void populate(WatermarkAttr watermark) {
@ -129,60 +154,59 @@ public class WatermarkPane extends BasicPane {
this.formulaPane = formulaPane;
}
protected UIScrollPane initRightPane() {
/**
* 配置Pane
* @return
*/
protected JPanel getRightPane() {
// 文字
formulaPane = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula"));
// 字号
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
fontSizeComboBox.setEditable(true);
//水印间距
horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UnsignedIntUISpinner(50, Integer.MAX_VALUE, 1, 100);
horizontalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
verticalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
//失去焦点时要判断是否要弹出提示
horizontalGapSpinner.getTextField().addFocusListener(
createFocusListener4GapNumberField(horizontalGapSpinner, HORIZONTAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Horizontal_Gap_Over_Warning")));
verticalGapSpinner.getTextField().addFocusListener(createFocusListener4GapNumberField(verticalGapSpinner, VERTICAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Vertical_Gap_Over_Warning")));
//next 按钮 释放时也要判断是否要弹出提示
horizontalGapSpinner.getNextButton().addMouseListener(createMouseListener4GapNextButton(horizontalGapSpinner, HORIZONTAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Horizontal_Gap_Over_Warning")));
verticalGapSpinner.getNextButton().addMouseListener(createMouseListener4GapNextButton(verticalGapSpinner, VERTICAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Vertical_Gap_Over_Warning")));
JPanel fontSizeTypePane = new JPanel(new BorderLayout(10, 0));
fontSizeTypePane.add(fontSizeComboBox, BorderLayout.CENTER);
//水印间距面板
JPanel watermarkGapPane = new JPanel(new BorderLayout(10, 0));
JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 0);
jp.add(horizontalGapSpinner);
jp.add(verticalGapSpinner);
watermarkGapPane.add(jp, BorderLayout.CENTER);
JPanel watermarkGapTipsPane = new JPanel(new BorderLayout());
JPanel tipsJp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 0);
tipsJp.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), SwingConstants.CENTER));
tipsJp.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), SwingConstants.CENTER));
watermarkGapTipsPane.add(tipsJp, BorderLayout.CENTER);
//水印间距提示居中布局
JPanel watermarkGapTipsPane = row(LayoutConstants.HGAP_LARGE,
flex(0.15),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"))).weight(0.2),
flex(0.3),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"))).weight(0.2),
flex(0.15)
).getComponent();
//水印间距排列
JPanel watermarkGapPane = column(
row(LayoutConstants.HGAP_LARGE,
cell(horizontalGapSpinner).weight(0.5),
cell(verticalGapSpinner).weight(0.5)
),
cell(watermarkGapTipsPane)
).getComponent();
// 颜色选择器
colorPane = new NewColorSelectPane(false);
JPanel colorLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
colorLabelPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text_Color")), BorderLayout.NORTH);
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, MAX_WIDTH};
JPanel rightContentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Watermark_Text")), formulaPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Size")), fontSizeTypePane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Watermark_Gap")), watermarkGapPane},
{null, watermarkGapTipsPane},
{colorLabelPane, colorPane},
}, rowSize, columnSize, 10);
rightContentPane.setBorder(BorderFactory.createEmptyBorder(15, 12, 10, 12));
UIScrollPane configPane = new UIScrollPane(rightContentPane);
configPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"), null));
return configPane;
// 配置面板排列布局
JPanel rightContentPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Watermark_Text"))).weight(0.3), cell(formulaPane).weight(0.7)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Size"))).weight(0.3), cell(fontSizeComboBox).weight(0.7)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Watermark_Gap"))).weight(0.3), cell(watermarkGapPane).weight(0.7)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text_Color"))).weight(0.3), cell(colorPane).weight(0.7))
).getComponent();
rightContentPane.setOpaque(false);
return rightContentPane;
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).
with(it -> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
protected void populateFontSize(int fontSize) {

2
designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java

@ -20,7 +20,7 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
}
private void initComponents() {
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
//buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
}
@Override

47
designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java

@ -1,12 +1,12 @@
package com.fr.design.report.fit;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.fit.provider.FitAttrModelProvider;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.fit.ReportFitAttr;
import javax.swing.*;
@ -17,6 +17,8 @@ import java.util.Comparator;
import java.util.Set;
import java.util.stream.Collectors;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.i18n.Toolkit.i18nText;
public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
@ -26,26 +28,23 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected UIComboBox itemChoose;
protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>();
private ReportFitConfigPane fitConfigPane;
public FitAttrModel fitAttrModel;
private static final int BELOW_SET_COMPONENT_HSPACE = 8;
protected BaseFitAttrPane() {
initFitAttrModel();
}
private void initFitAttrModel() {
//旧决策报表
fitAttrModelList.add(new FrmFitAttrModel());
//普通报表
fitAttrModelList.add(new CptFitAttrModel());
//决策报表
fitAttrModelList.add(new AdaptiveFrmFitAttrModel());
Set<FitAttrModelProvider> fitAttrModelProviders = ExtraDesignClassManager.getInstance().getArray(FitAttrModelProvider.XML_TAG);
for (FitAttrModelProvider fitAttrModelProvider : fitAttrModelProviders) {
fitAttrModelList.add(fitAttrModelProvider);
}
fitAttrModelList = fitAttrModelList.stream().sorted(Comparator.comparing(FitAttrModel::getPriority).reversed()).collect(Collectors.toList());
}
@ -55,6 +54,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
contentJPanel.remove(fitConfigPane);
}
this.fitConfigPane = fitAttrModel instanceof CptFitAttrModel ? new ReportFitConfigPane(fitAttrModel, true) : new FormFitConfigPane(fitAttrModel, true);
//添加自适应面板
contentJPanel.add(fitConfigPane);
}
@ -82,34 +82,33 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected abstract String[] getItemNames();
protected void initComponents() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
this.add(contentJPanel);
//添加以下设置
initItemChoose();
//服务器配置-PC端自适应属性面板中需要添加提示
initPrompt();
this.setLayout(new BorderLayout());
this.add(contentJPanel);
}
/**
* 以下设置Pane
*/
private void initItemChoose() {
JPanel chooseJPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
ItemListener itemListener = getItemListener();
belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
itemChoose = new UIComboBox(getItemNames());
ItemListener itemListener = getItemListener();
itemChoose.addItemListener(itemListener);
belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
JPanel hSpaceLabel = new JPanel();
hSpaceLabel.setSize(BELOW_SET_COMPONENT_HSPACE, 0);
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{
belowSetLabel, hSpaceLabel, itemChoose}, FlowLayout.LEFT);
chooseJPanel.add(buttonPane);
chooseJPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
contentJPanel.add(chooseJPanel);
//以下设置横向布局
JPanel buttonPane = row(20, cell(belowSetLabel), cell(itemChoose)).getComponent();
buttonPane.setBorder(new ScaledEmptyBorder(0,5,5,0));
//整体面板添加‘以下设置Pane’
contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
contentJPanel.setBorder(new ScaledEmptyBorder(5,10,5,10));
contentJPanel.add(buttonPane);
}
protected abstract ItemListener getItemListener();
public void populate(ReportFitAttr reportFitAttr) {
}

25
designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java

@ -1,11 +1,12 @@
package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.svg.SVGLoader;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.fit.menupane.FitRadioGroup;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
@ -23,13 +24,16 @@ import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class FormFitConfigPane extends ReportFitConfigPane {
private static final int ICON_OFFSET_X = 25;
private static final int ICON_OFFSET_Y = 3;
private static final int ICON_SIZE = 16;
//待调整
private static final Image HOVER_IMAGE = SVGLoader.load("/com/fr/design/icon/icon_ec_default_fit.svg");
private static final int DEFAULT_ITEM = 0;
private static final int CUSTOM_ITEM = 1;
public FormFitConfigPane(FitAttrModel fitAttrModel) {
@ -41,12 +45,11 @@ public class FormFitConfigPane extends ReportFitConfigPane {
}
protected JPanel initECConfigPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel jPanel = new JPanel(new BorderLayout());
if (fitAttrModel.getFitTypeNames().length != 0) {
Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1];
initRadioGroup(ecConfigRadioGroup, fitAttrModel.getFitName(), fitAttrModel.getFitTypeNames(), ecComponents);
jPanel.add(createSubAttrPane(ecComponents), BorderLayout.CENTER);
jPanel.add(createTipPane(), BorderLayout.SOUTH);
jPanel.add(column(10, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent());
}
return jPanel;
}
@ -79,7 +82,6 @@ public class FormFitConfigPane extends ReportFitConfigPane {
UIPopupMenu uiPopupMenu = new UIPopupMenu() {
@Override
protected void paintBorder(Graphics g) {
}
};
uiPopupMenu.setLayout(new BorderLayout(0, 0));
@ -107,7 +109,6 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} else {
hidePreviewPane();
}
}
});
}
@ -138,13 +139,12 @@ public class FormFitConfigPane extends ReportFitConfigPane {
}
private JPanel createTipPane() {
JPanel jPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
JPanel jPanel = new JPanel(new BorderLayout());
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"));
jPanel.add(label1);
label1.setForeground(Color.lightGray);
FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP);
UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"));
jPanel.add(label2);
label2.setForeground(Color.lightGray);
FineUIStyle.setStyle(label2, FineUIStyle.LABEL_TIP);
jPanel.add(column(LayoutConstants.HORIZONTAL_GAP, cell(label1), cell(label2)).getComponent());
return jPanel;
}
@ -159,5 +159,4 @@ public class FormFitConfigPane extends ReportFitConfigPane {
protected void updateECConfigRadioGroup(ReportFitAttr reportFitAttr) {
reportFitAttr.setFitStateInPC(ecConfigRadioGroup.getSelectRadioIndex());
}
}

3
designer-base/src/main/java/com/fr/design/report/fit/NewFitPreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.GraphHelper;
import com.fr.general.FRFont;
@ -17,7 +18,7 @@ public class NewFitPreviewPane extends JPanel {
private static final Color DEFAULT_PAINT_COLOR = Color.decode("#419BF9");
private static final int FIT_FONT_SIZE = 15;
private static final int NO_FIT_FONT_SIZE = 10;
private static final Dimension NO_FIT_CONTAINER_DIMENSION = new Dimension(230, 80);
private static final Dimension NO_FIT_CONTAINER_DIMENSION = FineUIScale.scale(new Dimension(230, 80));
public NewFitPreviewPane(){

49
designer-base/src/main/java/com/fr/design/report/fit/ReportFitConfigPane.java

@ -1,5 +1,6 @@
package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
@ -10,15 +11,16 @@ import com.fr.design.report.fit.menupane.FontRadioGroup;
import com.fr.general.ComparatorUtils;
import com.fr.report.fit.ReportFitAttr;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.i18n.Toolkit.i18nText;
public class ReportFitConfigPane extends JPanel {
@ -36,21 +38,24 @@ public class ReportFitConfigPane extends JPanel {
}
private void initComponent() {
JPanel contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
this.add(contentJPanel);
fontRadioGroup = new FontRadioGroup();
ecConfigRadioGroup = new FitRadioGroup();
contentJPanel.add(initAttrJPanel());
contentJPanel.add(initPreviewJPanel());
this.add(initContentPanel());
}
private JPanel initAttrJPanel() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
private JPanel initContentPanel() {
//字体
Component[] fontComponents = new Component[3];
initRadioGroup(fontRadioGroup, i18nText("Fine-Designer_Fit-Font"), new String[]{i18nText("Fine-Designer_Fit"), i18nText("Fine-Designer_Fit-No")}, fontComponents);
jPanel.add(createSubAttrPane(fontComponents), BorderLayout.NORTH);
jPanel.add(initECConfigPane(), BorderLayout.CENTER);
return jPanel;
//预览区域
previewJPanel = new NewFitPreviewPane();
previewJPanel.setPreferredSize(FineUIScale.scale(new Dimension(300, 204)));
//面板布局 字体-(null/报表块/表格)-预览区域
return column(10,
cell(createSubAttrPane(fontComponents)),
cell(initECConfigPane()),
cell(previewJPanel)
).getComponent();
}
protected JPanel initECConfigPane() {
@ -61,21 +66,14 @@ public class ReportFitConfigPane extends JPanel {
return jPanel;
}
protected JPanel createSubAttrPane(Component[] components) {
double[] rowSize = new double[]{20};
double[] columnSize = new double[components.length];
for (int i = 0; i < columnSize.length; i++) {
if (i == 0) {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth();
} else {
for (int i = 1; i < columnSize.length; i++) {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth();
}
}
JPanel attrJPanel = TableLayoutHelper.createTableLayoutPane(new Component[][]{components}, rowSize, columnSize);
attrJPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
return attrJPanel;
return row(cell(components[0]).weight(0.16),cell(attrJPanel).weight(0.84)).getComponent();
}
protected void initRadioGroup(FitRadioGroup fitRadioGroup, String name, String[] options, Component[] components) {
@ -110,17 +108,6 @@ public class ReportFitConfigPane extends JPanel {
previewJPanel.refreshPreview(fontRadioGroup.isFontFit(), FitType.parse(updateBean()));
}
private JPanel initPreviewJPanel() {
JPanel wrapperPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewJPanel = new NewFitPreviewPane();
wrapperPane.add(previewJPanel, BorderLayout.CENTER);
int leftIndent = globalConfig ? (int) DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth() : 0;
wrapperPane.setBorder(BorderFactory.createEmptyBorder(0, leftIndent, 0, 0));
wrapperPane.setPreferredSize(new Dimension(300 + leftIndent, 204));
return wrapperPane;
}
public void populateBean(ReportFitAttr ob) {
fontRadioGroup.selectIndexButton(ob.isFitFont() ? 0 : 1);
populateECConfigRadioGroup(ob.fitStateInPC());

11
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -16,6 +16,7 @@ import com.fr.data.util.function.SumFunction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.DefaultValueAdjustProvider;
import com.fr.design.gui.ibutton.UIButton;
@ -90,6 +91,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
// Noninstantiable utility class
public final class GUICoreUtils {
@ -992,12 +996,7 @@ public final class GUICoreUtils {
dynamicPane.setVisible(e.getStateChange() == visibleState);
}
});
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(checkBox, BorderLayout.NORTH);
JPanel dynamicPaneWrapper = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
dynamicPaneWrapper.add(dynamicPane);
panel.add(dynamicPaneWrapper, BorderLayout.CENTER);
return panel;
return column(LayoutConstants.VERTICAL_GAP, cell(checkBox), cell(dynamicPane)).getComponent();
}
/**

42
designer-base/src/main/java/com/fr/design/widget/IconDefinePane.java

@ -1,40 +1,38 @@
package com.fr.design.widget;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.web.CustomIconPane;
import com.fr.form.ui.WidgetInfoConfig;
import javax.swing.*;
import java.awt.*;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.ImageIcon;
import java.awt.Image;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class IconDefinePane extends BasicPane {
private UILabel showIconImageLable;
private UIButton editIconButton;
private UIButton removeIconButton;
private String curIconName;
private Icon curIcon;
public IconDefinePane() {
JPanel iconPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel labelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelPane.setLayout(new /**/ FlowLayout(FlowLayout.LEFT, 20, 0));
showIconImageLable = new UILabel();
showIconImageLable.setPreferredSize(new Dimension(20, 20));
editIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
JPanel iconButtonPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelPane.add(showIconImageLable);
iconPane.add(labelPane, BorderLayout.WEST);
iconPane.add(iconButtonPane, BorderLayout.EAST);
iconButtonPane.add(editIconButton);
editIconButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -54,7 +52,6 @@ public class IconDefinePane extends BasicPane {
});
removeIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Delete"));
iconButtonPane.add(removeIconButton);
removeIconButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
curIconName = null;
@ -62,9 +59,10 @@ public class IconDefinePane extends BasicPane {
}
});
this.add(this.showIconImageLable);
this.add(this.editIconButton);
this.add(this.removeIconButton);
JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable), cell(this.editIconButton), cell(this.removeIconButton)).getComponent();
iconButtonPane.setBorder(new ScaledEmptyBorder(0,0,0,0));
this.setLayout(new BorderLayout());
this.add(iconButtonPane, BorderLayout.CENTER);
}
@Override
@ -86,6 +84,16 @@ public class IconDefinePane extends BasicPane {
setShowIconImage();
}
/**
* 直接更新icon
* @param iconName
* @param icon
*/
public void populateIcon(String iconName, Icon icon) {
this.curIconName = iconName;
showIconImageLable.setIcon(icon);
}
public String update() {
return this.curIconName;
}

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4V6H3C2.44772 6 2 6.44772 2 7C2 7.55228 2.44771 8 3 8H5V28C5 29.1046 5.89543 30 7 30H25C26.1046 30 27 29.1046 27 28V8H29C29.5523 8 30 7.55228 30 7C30 6.44772 29.5523 6 29 6H23V4C23 2.89543 22.1046 2 21 2H11C9.89543 2 9 2.89543 9 4ZM21 4H11V6H21V4ZM7 28L7 8H25V28H7ZM10.707 12.7071C11.0975 12.3166 11.7306 12.3166 12.1212 12.7071L16.0862 16.6721L20.0512 12.7071C20.4417 12.3166 21.0749 12.3166 21.4654 12.7071C21.8559 13.0976 21.8559 13.7308 21.4654 14.1213L17.5004 18.0863L21.4034 21.9893C21.7939 22.3798 21.7939 23.013 21.4034 23.4035C21.0129 23.7941 20.3797 23.7941 19.9892 23.4035L16.0862 19.5005L12.1213 23.4654C11.7308 23.8559 11.0976 23.8559 10.7071 23.4654C10.3166 23.0749 10.3166 22.4417 10.7071 22.0512L14.672 18.0863L10.707 14.1213C10.3164 13.7308 10.3164 13.0976 10.707 12.7071Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 982 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4V6H3C2.44772 6 2 6.44772 2 7C2 7.55228 2.44771 8 3 8H5V28C5 29.1046 5.89543 30 7 30H25C26.1046 30 27 29.1046 27 28V8H29C29.5523 8 30 7.55228 30 7C30 6.44772 29.5523 6 29 6H23V4C23 2.89543 22.1046 2 21 2H11C9.89543 2 9 2.89543 9 4ZM21 4H11V6H21V4ZM7 28L7 8H25V28H7ZM10.707 12.7071C11.0975 12.3166 11.7306 12.3166 12.1212 12.7071L16.0862 16.6721L20.0512 12.7071C20.4417 12.3166 21.0749 12.3166 21.4654 12.7071C21.8559 13.0976 21.8559 13.7308 21.4654 14.1213L17.5004 18.0863L21.4034 21.9893C21.7939 22.3798 21.7939 23.013 21.4034 23.4035C21.0129 23.7941 20.3797 23.7941 19.9892 23.4035L16.0862 19.5005L12.1213 23.4654C11.7308 23.8559 11.0976 23.8559 10.7071 23.4654C10.3166 23.0749 10.3166 22.4417 10.7071 22.0512L14.672 18.0863L10.707 14.1213C10.3164 13.7308 10.3164 13.0976 10.707 12.7071Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 983 B

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5516_63505)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 16C30 23.732 23.732 30 16 30C8.26801 30 2 23.732 2 16C2 8.26801 8.26801 2 16 2C23.732 2 30 8.26801 30 16ZM32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM8 24.3492C8 24.6254 8.22386 24.8492 8.5 24.8492H10.8284L22.412 13.2657L19.5836 10.4372L8 22.0208V24.3492ZM24.2635 11.4142L23.8262 11.8514L20.9978 9.02302L21.435 8.58579C22.2161 7.80474 23.4824 7.80474 24.2635 8.58579C25.0445 9.36684 25.0445 10.6332 24.2635 11.4142Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5516_63505">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 826 B

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_170904)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 16C30 23.732 23.732 30 16 30C8.26801 30 2 23.732 2 16C2 8.26801 8.26801 2 16 2C23.732 2 30 8.26801 30 16ZM32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM8 24.3492C8 24.6254 8.22386 24.8492 8.5 24.8492H10.8284L22.412 13.2657L19.5836 10.4372L8 22.0208V24.3492ZM24.2635 11.4142L23.8262 11.8514L20.9978 9.02302L21.435 8.58579C22.2161 7.80474 23.4824 7.80474 24.2635 8.58579C25.0445 9.36684 25.0445 10.6332 24.2635 11.4142Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_170904">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 829 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H27V14H29V4C29 2.89543 28.1046 2 27 2H4C2.89543 2 2 2.89543 2 4V26C2 27.1046 2.89543 28 4 28H14V26H4L4 4ZM12.538 11.7933L17.9256 13.2369C18.2459 13.4164 18.6441 13.4059 18.9553 13.2052C19.0696 13.1383 19.1707 13.0488 19.2514 12.941L24.071 8.12128C24.4615 7.73078 24.4615 7.09765 24.071 6.70715C23.6805 6.31665 23.0473 6.31665 22.6568 6.70716L18.1403 11.2238L12.5128 9.71597C12.1313 9.61375 11.7422 9.74654 11.4992 10.0256C11.4517 10.0588 11.4065 10.0966 11.3641 10.1389L6.41437 15.0888C6.02388 15.4793 6.02388 16.1124 6.41438 16.5029C6.80489 16.8934 7.43803 16.8934 7.82853 16.5029L12.538 11.7933ZM18 22.1691V18.951C19.8448 18.7698 21.5473 18.0931 23 17.0613C24.4526 18.0932 26.1551 18.7699 28 18.9511V22.1691C28 24.1722 27.4739 26.2475 26.533 27.7559C25.6137 29.2296 24.4296 30 23 30C21.5704 30 20.3863 29.2296 19.467 27.7559C18.5261 26.2475 18 24.1722 18 22.1691ZM16 22.1691V18.9509V17.9413C16 17.4086 16.4673 16.9999 17 16.9999C17.338 16.9999 17.6717 16.9792 18 16.9389C19.5787 16.745 21.0343 16.0974 22.2588 15.1161C22.6881 14.7721 23.3118 14.7721 23.7411 15.1161C24.9657 16.0974 26.4213 16.745 28 16.9389C28.3283 16.9793 28.662 17 29 17C29.5327 17 30 17.4087 30 17.9414V18.951V22.1691C30 26.7821 27.613 32 23 32C18.387 32 16 26.7821 16 22.1691Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H27V14H29V4C29 2.89543 28.1046 2 27 2H4C2.89543 2 2 2.89543 2 4V26C2 27.1046 2.89543 28 4 28H14V26H4L4 4ZM12.538 11.7933L17.9256 13.2369C18.2459 13.4164 18.6441 13.4059 18.9553 13.2052C19.0696 13.1383 19.1707 13.0488 19.2514 12.941L24.071 8.12128C24.4615 7.73078 24.4615 7.09765 24.071 6.70715C23.6805 6.31665 23.0473 6.31665 22.6568 6.70716L18.1403 11.2238L12.5128 9.71597C12.1313 9.61375 11.7422 9.74654 11.4992 10.0256C11.4517 10.0588 11.4065 10.0966 11.3641 10.1389L6.41437 15.0888C6.02388 15.4793 6.02388 16.1124 6.41438 16.5029C6.80489 16.8934 7.43803 16.8934 7.82853 16.5029L12.538 11.7933ZM18 22.1691V18.951C19.8448 18.7698 21.5473 18.0931 23 17.0613C24.4526 18.0932 26.1551 18.7699 28 18.9511V22.1691C28 24.1722 27.4739 26.2475 26.533 27.7559C25.6137 29.2296 24.4296 30 23 30C21.5704 30 20.3863 29.2296 19.467 27.7559C18.5261 26.2475 18 24.1722 18 22.1691ZM16 22.1691V18.9509V17.9413C16 17.4086 16.4673 16.9999 17 16.9999C17.338 16.9999 17.6717 16.9792 18 16.9389C19.5787 16.745 21.0343 16.0974 22.2588 15.1161C22.6881 14.7721 23.3118 14.7721 23.7411 15.1161C24.9657 16.0974 26.4213 16.745 28 16.9389C28.3283 16.9793 28.662 17 29 17C29.5327 17 30 17.4087 30 17.9414V18.951V22.1691C30 26.7821 27.613 32 23 32C18.387 32 16 26.7821 16 22.1691Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/email.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.3942 6H4.39882L15.1417 16.9833C15.5339 17.3841 16.179 17.3841 16.5712 16.9833L23.9038 9.49036L23.9114 9.48262L23.9114 9.48266L27.3942 6ZM4 8.45251V26L28 26V8.22259L25.3295 10.8931L18.0006 18.3822C16.824 19.5845 14.8889 19.5845 13.7123 18.3822L13.7121 18.382L4 8.45251ZM2 6C2 4.89543 2.89543 4 4 4H28C29.1046 4 30 4.89543 30 6V26C30 27.1046 29.1046 28 28 28H4C2.89543 28 2 27.1046 2 26V6Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 581 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/email_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.3942 6H4.39882L15.1417 16.9833C15.5339 17.3841 16.179 17.3841 16.5712 16.9833L23.9038 9.49036L23.9114 9.48262L23.9114 9.48266L27.3942 6ZM4 8.45251V26L28 26V8.22259L25.3295 10.8931L18.0006 18.3822C16.824 19.5845 14.8889 19.5845 13.7123 18.3822L13.7121 18.382L4 8.45251ZM2 6C2 4.89543 2.89543 4 4 4H28C29.1046 4 30 4.89543 30 6V26C30 27.1046 29.1046 28 28 28H4C2.89543 28 2 27.1046 2 26V6Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 582 B

11
designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up.svg

@ -1,3 +1,10 @@
<svg width="10" height="14" viewBox="0 0 10 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M4.49999 2.4142L1.45707 5.45711C1.26181 5.65238 0.945224 5.65238 0.749962 5.45711C0.5547 5.26185 0.5547 4.94527 0.749962 4.75001L4.99997 0.5L9.24998 4.75001C9.44524 4.94527 9.44524 5.26185 9.24998 5.45711C9.05472 5.65238 8.73813 5.65238 8.54287 5.45711L5.49999 2.41423V12.7071C5.49999 12.9832 5.27613 13.2071 4.99999 13.2071C4.72384 13.2071 4.49999 12.9832 4.49999 12.7071V2.4142Z" fill="#0A1C38" fill-opacity="0.9"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4811_12126)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.8284L8.91414 12.9142C8.52361 13.3048 7.89045 13.3048 7.49992 12.9142C7.1094 12.5237 7.1094 11.8905 7.49992 11.5L15.9999 3L24.5 11.5C24.8905 11.8905 24.8905 12.5237 24.5 12.9142C24.1094 13.3048 23.4763 13.3048 23.0857 12.9142L17 6.82846V27.4142C17 27.9664 16.5523 28.4142 16 28.4142C15.4477 28.4142 15 27.9664 15 27.4142V6.8284Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_4811_12126">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 671 B

11
designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up_disable.svg

@ -1,3 +1,10 @@
<svg width="18" height="26" viewBox="0 0 18 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M7.99997 4.41421L1.91414 10.5C1.52361 10.8906 0.890449 10.8906 0.499924 10.5C0.1094 10.1095 0.1094 9.47635 0.499924 9.08583L8.99994 0.585815L17.5 9.08583C17.8905 9.47636 17.8905 10.1095 17.5 10.5C17.1094 10.8906 16.4763 10.8906 16.0857 10.5L9.99997 4.41427V25C9.99997 25.5523 9.55226 26 8.99997 26C8.44769 26 7.99997 25.5523 7.99997 25V4.41421Z" fill="#0A1C38" fill-opacity="0.29"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_162212)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.41421L8.91414 12.5C8.52361 12.8906 7.89045 12.8906 7.49992 12.5C7.1094 12.1095 7.1094 11.4764 7.49992 11.0858L15.9999 2.58582L24.5 11.0858C24.8905 11.4764 24.8905 12.1095 24.5 12.5C24.1094 12.8906 23.4763 12.8906 23.0857 12.5L17 6.41427V27C17 27.5523 16.5523 28 16 28C15.4477 28 15 27.5523 15 27V6.41421Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_162212">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 651 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.3366 5.18683L13.2306 15.2929C12.84 15.6834 12.84 16.3166 13.2306 16.7071L23.3366 26.8132C23.7857 27.2623 24.5139 27.2623 24.963 26.8132C25.4121 26.3641 25.4121 25.6359 24.963 25.1868L15.7762 16L24.963 6.81318C25.4121 6.36408 25.4121 5.63594 24.963 5.18683C24.5139 4.73773 23.7857 4.73773 23.3366 5.18683ZM7.62639 5.00001C8.26152 5.00001 8.77639 5.51488 8.77639 6.15001V25.85C8.77639 26.4851 8.26152 27 7.62639 27C6.99126 27 6.47639 26.4851 6.47639 25.85V6.15001C6.47639 5.51488 6.99126 5.00001 7.62639 5.00001Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 704 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.3366 5.18683L13.2306 15.2929C12.84 15.6834 12.84 16.3166 13.2306 16.7071L23.3366 26.8132C23.7857 27.2623 24.5139 27.2623 24.963 26.8132C25.4121 26.3641 25.4121 25.6359 24.963 25.1868L15.7762 16L24.963 6.81318C25.4121 6.36408 25.4121 5.63594 24.963 5.18683C24.5139 4.73773 23.7857 4.73773 23.3366 5.18683ZM7.62639 5.00001C8.26152 5.00001 8.77639 5.51488 8.77639 6.15001V25.85C8.77639 26.4851 8.26152 27 7.62639 27C6.99126 27 6.47639 26.4851 6.47639 25.85V6.15001C6.47639 5.51488 6.99126 5.00001 7.62639 5.00001Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 705 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.43973 5.18683L18.5458 15.2929C18.9363 15.6834 18.9363 16.3166 18.5458 16.7071L8.43973 26.8132C7.99063 27.2623 7.26249 27.2623 6.81339 26.8132C6.36429 26.3641 6.36429 25.6359 6.81339 25.1868L16.0002 16L6.81339 6.81318C6.36429 6.36408 6.36429 5.63594 6.81339 5.18683C7.26249 4.73773 7.99063 4.73773 8.43973 5.18683ZM24.15 5.00001C23.5148 5.00001 23 5.51488 23 6.15001V25.85C23 26.4851 23.5148 27 24.15 27C24.7851 27 25.3 26.4851 25.3 25.85V6.15001C25.3 5.51488 24.7851 5.00001 24.15 5.00001Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 682 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last_disbale.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.43973 5.18683L18.5458 15.2929C18.9363 15.6834 18.9363 16.3166 18.5458 16.7071L8.43973 26.8132C7.99063 27.2623 7.26249 27.2623 6.81339 26.8132C6.36429 26.3641 6.36429 25.6359 6.81339 25.1868L16.0002 16L6.81339 6.81318C6.36429 6.36408 6.36429 5.63594 6.81339 5.18683C7.26249 4.73773 7.99063 4.73773 8.43973 5.18683ZM24.15 5.00001C23.5148 5.00001 23 5.51488 23 6.15001V25.85C23 26.4851 23.5148 27 24.15 27C24.7851 27 25.3 26.4851 25.3 25.85V6.15001C25.3 5.51488 24.7851 5.00001 24.15 5.00001Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 683 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 28V13H20C18.8954 13 18 12.1045 18 11V4H5L5 28H27ZM20 4.82843L26.1716 11H20V4.82843ZM5 2C3.89543 2 3 2.89543 3 4V28C3 29.1046 3.89543 30 5 30H27C28.1046 30 29 29.1046 29 28V11.8284C29 11.298 28.7893 10.7893 28.4142 10.4142L20.5858 2.58579C20.2107 2.21071 19.702 2 19.1716 2H5ZM15.1257 23.4731H17.9056C18.0038 23.4731 18.0834 23.5635 18.0834 23.6751L18.0834 25.096C18.0834 25.2075 18.0038 25.298 17.9056 25.298H12.8535C12.7553 25.298 12.6756 25.2075 12.6756 25.096V24.0115L15.0422 20.8298C15.4491 20.2669 15.7311 19.8272 15.8882 19.5106C16.0524 19.1851 16.1345 18.8509 16.1345 18.5079C16.1345 18.1297 16.0488 17.8263 15.8775 17.5976C15.7061 17.369 15.4741 17.2546 15.1814 17.2546C14.8816 17.2546 14.6174 17.3909 14.389 17.6636C14.2022 17.8793 14.0512 18.1716 13.936 18.5402C13.8962 18.6675 13.7633 18.7261 13.6626 18.6543L12.7548 18.0069C12.6887 17.9597 12.657 17.8688 12.6798 17.7839C12.8713 17.0712 13.1948 16.521 13.6501 16.1332C14.1356 15.7111 14.696 15.5 15.3313 15.5C15.8311 15.5 16.263 15.6275 16.6271 15.8826C16.9983 16.1288 17.2803 16.4719 17.473 16.9116C17.6729 17.3514 17.7729 17.8527 17.7729 18.4156C17.7729 18.9697 17.6622 19.4886 17.4409 19.9723C17.2267 20.4472 16.8412 21.0673 16.2844 21.8325L15.1257 23.4731ZM7.26472 18.9072C7.14616 18.9826 7 18.8852 7 18.7309V17.3546C7 17.2845 7.03206 17.2193 7.08469 17.1825L9.35585 15.5962C9.38387 15.5766 9.41613 15.5662 9.44903 15.5662H10.6107C10.709 15.5662 10.7886 15.6567 10.7886 15.7683L10.7886 25.096C10.7886 25.2075 10.709 25.298 10.6107 25.298H9.21249C9.11425 25.298 9.03462 25.2075 9.03462 25.096V17.7823L7.26472 18.9072ZM24.6573 21.1992C24.4289 20.8034 24.0969 20.5044 23.6614 20.3021C24.0184 20.0998 24.2861 19.8184 24.4646 19.4578C24.6502 19.0972 24.743 18.6706 24.743 18.1781C24.743 17.6504 24.6395 17.1843 24.4324 16.7797C24.2254 16.3751 23.9327 16.0629 23.5543 15.843C23.1831 15.6143 22.7512 15.5 22.2586 15.5C21.6232 15.5 21.0735 15.6979 20.6095 16.0937C20.1765 16.4548 19.8647 16.969 19.6741 17.6365C19.6496 17.7223 19.6816 17.8152 19.749 17.8628L20.6169 18.4751C20.716 18.545 20.8462 18.4892 20.8887 18.3658C21.0022 18.0366 21.1483 17.7761 21.327 17.5844C21.5554 17.3382 21.8231 17.215 22.1301 17.215C22.4157 17.215 22.6477 17.3162 22.8262 17.5185C23.0046 17.7208 23.0939 17.989 23.0939 18.3232C23.0939 18.6838 22.9832 18.9872 22.7619 19.2335C22.5477 19.471 22.2372 19.5897 21.8303 19.5897H21.5905C21.4923 19.5897 21.4126 19.6802 21.4126 19.7917V20.9708C21.4126 21.0824 21.4923 21.1728 21.5905 21.1728H21.7018C22.8012 21.1728 23.3509 21.617 23.3509 22.5053C23.3509 22.9099 23.2402 23.2265 23.0189 23.4551C22.8047 23.6838 22.537 23.7982 22.2158 23.7982C21.8874 23.7982 21.5911 23.6838 21.327 23.4551C21.1142 23.2639 20.9501 23.0013 20.8346 22.6673C20.7913 22.5422 20.6593 22.4838 20.5588 22.5548L19.645 23.2009C19.5761 23.2496 19.5445 23.3454 19.5718 23.4322C19.7759 24.0807 20.1003 24.5809 20.5453 24.9327C21.0307 25.3109 21.5983 25.5 22.2479 25.5C22.7548 25.5 23.2152 25.3901 23.6293 25.1702C24.0505 24.9415 24.3825 24.6161 24.6252 24.1939C24.8751 23.763 25 23.2485 25 22.6504C25 22.0699 24.8858 21.5862 24.6573 21.1992Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 28V13H20C18.8954 13 18 12.1045 18 11V4H5L5 28H27ZM20 4.82843L26.1716 11H20V4.82843ZM5 2C3.89543 2 3 2.89543 3 4V28C3 29.1046 3.89543 30 5 30H27C28.1046 30 29 29.1046 29 28V11.8284C29 11.298 28.7893 10.7893 28.4142 10.4142L20.5858 2.58579C20.2107 2.21071 19.702 2 19.1716 2H5ZM15.1257 23.4731H17.9056C18.0038 23.4731 18.0834 23.5635 18.0834 23.6751L18.0834 25.096C18.0834 25.2075 18.0038 25.298 17.9056 25.298H12.8535C12.7553 25.298 12.6756 25.2075 12.6756 25.096V24.0115L15.0422 20.8298C15.4491 20.2669 15.7311 19.8272 15.8882 19.5106C16.0524 19.1851 16.1345 18.8509 16.1345 18.5079C16.1345 18.1297 16.0488 17.8263 15.8775 17.5976C15.7061 17.369 15.4741 17.2546 15.1814 17.2546C14.8816 17.2546 14.6174 17.3909 14.389 17.6636C14.2022 17.8793 14.0512 18.1716 13.936 18.5402C13.8962 18.6675 13.7633 18.7261 13.6626 18.6543L12.7548 18.0069C12.6887 17.9597 12.657 17.8688 12.6798 17.7839C12.8713 17.0712 13.1948 16.521 13.6501 16.1332C14.1356 15.7111 14.696 15.5 15.3313 15.5C15.8311 15.5 16.263 15.6275 16.6271 15.8826C16.9983 16.1288 17.2803 16.4719 17.473 16.9116C17.6729 17.3514 17.7729 17.8527 17.7729 18.4156C17.7729 18.9697 17.6622 19.4886 17.4409 19.9723C17.2267 20.4472 16.8412 21.0673 16.2844 21.8325L15.1257 23.4731ZM7.26472 18.9072C7.14616 18.9826 7 18.8852 7 18.7309V17.3546C7 17.2845 7.03206 17.2193 7.08469 17.1825L9.35585 15.5962C9.38387 15.5766 9.41613 15.5662 9.44903 15.5662H10.6107C10.709 15.5662 10.7886 15.6567 10.7886 15.7683L10.7886 25.096C10.7886 25.2075 10.709 25.298 10.6107 25.298H9.21249C9.11425 25.298 9.03462 25.2075 9.03462 25.096V17.7823L7.26472 18.9072ZM24.6573 21.1992C24.4289 20.8034 24.0969 20.5044 23.6614 20.3021C24.0184 20.0998 24.2861 19.8184 24.4646 19.4578C24.6502 19.0972 24.743 18.6706 24.743 18.1781C24.743 17.6504 24.6395 17.1843 24.4324 16.7797C24.2254 16.3751 23.9327 16.0629 23.5543 15.843C23.1831 15.6143 22.7512 15.5 22.2586 15.5C21.6232 15.5 21.0735 15.6979 20.6095 16.0937C20.1765 16.4548 19.8647 16.969 19.6741 17.6365C19.6496 17.7223 19.6816 17.8152 19.749 17.8628L20.6169 18.4751C20.716 18.545 20.8462 18.4892 20.8887 18.3658C21.0022 18.0366 21.1483 17.7761 21.327 17.5844C21.5554 17.3382 21.8231 17.215 22.1301 17.215C22.4157 17.215 22.6477 17.3162 22.8262 17.5185C23.0046 17.7208 23.0939 17.989 23.0939 18.3232C23.0939 18.6838 22.9832 18.9872 22.7619 19.2335C22.5477 19.471 22.2372 19.5897 21.8303 19.5897H21.5905C21.4923 19.5897 21.4126 19.6802 21.4126 19.7917V20.9708C21.4126 21.0824 21.4923 21.1728 21.5905 21.1728H21.7018C22.8012 21.1728 23.3509 21.617 23.3509 22.5053C23.3509 22.9099 23.2402 23.2265 23.0189 23.4551C22.8047 23.6838 22.537 23.7982 22.2158 23.7982C21.8874 23.7982 21.5911 23.6838 21.327 23.4551C21.1142 23.2639 20.9501 23.0013 20.8346 22.6673C20.7913 22.5422 20.6593 22.4838 20.5588 22.5548L19.645 23.2009C19.5761 23.2496 19.5445 23.3454 19.5718 23.4322C19.7759 24.0807 20.1003 24.5809 20.5453 24.9327C21.0307 25.3109 21.5983 25.5 22.2479 25.5C22.7548 25.5 23.2152 25.3901 23.6293 25.1702C24.0505 24.9415 24.3825 24.6161 24.6252 24.1939C24.8751 23.763 25 23.2485 25 22.6504C25 22.0699 24.8858 21.5862 24.6573 21.1992Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.2929 16.7071C23.6834 16.3166 23.6834 15.6834 23.2929 15.2929L13.1868 5.18683C12.7377 4.73773 12.0096 4.73773 11.5605 5.18683C11.1114 5.63593 11.1114 6.36407 11.5605 6.81317L20.7473 16L11.5605 25.1868C11.1114 25.6359 11.1114 26.3641 11.5605 26.8132C12.0096 27.2623 12.7377 27.2623 13.1868 26.8132L23.2929 16.7071Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 506 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.2929 16.7071C23.6834 16.3166 23.6834 15.6834 23.2929 15.2929L13.1868 5.18683C12.7377 4.73773 12.0096 4.73773 11.5605 5.18683C11.1114 5.63593 11.1114 6.36407 11.5605 6.81317L20.7473 16L11.5605 25.1868C11.1114 25.6359 11.1114 26.3641 11.5605 26.8132C12.0096 27.2623 12.7377 27.2623 13.1868 26.8132L23.2929 16.7071Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 507 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.70711 16.7071C8.31658 16.3166 8.31658 15.6834 8.70711 15.2929L18.8132 5.18683C19.2623 4.73773 19.9904 4.73773 20.4395 5.18683C20.8886 5.63593 20.8886 6.36407 20.4395 6.81317L11.2527 16L20.4395 25.1868C20.8886 25.6359 20.8886 26.3641 20.4395 26.8132C19.9904 27.2623 19.2623 27.2623 18.8132 26.8132L8.70711 16.7071Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 506 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.70711 16.7071C8.31658 16.3166 8.31658 15.6834 8.70711 15.2929L18.8132 5.18683C19.2623 4.73773 19.9904 4.73773 20.4395 5.18683C20.8886 5.63593 20.8886 6.36407 20.4395 6.81317L11.2527 16L20.4395 25.1868C20.8886 25.6359 20.8886 26.3641 20.4395 26.8132C19.9904 27.2623 19.2623 27.2623 18.8132 26.8132L8.70711 16.7071Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 507 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H15.3644C14.5119 30.4332 13.736 29.7602 13.0556 29H10V25V23V22H10.0411C10.0139 21.6703 10 21.3368 10 21C10 20.6632 10.0139 20.3297 10.0411 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.2521C29.7329 11.7793 30.4039 12.3871 31 13.0625V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM5 14C5 13.4477 5.44772 13 6 13H10C10.5523 13 11 13.4477 11 14C11 14.5523 10.5523 15 10 15H6C5.44772 15 5 14.5523 5 14ZM21 19V23C21 23.5523 20.5523 24 20 24C19.4477 24 19 23.5523 19 23C19 22.4477 19.4477 22 20 22V20C18.3431 20 17 21.3431 17 23C17 24.6569 18.3431 26 20 26C21.6569 26 23 24.6569 23 23V19V19C23 18.4477 23.4477 18 24 18C24.5523 18 25 18.4477 25 19C25 19.5523 24.5523 20 24 20H24V22H24C25.6569 22 27 20.6569 27 19C27 17.3431 25.6569 16 24 16C22.3431 16 21 17.3431 21 19V19ZM30 21C30 25.4183 26.4183 29 22 29C17.5817 29 14 25.4183 14 21C14 16.5817 17.5817 13 22 13C26.4183 13 30 16.5817 30 21ZM32 21C32 26.5228 27.5228 31 22 31C16.4772 31 12 26.5228 12 21C12 15.4772 16.4772 11 22 11C27.5228 11 32 15.4772 32 21Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H15.3644C14.5119 30.4332 13.736 29.7602 13.0556 29H10V25V23V22H10.0411C10.0139 21.6703 10 21.3368 10 21C10 20.6632 10.0139 20.3297 10.0411 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.2521C29.7329 11.7793 30.4039 12.3871 31 13.0625V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM5 14C5 13.4477 5.44772 13 6 13H10C10.5523 13 11 13.4477 11 14C11 14.5523 10.5523 15 10 15H6C5.44772 15 5 14.5523 5 14ZM21 19V23C21 23.5523 20.5523 24 20 24C19.4477 24 19 23.5523 19 23C19 22.4477 19.4477 22 20 22V20C18.3431 20 17 21.3431 17 23C17 24.6569 18.3431 26 20 26C21.6569 26 23 24.6569 23 23V19V19C23 18.4477 23.4477 18 24 18C24.5523 18 25 18.4477 25 19C25 19.5523 24.5523 20 24 20H24V22H24C25.6569 22 27 20.6569 27 19C27 17.3431 25.6569 16 24 16C22.3431 16 21 17.3431 21 19V19ZM30 21C30 25.4183 26.4183 29 22 29C17.5817 29 14 25.4183 14 21C14 16.5817 17.5817 13 22 13C26.4183 13 30 16.5817 30 21ZM32 21C32 26.5228 27.5228 31 22 31C16.4772 31 12 26.5228 12 21C12 15.4772 16.4772 11 22 11C27.5228 11 32 15.4772 32 21Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf.svg

@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00006 26H3.00006C1.8955 26 1.00006 25.1046 1.00006 24L1 10C0.999995 8.89544 1.89543 8 3 8L8.00006 8L8.00005 3.00001C8.00005 1.89544 8.89548 1 10.0001 1L22.0001 1C23.1046 1 24.0001 1.89543 24.0001 3V8L29.0001 8C30.1046 8 31.0001 8.89543 31 10L31 24C31 25.1046 30.1046 26 29 26H24.0001V30C24.0001 31.1046 23.1046 32 22.0001 32H10C8.89545 32 8.00001 31.1045 8.00003 30L8.00006 26ZM8.00006 24C8.00004 22.8954 8.00006 22 8.00006 22H24.0001C24.0001 22 24.0001 22.8954 24.0001 24H29.0001V9.99996H3.00004V24H8.00006ZM10 3V8H22.0001V3H10ZM10 24V30H22.0001V24H10Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 13C5 12.4477 5.44771 12 6 12H8.50021C9.88092 12 11.0002 13.1193 11.0002 14.5C11.0002 15.8807 9.88092 17 8.50021 17H6.5V19.25C6.5 19.6642 6.16422 20 5.75 20C5.33579 20 5 19.6642 5 19.25V17L5 13ZM6.50022 13.5H8.50021C9.0525 13.5 9.50021 13.9477 9.50021 14.5C9.50021 15.0523 9.0525 15.5 8.50021 15.5H6.50022V13.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0833 12C13.4832 12 12.9975 12.49 13 13.0928L13.0244 18.9204C13.0269 19.5174 13.5093 20 14.1036 20H15.518C17.7172 20 19.5 18.2091 19.5 16C19.5 13.7909 17.7172 12 15.518 12H14.0833ZM15.518 13.5H14.5225V18.5H15.518C16.8925 18.5 18.0028 17.3807 18.0028 16C18.0028 14.6193 16.8925 13.5 15.518 13.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5 12.75C21.5 12.3358 21.8358 12 22.25 12H26.25C26.6642 12 27 12.3358 27 12.75C27 13.1642 26.6642 13.5 26.25 13.5H23L23 15.5H26.25C26.6642 15.5 27 15.8358 27 16.25C27 16.6642 26.6642 17 26.25 17H23L23 19.25C23 19.6642 22.6642 20 22.25 20C21.8358 20 21.5 19.6642 21.5 19.25V16.25V12.75Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf_disable.svg

@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00006 26H3.00006C1.8955 26 1.00006 25.1046 1.00006 24L1 10C0.999995 8.89544 1.89543 8 3 8L8.00006 8L8.00005 3.00001C8.00005 1.89544 8.89548 1 10.0001 1L22.0001 1C23.1046 1 24.0001 1.89543 24.0001 3V8L29.0001 8C30.1046 8 31.0001 8.89543 31 10L31 24C31 25.1046 30.1046 26 29 26H24.0001V30C24.0001 31.1046 23.1046 32 22.0001 32H10C8.89545 32 8.00001 31.1045 8.00003 30L8.00006 26ZM8.00006 24C8.00004 22.8954 8.00006 22 8.00006 22H24.0001C24.0001 22 24.0001 22.8954 24.0001 24H29.0001V9.99996H3.00004V24H8.00006ZM10 3V8H22.0001V3H10ZM10 24V30H22.0001V24H10Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 13C5 12.4477 5.44771 12 6 12H8.50021C9.88092 12 11.0002 13.1193 11.0002 14.5C11.0002 15.8807 9.88092 17 8.50021 17H6.5V19.25C6.5 19.6642 6.16422 20 5.75 20C5.33579 20 5 19.6642 5 19.25V17L5 13ZM6.50022 13.5H8.50021C9.0525 13.5 9.50021 13.9477 9.50021 14.5C9.50021 15.0523 9.0525 15.5 8.50021 15.5H6.50022V13.5Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0833 12C13.4832 12 12.9975 12.49 13 13.0928L13.0244 18.9204C13.0269 19.5174 13.5093 20 14.1036 20H15.518C17.7172 20 19.5 18.2091 19.5 16C19.5 13.7909 17.7172 12 15.518 12H14.0833ZM15.518 13.5H14.5225V18.5H15.518C16.8925 18.5 18.0028 17.3807 18.0028 16C18.0028 14.6193 16.8925 13.5 15.518 13.5Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5 12.75C21.5 12.3358 21.8358 12 22.25 12H26.25C26.6642 12 27 12.3358 27 12.75C27 13.1642 26.6642 13.5 26.25 13.5H23L23 15.5H26.25C26.6642 15.5 27 15.8358 27 16.25C27 16.6642 26.6642 17 26.25 17H23L23 19.25C23 19.6642 22.6642 20 22.25 20C21.8358 20 21.5 19.6642 21.5 19.25V16.25V12.75Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5532_17947)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H18.411C17.3151 30.4963 16.3163 29.8177 15.4501 29H10V25V23V22H12.0448C12.0152 21.6706 12 21.3371 12 21C12 20.6629 12.0152 20.3294 12.0448 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.7789C29.7316 12.2559 30.4029 12.8176 31 13.4501V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM23 27C26.3137 27 29 24.3137 29 21C29 17.6863 26.3137 15 23 15C19.6863 15 17 17.6863 17 21C17 24.3137 19.6863 27 23 27ZM23 29C24.187 29 25.3135 28.7415 26.3265 28.2777C26.3933 28.2472 26.4596 28.2157 26.5253 28.1834C26.7922 28.0522 27.0506 27.9066 27.2997 27.7475C27.3132 27.7716 27.3279 27.7953 27.3436 27.8185C27.3487 27.8259 27.3538 27.8333 27.3591 27.8406C27.3903 27.884 27.4254 27.9254 27.4645 27.9645L30.2929 30.7929C30.6834 31.1834 31.3166 31.1834 31.7071 30.7929C32.0976 30.4024 32.0976 29.7692 31.7071 29.3787L28.8787 26.5502C28.8585 26.5301 28.8377 26.5109 28.8163 26.4928C29.0066 26.2913 29.1867 26.0799 29.3555 25.8595L29.3903 25.8137C30.4008 24.4743 31 22.8071 31 21C31 16.5817 27.4183 13 23 13C18.5817 13 15 16.5817 15 21C15 25.4183 18.5817 29 23 29ZM8 14C8 13.4477 8.44772 13 9 13H15C15.5523 13 16 13.4477 16 14C16 14.5523 15.5523 15 15 15H9C8.44772 15 8 14.5523 8 14Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5532_17947">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_170304)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H18.411C17.3151 30.4963 16.3163 29.8177 15.4501 29H10V25V23V22H12.0448C12.0152 21.6706 12 21.3371 12 21C12 20.6629 12.0152 20.3294 12.0448 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.7789C29.7316 12.2559 30.4029 12.8176 31 13.4501V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM23 27C26.3137 27 29 24.3137 29 21C29 17.6863 26.3137 15 23 15C19.6863 15 17 17.6863 17 21C17 24.3137 19.6863 27 23 27ZM23 29C24.187 29 25.3135 28.7415 26.3265 28.2777C26.3933 28.2472 26.4596 28.2157 26.5253 28.1834C26.7922 28.0522 27.0506 27.9066 27.2997 27.7475C27.3132 27.7716 27.3279 27.7953 27.3436 27.8185C27.3487 27.8259 27.3538 27.8333 27.3591 27.8406C27.3903 27.884 27.4254 27.9254 27.4645 27.9645L30.2929 30.7929C30.6834 31.1834 31.3166 31.1834 31.7071 30.7929C32.0976 30.4024 32.0976 29.7692 31.7071 29.3787L28.8787 26.5502C28.8585 26.5301 28.8377 26.5109 28.8163 26.4928C29.0066 26.2913 29.1867 26.0799 29.3555 25.8595L29.3903 25.8137C30.4008 24.4743 31 22.8071 31 21C31 16.5817 27.4183 13 23 13C18.5817 13 15 16.5817 15 21C15 25.4183 18.5817 29 23 29ZM8 14C8 13.4477 8.44772 13 9 13H15C15.5523 13 16 13.4477 16 14C16 14.5523 15.5523 15 15 15H9C8.44772 15 8 14.5523 8 14Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_170304">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5516_63052)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.534 0.170568C12.7914 -0.0568564 13.2086 -0.056856 13.4659 0.170569L17.8057 4.00585C18.2208 4.37272 17.9268 5 17.3397 5L14 5V15H27V11.6603C27 11.0732 27.6273 10.7792 27.9941 11.1943L31.8294 15.534C32.0569 15.7914 32.0569 16.2086 31.8294 16.466L27.9941 20.8057C27.6273 21.2208 27 20.9268 27 20.3397V17H14V27H17.3397C17.9268 27 18.2208 27.6273 17.8057 27.9941L13.466 31.8294C13.2086 32.0569 12.7914 32.0569 12.534 31.8294L8.19432 27.9941C7.77921 27.6273 8.07321 27 8.66028 27H12V17H5L5 20.3397C5 20.9268 4.37272 21.2208 4.00585 20.8057L0.170568 16.466C-0.0568565 16.2086 -0.056856 15.7914 0.170569 15.534L4.00585 11.1943C4.37272 10.7792 5 11.0732 5 11.6603V15H12V5L8.66027 5C8.07321 5 7.77921 4.37272 8.19432 4.00585L12.534 0.170568Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5516_63052">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_170338)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.534 0.170568C12.7914 -0.0568564 13.2086 -0.056856 13.4659 0.170569L17.8057 4.00585C18.2208 4.37272 17.9268 5 17.3397 5L14 5V15H27V11.6603C27 11.0732 27.6273 10.7792 27.9941 11.1943L31.8294 15.534C32.0569 15.7914 32.0569 16.2086 31.8294 16.466L27.9941 20.8057C27.6273 21.2208 27 20.9268 27 20.3397V17H14V27H17.3397C17.9268 27 18.2208 27.6273 17.8057 27.9941L13.466 31.8294C13.2086 32.0569 12.7914 32.0569 12.534 31.8294L8.19432 27.9941C7.77921 27.6273 8.07321 27 8.66028 27H12V17H5L5 20.3397C5 20.9268 4.37272 21.2208 4.00585 20.8057L0.170568 16.466C-0.0568565 16.2086 -0.056856 15.7914 0.170569 15.534L4.00585 11.1943C4.37272 10.7792 5 11.0732 5 11.6603V15H12V5L8.66027 5C8.07321 5 7.77921 4.37272 8.19432 4.00585L12.534 0.170568Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_170338">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.2937 11.7929L5.50076 4L12.1643 4C12.7165 4 13.1643 3.55228 13.1643 3C13.1643 2.44771 12.7165 2 12.1643 2H3.00015C2.93001 2 2.86156 2.00722 2.79549 2.02096C2.34129 2.11535 2 2.51784 2 3.00003L2 12.1641C2 12.7164 2.44772 13.1641 3 13.1641C3.55229 13.1641 4 12.7164 4 12.1641L4 5.32756L11.8795 13.2071C12.27 13.5976 12.9031 13.5976 13.2937 13.2071C13.6842 12.8166 13.6842 12.1835 13.2937 11.7929ZM27.9992 26.5848L20.1216 18.7071C19.731 18.3166 19.0979 18.3166 18.7074 18.7071C18.3169 19.0976 18.3169 19.7307 18.7074 20.1212L26.586 27.9999H19.8359C19.2836 27.9999 18.8359 28.4476 18.8359 28.9999C18.8359 29.5522 19.2836 29.9999 19.8359 29.9999L28.9855 29.9999L28.9992 30C29.0371 30 29.0745 29.9979 29.1113 29.9937C29.6112 29.9384 30 29.5145 30 28.9999C30 28.9861 29.9997 28.9725 29.9992 28.9589L29.9992 19.8358C29.9992 19.2836 29.5515 18.8358 28.9992 18.8358C28.4469 18.8359 27.9992 19.2836 27.9992 19.8359L27.9992 26.5848ZM13.5954 19.9047L5.50011 28H12.1643C12.7165 28 13.1643 28.4477 13.1643 29C13.1643 29.5522 12.7165 30 12.1643 30L3.00016 30C2.94838 30 2.89752 29.996 2.84787 29.9884C2.83131 29.9859 2.81489 29.983 2.79862 29.9797C2.34286 29.8865 2 29.4832 2 28.9999L2 19.8358C2 19.2835 2.44771 18.8358 3 18.8358C3.55228 18.8358 4 19.2835 4 19.8358L4 26.6717L12.1813 18.4905C12.5718 18.1 13.2049 18.1 13.5955 18.4905C13.986 18.881 13.986 19.5142 13.5954 19.9047ZM29 2C29.0658 2 29.1302 2.00636 29.1924 2.0185C29.6527 2.10815 30.0001 2.51352 30.0001 3.00003V12.1641C30.0001 12.7164 29.5524 13.1641 29.0001 13.1641C28.4479 13.1641 28.0001 12.7164 28.0001 12.1641V5.32816L20.1211 13.2071C19.7306 13.5976 19.0975 13.5976 18.7069 13.2071C18.3164 12.8166 18.3164 12.1835 18.7069 11.793L26.5 4L19.8359 4C19.2836 4 18.8359 3.55229 18.8359 3C18.8359 2.44772 19.2836 2 19.8359 2L29 2Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.2937 11.7929L5.50076 4L12.1643 4C12.7165 4 13.1643 3.55228 13.1643 3C13.1643 2.44771 12.7165 2 12.1643 2H3.00015C2.93001 2 2.86156 2.00722 2.79549 2.02096C2.34129 2.11535 2 2.51784 2 3.00003L2 12.1641C2 12.7164 2.44772 13.1641 3 13.1641C3.55229 13.1641 4 12.7164 4 12.1641L4 5.32756L11.8795 13.2071C12.27 13.5976 12.9031 13.5976 13.2937 13.2071C13.6842 12.8166 13.6842 12.1835 13.2937 11.7929ZM27.9992 26.5848L20.1216 18.7071C19.731 18.3166 19.0979 18.3166 18.7074 18.7071C18.3169 19.0976 18.3169 19.7307 18.7074 20.1212L26.586 27.9999H19.8359C19.2836 27.9999 18.8359 28.4476 18.8359 28.9999C18.8359 29.5522 19.2836 29.9999 19.8359 29.9999L28.9855 29.9999L28.9992 30C29.0371 30 29.0745 29.9979 29.1113 29.9937C29.6112 29.9384 30 29.5145 30 28.9999C30 28.9861 29.9997 28.9725 29.9992 28.9589L29.9992 19.8358C29.9992 19.2836 29.5515 18.8358 28.9992 18.8358C28.4469 18.8359 27.9992 19.2836 27.9992 19.8359L27.9992 26.5848ZM13.5954 19.9047L5.50011 28H12.1643C12.7165 28 13.1643 28.4477 13.1643 29C13.1643 29.5522 12.7165 30 12.1643 30L3.00016 30C2.94838 30 2.89752 29.996 2.84787 29.9884C2.83131 29.9859 2.81489 29.983 2.79862 29.9797C2.34286 29.8865 2 29.4832 2 28.9999L2 19.8358C2 19.2835 2.44771 18.8358 3 18.8358C3.55228 18.8358 4 19.2835 4 19.8358L4 26.6717L12.1813 18.4905C12.5718 18.1 13.2049 18.1 13.5955 18.4905C13.986 18.881 13.986 19.5142 13.5954 19.9047ZM29 2C29.0658 2 29.1302 2.00636 29.1924 2.0185C29.6527 2.10815 30.0001 2.51352 30.0001 3.00003V12.1641C30.0001 12.7164 29.5524 13.1641 29.0001 13.1641C28.4479 13.1641 28.0001 12.7164 28.0001 12.1641V5.32816L20.1211 13.2071C19.7306 13.5976 19.0975 13.5976 18.7069 13.2071C18.3164 12.8166 18.3164 12.1835 18.7069 11.793L26.5 4L19.8359 4C19.2836 4 18.8359 3.55229 18.8359 3C18.8359 2.44772 19.2836 2 19.8359 2L29 2Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

14
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -179,7 +179,12 @@
"reportFit": "toolbar/reportFit.svg",
"mobileAttr": "toolbar/mobileAttr.svg",
"watermark": "toolbar/watermark.svg",
"dataVerify": "toolbar/dataVerify.svg",
"clearStash": "toolbar/clearStash.svg",
"print": "toolbar/print.svg",
"printPdf": "toolbar/printPdf.svg",
"printApplet": "toolbar/printApplet.svg",
"printPreview": "toolbar/printPreview.svg",
"pageSetup": "toolbar/pageSetup.svg",
"reportHeader": "toolbar/reportHeader.svg",
"reportFooter": "toolbar/reportFooter.svg",
@ -215,6 +220,15 @@
"workOrderCenter": "toolbar/workOrderCenter.svg",
"actCenter": "toolbar/actCenter.svg",
"sign": "toolbar/sign.svg",
"page_first": "toolbar/page_first.svg",
"page_next": "toolbar/page_next.svg",
"page_previous": "toolbar/page_previous.svg",
"page_last": "toolbar/page_last.svg",
"page_navi": "toolbar/page_navi.svg",
"email": "toolbar/email.svg",
"scale": "toolbar/scale.svg",
"printerOffset": "toolbar/printerOffset.svg",
"customButton": "toolbar/customButton.svg",
"cellelement_small": "cellelement.svg",
"forbid": "expand/forbid.svg",
"horizontal_expand": "expand/horizontal.svg",

4
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -399,6 +399,7 @@ Label.tipColor = @BrandTipColor
Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000
Label.warningColor = #F1393C
#---- HelpButton ----
@ -1305,6 +1306,9 @@ CellOtherSetPane.height=$Component.defaultHeight
[style]Label.tipLabel = \
foreground: $Label.tipColor
[style]Label.warningTipLabel = \
foreground: $Label.warningColor
[style]Button.plainButton = \
border: null; \
background: null; \

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -9,7 +9,7 @@ com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*20
com.fr.design.actions.server.dialog=700*630
com.fr.design.actions.server.dialog=660*600
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
@ -22,7 +22,7 @@ com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.report.WatermarkSettingPane=660*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
com.fr.design.formula.FormulaPane=900*600
com.fr.design.formula.FormulaPaneWhenReserveFormula=900*600

26
designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java

@ -12,7 +12,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.write.submit.DBManipulationPane;
import com.fr.form.event.Listener;
import com.fr.js.JavaScript;
@ -23,8 +22,6 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
@ -32,6 +29,11 @@ import java.util.Arrays;
import java.util.List;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class ListenerEditPane extends BasicBeanPane<Listener> {
private UITextField nameText;
private UIComboBox styleBox;
@ -66,10 +68,10 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
public void initComponents(String[] defaultArgs) {
cards = new ArrayList<>();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
nameText = new UITextField(8);
nameText.setEditable(false);
namePane.add(nameText, BorderLayout.WEST);
final List<String> style = new ArrayList<>(Arrays.asList(JS, DBCOMMIT, CUSTOMACTION, EMAIL, MOBILEPOPUP));
styleBox = new UIComboBox(style.toArray());
boolean workbook = DesignerContext.getDesignerFrame().getSelectedJTemplate().isJWorkBook();
@ -77,15 +79,13 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
style.add(EXPORT);
}
styleBox = new UIComboBox(style.toArray());
namePane.add(styleBox);
namePane = GUICoreUtils.createFlowPane(new Component[]{
new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"),
nameText,
new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"),
styleBox},
FlowLayout.LEFT);
namePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Event_Name_Type")));
this.add(namePane, BorderLayout.NORTH);
JPanel eventName = row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name"))), cell(nameText)).getComponent();
JPanel eventType = row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Type"))), cell(styleBox)).getComponent();
namePane = row(cell(eventName).weight(0.3), cell(eventType).weight(0.4), flex(0.3)).getComponent();
this.add(wrapComponentWithTitle(namePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name_Type")), BorderLayout.NORTH);
card = new CardLayout();
hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane();
hyperlinkPane.setLayout(card);

99
designer-realize/src/main/java/com/fr/design/report/ExcelExportPane.java

@ -1,6 +1,9 @@
package com.fr.design.report;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIRadioButton;
@ -14,14 +17,18 @@ import com.fr.io.attr.ExcelExportAttr;
import com.fr.stable.StringUtils;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class ExcelExportPane extends BasicPane {
private UICheckBox isExportHidedRow;
private UICheckBox isExportHidenColumn;
@ -48,81 +55,52 @@ public class ExcelExportPane extends BasicPane {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane("Excel" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export"));
JPanel outNorthPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Setting"));
outNorthPane.setPreferredSize(new Dimension(580, 85));
this.add(outPane);
outPane.add(outNorthPane);
this.setLayout(new BorderLayout());
isExportHidedRow = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Export_Hided_Row"));
isExportHidedRow.setSelected(false);
outNorthPane.add(isExportHidedRow);
isExportHidenColumn = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Export_Hided_Column"));
isExportHidenColumn.setSelected(false);
outNorthPane.add(isExportHidenColumn);
// 内容保护
JPanel outSouthPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"));
outSouthPane.setPreferredSize(new Dimension(580, 280));
outPane.add(outSouthPane);
JPanel exportSettingPane = column(LayoutConstants.VERTICAL_GAP, row(cell(isExportHidedRow)), row(cell(isExportHidenColumn))).getComponent();
// 文件保护
fileProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_File_Protect"), false);
outSouthPane.add(fileProtect);
// 文件密码和密码框
passwordWritePane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
JPanel passwordWriteFlowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
UILabel filePassword = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Password"));
passwordWriteFlowPane.add(filePassword);
passwordField = new UITextField(11);
passwordWriteFlowPane.add(passwordField);
passwordWritePane.add(passwordWriteFlowPane);
fileProtect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (fileProtect.isSelected()) {
passwordWritePane.setVisible(true);
} else {
passwordWritePane.setVisible(false);
passwordWritePane.setVisible(fileProtect.isSelected());
}
}
});
outSouthPane.add(passwordWritePane);
passwordWritePane.add(row(cell(filePassword), fix(5), cell(passwordField))
.with(it->it.setBorder(new ScaledEmptyBorder(0,20,0,0))).getComponent());
// 编辑保护
writeProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_Write_Protect"), false);
outSouthPane.add(writeProtect);
// 编辑保护勾选后展示的内容
writeProtectPane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
outSouthPane.add(writeProtectPane);
// 工作表密码
workbookPassword = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Password"), true);
JPanel protectedWordPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
protectedField = new UITextField(11);
protectedWordPane.add(workbookPassword);
protectedWordPane.add(protectedField);
// 仅限预览
onlyForPreview = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Export_Only_For_Preview"));
JPanel onlyForPreviewPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
onlyForPreviewPane.add(onlyForPreview);
wrapButtonsInButtonGroup(workbookPassword, onlyForPreview);
writeProtectPane.add(protectedWordPane);
writeProtectPane.add(onlyForPreviewPane);
writeProtectPane.add(column(LayoutConstants.VERTICAL_GAP,
row(cell(workbookPassword), fix(5), cell(protectedField)),
row(cell(onlyForPreview))
).with(it-> it.setBorder(new ScaledEmptyBorder(0,20,0,0) )).getComponent());
writeProtect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (writeProtect.isSelected()) {
writeProtectPane.setVisible(true);
} else {
writeProtectPane.setVisible(false);
}
writeProtectPane.setVisible(writeProtect.isSelected());
}
});
// 导出水印
exportWaterMark = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark"), false);
outSouthPane.add(exportWaterMark);
JPanel tips = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(5, 5, 0);
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark_Tips"));
uiLabel.setForeground(Color.GRAY);
FineUIStyle.setStyle(uiLabel, FineUIStyle.LABEL_TIP);
ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark_Use"), UIConstants.FLESH_BLUE);
actionLabel.addActionListener(new ActionListener() {
@Override
@ -133,10 +111,31 @@ public class ExcelExportPane extends BasicPane {
exportWaterMark.setSelected(true);
}
});
tips.add(uiLabel);
tips.add(actionLabel);
outSouthPane.add(tips);
//内容保护
JPanel contextProtectPane = column(LayoutConstants.VERTICAL_GAP,
cell(fileProtect),
cell(passwordWritePane),
cell(writeProtect),
cell(writeProtectPane),
cell(exportWaterMark),
row(cell(uiLabel), cell(actionLabel))
).getComponent();
JPanel centerPanel = column(LayoutConstants.VERTICAL_GAP,
row(20,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Setting"))),
cell(exportSettingPane).weight(1)
),
row(20,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"))),
cell(contextProtectPane).weight(1)
)
).getComponent();
this.add(wrapComponentWithTitle(centerPanel, "Excel" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")));
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).with(it-> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
@Override

23
designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java

@ -1,17 +1,18 @@
package com.fr.design.report;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CustomConfig;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.LocaleLinkProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.io.attr.ReportExportAttr;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 通用
@ -38,17 +39,15 @@ public class ExportUniversalPane extends BasicPane {
private UICheckBox passwordSupportFormula;
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 passwordSupportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
this.setLayout(new BorderLayout());
passwordSupportFormula = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Password_Support_Formula"));
passwordSupportFormula.setSelected(false);
passwordSupportPane.add(passwordSupportFormula);
northPane.add(passwordSupportPane);
outerNorthPane.add(northPane);
this.add(outerNorthPane);
this.add(
FineUIUtils.wrapComponentWithTitle((column(10,
cell(passwordSupportFormula)
).getComponent()),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")));
}
@Override

78
designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java

@ -1,23 +1,26 @@
package com.fr.design.report;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.extension.FileExtension;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton;
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.io.attr.ImageExportAttr;
import com.fr.io.attr.ReportExportAttr;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* 导出图片配置
@ -49,40 +52,37 @@ public class ImageExportPane extends AbstractExportPane {
public static final String GLOBAL_CONF = Toolkit.i18nText("Fine-Design_Image_Export_Setting");
public ImageExportPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel globalTitlePane = FRGUIPaneFactory.createTitledBorderPane(GLOBAL_CONF);
JPanel outNorthPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Setting"));
outNorthPane.setPreferredSize(new Dimension(580, 230));
this.setLayout(new BorderLayout());
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"));
tipLabel.setForeground(Color.GRAY);
JPanel tipsTitlePane = new JPanel();
tipsTitlePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
tipsTitlePane.setLayout(FRGUIPaneFactory.createBorderLayout());
tipsTitlePane.add(tipLabel);
this.add(globalTitlePane);
globalTitlePane.add(outNorthPane);
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
initGlobalSettings();
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JComponent[][] comps = {
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":"), this.globalResolutionBtnS, this.globalResolutionBtnM, this.globalResolutionBtnL},
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":"), this.globalFormatJpg, null, this.globalFormatPng},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.globalRenderQuality, null, this.globalRenderSpeed},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":"), this.templateThumbnail, null, this.templatePaging}
};
centerPane.add(
TableLayoutHelper.createCommonTableLayoutPane(
comps,
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
GAP),
BorderLayout.CENTER);
centerPane.add(tipsTitlePane,BorderLayout.SOUTH);
outNorthPane.add(centerPane, BorderLayout.CENTER);
Component centerPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":")).weight(0.4),
cell(this.globalResolutionBtnS).weight(0.4),
cell(this.globalResolutionBtnM).weight(0.4),
cell(this.globalResolutionBtnL).weight(0.4),
flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":")).weight(0.4),
cell(this.globalFormatJpg).weight(0.8),
cell(this.globalFormatPng).weight(0.4),
flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":")).weight(0.4),
cell(this.globalRenderQuality).weight(0.8),
cell(this.globalRenderSpeed).weight(0.4),
flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":")).weight(0.4),
cell(this.templateThumbnail).weight(0.8),
cell(this.templatePaging).weight(0.4),
flex()),
cell(tipLabel)
).getComponent();
this.add(wrapComponentWithTitle(
row(GAP, cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Setting"))),
cell(centerPane).weight(1)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText(GLOBAL_CONF)));
}
private void initGlobalSettings() {
globalResolutionBtnS = new UIRadioButton("96dpi");
globalResolutionBtnM = new UIRadioButton("192dpi", true);
@ -111,6 +111,10 @@ public class ImageExportPane extends AbstractExportPane {
}
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).with(it-> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
/**
* 展示界面
*/

32
designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java

@ -1,20 +1,23 @@
package com.fr.design.report;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.io.attr.PDFExportAttr;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class PDFExportPane extends BasicPane {
private UICheckBox isNeedPassword;
private UITextField passwordField;
@ -25,20 +28,9 @@ public class PDFExportPane extends BasicPane {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outPane =FRGUIPaneFactory.createTopVerticalTitledBorderPane("PDF" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export"));
this.add(outPane);
// 内容保护
JPanel outNorthPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"));
outNorthPane.setPreferredSize(new Dimension(580, 100));
outPane.add(outNorthPane);
this.setLayout(new BorderLayout());
isNeedPassword = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Password"), false);
JPanel passwordPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
passwordPane.add(isNeedPassword);
passwordWritePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
passwordPane.add(passwordWritePane);
passwordWritePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
passwordField = new UITextField(11);
passwordWritePane.add(passwordField);
isNeedPassword.addActionListener(new ActionListener() {
@ -46,7 +38,11 @@ public class PDFExportPane extends BasicPane {
passwordWritePane.setVisible(isNeedPassword.isSelected());
}
});
outNorthPane.add(passwordPane);
JPanel contextProtectPane = row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"))),
row(cell(isNeedPassword), fix(5), cell(passwordWritePane))
).getComponent();
this.add(wrapComponentWithTitle(contextProtectPane, "PDF" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")));
}
@Override

290
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -19,12 +19,18 @@ import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
import com.fr.design.gui.ispinner.ColumnRowSpinner;
import javax.swing.Icon;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ButtonGroup;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.JFormattedTextField;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.page.PaperSettingProvider;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
@ -59,6 +65,13 @@ import com.fr.stable.unit.INCH;
import com.fr.stable.unit.MM;
import com.fr.design.utils.gui.GUICoreUtils;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* @author richer
* @since 6.5.5 创建于2011-6-14 页面设置面板
@ -74,14 +87,12 @@ public class PageSetupPane extends BasicPane {
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UITabbedPane centerTabbedPane = new UITabbedPane();
this.add(centerTabbedPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
pagePane = new PagePane();
otherPane = new OtherPane();
centerTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"), pagePane);
centerTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), otherPane);
FineTabbedPane tabbedPane = FineTabbedPane.builder().addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"), pagePane)
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), otherPane).build();
this.add(tabbedPane, BorderLayout.CENTER);
}
@Override
@ -149,61 +160,39 @@ public class PageSetupPane extends BasicPane {
private Report report;
public PagePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel defaultPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(defaultPane, BorderLayout.NORTH);
JPanel twoPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
twoPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel orientationPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"));
JPanel innerorientationPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
orientationPane.add(innerorientationPane);
twoPane.add(orientationPane);
JPanel portraitpanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.setLayout(new BorderLayout());
//方向
portraitRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Portrait"));
portraitRadioButton.setMnemonic('t');
portraitpanel.add(portraitRadioButton);
innerorientationPane.add(portraitpanel);
portraitRadioButton.addActionListener(previewListener);
JPanel landscapepanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape"));
innerorientationPane.add(landscapepanel);
landscapeRadioButton.setMnemonic('L');
landscapepanel.add(landscapeRadioButton);
landscapeRadioButton.addActionListener(previewListener);
ButtonGroup layoutButtonGroup = new ButtonGroup();
layoutButtonGroup.add(portraitRadioButton);
layoutButtonGroup.add(landscapeRadioButton);
portraitRadioButton.setSelected(true);
JPanel orientationPane = column(LayoutConstants.VERTICAL_GAP, cell(portraitRadioButton), cell(landscapeRadioButton)).getComponent();
JPanel spp = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
showPagePane = new ShowPagePane();
spp.add(showPagePane);
defaultPane.add(spp);
defaultPane.add(twoPane);
Component spp = wrapComponentWithTitle(
row(cell(showPagePane),
flex()).getComponent(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")
);
// paper size
JPanel paperSizePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Paper_Size"));
JPanel innerpaperSizePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
paperSizePane.add(innerpaperSizePane);
defaultPane.add(paperSizePane);
predefinedRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Predefined") + ":");
predefinedRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Predefined"));
predefinedRadioButton.setMnemonic('P');
predefinedRadioButton.addActionListener(previewListener);
customRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom") + ":");
customRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"));
customRadioButton.setMnemonic('C');
customRadioButton.addActionListener(previewListener);
predefinedComboBox = new UIComboBox();
paperWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0));
((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7);
paperHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0));
@ -214,7 +203,6 @@ public class PageSetupPane extends BasicPane {
txt = ((JSpinner.NumberEditor) paperHeightSpinner.getEditor()).getTextField();
((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false);
unitLabel = new UnitFieldPane.UnitLabel(Constants.UNIT_MM, paperHeightSpinner.getPreferredSize().height);
String[] inch = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH")};
@ -238,35 +226,28 @@ public class PageSetupPane extends BasicPane {
Object[] tmpPaperSizeNameArray = ReportConstants.PaperSizeNameSizeArray[i];
predefinedComboBox.addItem(tmpPaperSizeNameArray[1]);
}
// tow radio buttons.
JPanel radioButtonPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
innerpaperSizePane.add(radioButtonPane);
radioButtonPane.add(predefinedRadioButton);
radioButtonPane.add(predefinedComboBox);
ButtonGroup paperSizeRadioButtonGroup = new ButtonGroup();
paperSizeRadioButtonGroup.add(predefinedRadioButton);
paperSizeRadioButtonGroup.add(customRadioButton);
// size and textfields.
JPanel paperSizeRightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
innerpaperSizePane.add(paperSizeRightPane);
paperSizeRightPane.add(customRadioButton);
paperSizeRightPane.add(paperWidthSpinner);
paperSizeRightPane.add(new UILabel("x"));
paperSizeRightPane.add(paperHeightSpinner);
paperSizeRightPane.add(switchInch);
// tow radio buttons.
JPanel innerPaperSizePane = column(10,
row(10, cell(predefinedRadioButton), cell(predefinedComboBox).weight(0.8), flex()),
row(cell(customRadioButton),
fix(10),
cell(paperWidthSpinner).weight(0.4),
fix(5),
cell(new UILabel("x")),
fix(5),
cell(paperHeightSpinner).weight(0.4),
fix(5),
cell(switchInch).weight(0.4),
flex()
)
).getComponent();
Component paperSizePane = wrapComponentWithTitle(innerPaperSizePane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Paper_Size"));
// peter:设置边距..
JPanel outermarginPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"));
JPanel marginPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_M_Pane();
outermarginPane.add(marginPane);
twoPane.add(outermarginPane);
StringBuffer temp = new StringBuffer();
for (int i = 0; i < 11; i++) {
temp.append("&nbsp");
@ -275,70 +256,50 @@ public class PageSetupPane extends BasicPane {
zeroMarginWarn.setForeground(Color.RED);
// left
JPanel marginLeftPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
marginPane.add(marginLeftPane);
JPanel marginLeftTextPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginLeftPane.add(marginLeftTextPane);
marginLeftTextPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":"));
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginLeftTextPane.add(marginTopUnitFieldPane);
JPanel marginLeftUnitPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginLeftPane.add(marginLeftUnitPane);
marginLeftUnitPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":"));
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginLeftUnitPane.add(marginBottomUnitFieldPane);
// right
JPanel marginRightPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
marginPane.add(marginRightPane);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane))
).getComponent();
// peter:这个一个垂直的上下的字符panel.
JPanel marginRightTextPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginRightPane.add(marginRightTextPane);
marginRightTextPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":"));
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightTextPane.add(marginLeftUnitFieldPane);
JPanel marginRightUnitPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginRightPane.add(marginRightUnitPane);
marginRightUnitPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right") + ":"));
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitPane.add(marginRightUnitFieldPane);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")), cell(marginLeftUnitFieldPane)),
row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right") + ":")), cell(marginRightUnitFieldPane))
).getComponent();
marginTopUnitFieldPane.getTextField().addFocusListener(fa);
marginBottomUnitFieldPane.getTextField().addFocusListener(fa);
marginLeftUnitFieldPane.getTextField().addFocusListener(fa);
marginRightUnitFieldPane.getTextField().addFocusListener(fa);
JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane), cell(zeroMarginWarn)).getComponent();
marginPane.add(zeroMarginWarn);
// header and footer
JPanel outhfHeightPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height"));
JPanel hfHeightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
defaultPane.add(outhfHeightPane);
outhfHeightPane.add(hfHeightPane);
// header height.
JPanel headerHeightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
hfHeightPane.add(headerHeightPane);
headerHeightPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header") + ":"));
//方向-页边距
JPanel twoPane = row(10,
cell(wrapComponentWithTitle(orientationPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25),
cell(wrapComponentWithTitle(marginPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8)
).getComponent();
//高度
headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
headerHeightPane.add(headerUnitFieldPane);
// footer height.
JPanel footerHeightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
hfHeightPane.add(footerHeightPane);
footerHeightPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer") + ":"));
footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
footerHeightPane.add(footerUnitFieldPane);
JPanel hfHeightPane = row(
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header"))), cell(headerUnitFieldPane)),
fix(24),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer"))), cell(footerUnitFieldPane))
).getComponent();
Component heightPane = wrapComponentWithTitle(hfHeightPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height"));
// print gridlines.
JPanel printOptionPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
defaultPane.add(printOptionPane);
printOptionPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
Component defaultPane = column(LayoutConstants.VERTICAL_GAP, cell(spp), cell(twoPane), cell(paperSizePane), cell(heightPane)).getComponent();
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(defaultPane);
workPanel.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(workPanel);
}
@Override
@ -387,11 +348,6 @@ public class PageSetupPane extends BasicPane {
}
};
/**
* Populate
*
* @param reportSettings rpt settings.
*/
public void populate(Report report, int unitType) {
this.report = report;
ReportSettingsProvider reportSettings = report.getReportSettings();
@ -602,13 +558,11 @@ public class PageSetupPane extends BasicPane {
* Create icon radio pane for Portrait and Landscape.
*/
private JPanel createIconRadioPane(Icon icon, UIRadioButton radioButton) {
JPanel iconRadioPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
// iconRadioPane.setLayout(FRGUIPaneFactory.createCenterFlowLayout());
iconRadioPane.add(new UILabel(icon));
iconRadioPane.add(radioButton);
return iconRadioPane;
return column(
cell(new UILabel(icon)),
cell(radioButton)
).getComponent();
}
/**
@ -881,80 +835,76 @@ public class PageSetupPane extends BasicPane {
private UIRadioButton isShrinkToFit4Width;
public OtherPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel defaultPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(defaultPane, BorderLayout.NORTH);
// page order
JPanel outpageOrderPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Order"));
JPanel pageOrderPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
outpageOrderPane.add(pageOrderPane);
defaultPane.add(outpageOrderPane);
this.setLayout(new BorderLayout());
// page order 分页顺序
Icon topBottomIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/down.png");
topBottomRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Top_To_Bottom"),false,false);
pageOrderPane.add(FRGUIPaneFactory.createIconRadio_S_Pane(topBottomIcon, topBottomRadioButton));
topBottomRadioButton.setMnemonic('B');
Icon leftRightIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/over.png");
leftRightRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Left_To_Right"), false, false);
pageOrderPane.add(FRGUIPaneFactory.createIconRadio_S_Pane(leftRightIcon, leftRightRadioButton));
leftRightRadioButton.setMnemonic('R');
ButtonGroup pageOrderButtonGroup = new ButtonGroup();
pageOrderButtonGroup.add(topBottomRadioButton);
pageOrderButtonGroup.add(leftRightRadioButton);
topBottomRadioButton.setSelected(true);
// center on page
JPanel outcenterOnPagePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Placement_Center_On_Page"));
JPanel centerOnPagePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
outcenterOnPagePane.add(centerOnPagePane);
defaultPane.add(outcenterOnPagePane);
JPanel pageOrderPane = row(
cell(new UILabel(topBottomIcon)),
cell(topBottomRadioButton),
fix(20),
cell(new UILabel(leftRightIcon)),
cell(leftRightRadioButton)
).getComponent();
Component outPageOrderPane = wrapComponentWithTitle(pageOrderPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Order"));
// center on page 居中方式
this.horizonalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Horizontally"), false, false);
this.horizonalCenterCheckBox.setMnemonic('H');
this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically"), false, false);
this.verticalCenterCheckBox.setMnemonic('V');
JPanel centerOnPagePane = row(LayoutConstants.HORIZONTAL_GAP,
cell(GUICoreUtils.createFlowPane(horizonalCenterCheckBox, FlowLayout.CENTER)),
cell(GUICoreUtils.createFlowPane(verticalCenterCheckBox, FlowLayout.CENTER))
).getComponent();
Component outCenterOnPagePane = wrapComponentWithTitle(centerOnPagePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Placement_Center_On_Page"));
centerOnPagePane.add(GUICoreUtils.createFlowPane(horizonalCenterCheckBox, FlowLayout.CENTER));
centerOnPagePane.add(GUICoreUtils.createFlowPane(verticalCenterCheckBox, FlowLayout.CENTER));
// first page number.
JPanel firstPaneNumberPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
defaultPane.add(firstPaneNumberPane);
firstPaneNumberPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_First_Page_Number") + ": "));
// first page number. 起始页码
// marks: 这个地方必须为大于零的整数
firstPageNumberSpinner = new UISpinner(1, Integer.MAX_VALUE, 1, 1);
firstPaneNumberPane.add(firstPageNumberSpinner);
defaultPane.add(Box.createVerticalStrut(4));
// print gridlines.
JPanel printOptionPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
defaultPane.add(printOptionPane);
printOptionPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
JPanel firstPaneNumberPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_First_Page_Number"))),
cell(firstPageNumberSpinner)
).getComponent();
JPanel autoShrinkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
autoShrinkPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Shrink_To_Fit_Content")));
// print gridlines. 根据单元格内容自动调整
isShrinkToFit4None = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"));
isShrinkToFit4Height = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Row_Height"));
isShrinkToFit4Width = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Column_Width"));
ButtonGroup bp = new ButtonGroup();
autoShrinkPane.add(isShrinkToFit4None);
autoShrinkPane.add(isShrinkToFit4Height);
autoShrinkPane.add(isShrinkToFit4Width);
bp.add(isShrinkToFit4None);
bp.add(isShrinkToFit4Height);
bp.add(isShrinkToFit4Width);
printOptionPane.add(autoShrinkPane);
JPanel autoShrinkPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Shrink_To_Fit_Content"))),
cell(isShrinkToFit4None),
cell(isShrinkToFit4Height),
cell(isShrinkToFit4Width)
).getComponent();
//整体布局
JPanel defaultPane = column(LayoutConstants.HORIZONTAL_GAP,
cell(outPageOrderPane),
cell(outCenterOnPagePane),
cell(firstPaneNumberPane),
cell(autoShrinkPane)
).getComponent();
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(defaultPane);
workPanel.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(workPanel);
}
@Override

29
designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

@ -1,10 +1,11 @@
package com.fr.design.report;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
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.gui.frpane.FineTabbedPane;
import com.fr.design.i18n.Toolkit;
import com.fr.io.attr.ReportExportAttr;
@ -15,7 +16,8 @@ import java.util.Set;
public class ReportExportAttrPane extends BasicPane {
UITabbedPane uiTabbedPane;
FineTabbedPane uiTabbedPane;
FineTabbedPane.TabPaneBuilder tabPaneBuilder;
private ExcelExportPane excelExportPane;
private PDFExportPane pdfExportPane;
private WordExportPane wordExportPane;
@ -23,31 +25,28 @@ public class ReportExportAttrPane extends BasicPane {
private List<BasicStorePane<?>> 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();
uiTabbedPane.addTab("PDF", pdfExportPane);
wordExportPane = new WordExportPane();
uiTabbedPane.addTab("Word", wordExportPane);
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
tabPaneBuilder = FineTabbedPane.builder()
.addTab(Toolkit.i18nText("Fine-Design_Report_Universal_Export"), exportUniversalPane = new ExportUniversalPane())
.addTab("Excel", excelExportPane = new ExcelExportPane())
.addTab("PDF", pdfExportPane = new PDFExportPane())
.addTab("Word", wordExportPane = new WordExportPane());
Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG);
paneList = new ArrayList<>();
initPane(new ImageExportPane());
for (ExportAttrTabProvider provider : providers) {
BasicStorePane<?> storePane = provider.toServiceComponent();
uiTabbedPane.addTab(storePane.getTitle(), storePane);
tabPaneBuilder.addTab(storePane.getTitle(), storePane);
paneList.add(storePane);
}
uiTabbedPane = tabPaneBuilder.build();
this.add(uiTabbedPane);
}
private void initPane(BasicStorePane<?> exportPane) {
uiTabbedPane.addTab(exportPane.getTitle(), exportPane);
paneList.add(exportPane);
tabPaneBuilder.addTab(new ImageExportPane().getTitle(), new ImageExportPane());
paneList.add(new ImageExportPane());
}
@Override

76
designer-realize/src/main/java/com/fr/design/report/WordExportPane.java

@ -1,6 +1,9 @@
package com.fr.design.report;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIRadioButton;
@ -15,14 +18,19 @@ import com.fr.io.attr.WordExportAttr;
import com.fr.stable.StringUtils;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class WordExportPane extends BasicPane {
private UICheckBox isExportAsTable;
// 编辑保护
@ -43,46 +51,31 @@ public class WordExportPane extends BasicPane {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane("Word" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export"));
JPanel outNorthPane =FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Setting"));
outNorthPane.setPreferredSize(new Dimension(580, 110));
this.add(outPane);
outPane.add(outNorthPane);
this.setLayout(new BorderLayout());
isExportAsTable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Is_Need_Word_Adjust"), false);
MultilineLabel wordLineLabel = new MultilineLabel();
wordLineLabel.setPreferredSize(new Dimension(560, 50));
wordLineLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alert_Word"));
wordLineLabel.setForeground(Color.GRAY);
outNorthPane.add(isExportAsTable);
outNorthPane.add(wordLineLabel);
// 内容保护
JPanel outSouthPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"));
outSouthPane.setPreferredSize(new Dimension(580, 250));
outPane.add(outSouthPane);
JPanel exportSettingPane = new JPanel(new BorderLayout());
exportSettingPane.add(column(LayoutConstants.VERTICAL_GAP, cell(isExportAsTable), cell(wordLineLabel)).getComponent());
// 编辑保护
writeProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_Write_Protect"), false);
outSouthPane.add(writeProtect);
// 编辑保护勾选后展示的内容
writeProtectPane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
outSouthPane.add(writeProtectPane);
// 工作表密码
workbookPassword = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Password"), true);
JPanel protectedWordPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
protectedField = new UITextField(11);
protectedWordPane.add(workbookPassword);
protectedWordPane.add(protectedField);
// 仅限预览
onlyForPreview = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Export_Only_For_Preview"));
JPanel onlyForPreviewPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
onlyForPreviewPane.add(onlyForPreview);
wrapButtonsInButtonGroup(workbookPassword, onlyForPreview);
writeProtectPane.add(protectedWordPane);
writeProtectPane.add(onlyForPreviewPane);
writeProtectPane.add(column(LayoutConstants.VERTICAL_GAP,
row(cell(workbookPassword), fix(5), cell(protectedField)),
row(cell(onlyForPreview))
).with(it-> it.setBorder(new ScaledEmptyBorder(0,20,0,0) )).getComponent());
writeProtect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (writeProtect.isSelected()) {
@ -91,15 +84,11 @@ public class WordExportPane extends BasicPane {
writeProtectPane.setVisible(false);
}
}
});
// 导出水印
exportWaterMark = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark"), false);
outSouthPane.add(exportWaterMark);
JPanel tips = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(5, 5, 0);
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark_Tips"));
uiLabel.setForeground(Color.GRAY);
FineUIStyle.setStyle(uiLabel, FineUIStyle.LABEL_TIP);
ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark_Use"), UIConstants.FLESH_BLUE);
actionLabel.addActionListener(new ActionListener() {
@Override
@ -110,9 +99,24 @@ public class WordExportPane extends BasicPane {
exportWaterMark.setSelected(true);
}
});
tips.add(uiLabel);
tips.add(actionLabel);
outSouthPane.add(tips);
//内容保护
JPanel contextProtectPane = column(10,
cell(writeProtect),
cell(writeProtectPane),
cell(exportWaterMark),
row(cell(uiLabel), cell(actionLabel))
).getComponent();
JPanel centerPanel = column(LayoutConstants.VERTICAL_GAP,
row(20,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Setting"))),
cell(exportSettingPane).weight(1)
),
row(20,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"))),
cell(contextProtectPane).weight(1)
)
).getComponent();
this.add(wrapComponentWithTitle(centerPanel, "Word" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")));
}
@Override
@ -120,6 +124,10 @@ public class WordExportPane extends BasicPane {
return "WordExport";
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).with(it-> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
public void populate(WordExportAttr wordExportAttr) {
if(wordExportAttr == null){
return;

25
designer-realize/src/main/java/com/fr/design/report/mobile/AppFitBrowserPane.java

@ -2,15 +2,18 @@ package com.fr.design.report.mobile;
import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Created by 夏翔 on 2016/5/28.
*/
@ -29,18 +32,17 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setLayout(new BorderLayout());
horizionPane = new MobileRadioGroupPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Horizontal"));
verticalPane = new MobileRadioGroupPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Vertical"));
ActionListener actionListener = getAppPreviewActionListener();
horizionPane.addActionListener(actionListener);
verticalPane.addActionListener(actionListener);
fitOpsPane.add(horizionPane, BorderLayout.NORTH);
fitOpsPane.add(verticalPane, BorderLayout.SOUTH);
borderPane.add(fitOpsPane);
this.add(borderPane);
this.add(
wrapComponentWithTitle((column(10,
row(cell(horizionPane)),
row(cell(verticalPane))
).getComponent()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fit")));
}
public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) {
@ -59,7 +61,6 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
}
horizionPane.populateBean(ob.getHorziontalAttr());
verticalPane.populateBean(ob.getVerticalAttr());
// radioCheckPane.populateBean(ob.isZoom());
appFitPreviewPane.refreshPreview(getCurrentFitOptions());
}
@ -68,8 +69,6 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
public ElementCaseMobileAttr updateBean() {
MobileFitAttrState horizonState = horizionPane.updateBean();
MobileFitAttrState verticalState = verticalPane.updateBean();
// boolean isZoom = radioCheckPane.updateBean();
// return new ElementCaseMobileAttr(horizonState, verticalState, isZoom);
return new ElementCaseMobileAttr(horizonState, verticalState);
}

26
designer-realize/src/main/java/com/fr/design/report/mobile/AppFitPreviewPane.java

@ -1,14 +1,19 @@
package com.fr.design.report.mobile;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import java.awt.BorderLayout;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Created by 夏翔 on 2016/5/28.
*/
@ -44,18 +49,21 @@ public class AppFitPreviewPane extends BasicPane{
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel outnorthPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
this.add(outnorthPane);
this.setLayout(new BorderLayout());
horizontalImageLabel = new UILabel();
horizontalImageLabel.setIcon(cachedHorizonPreviewImage.get(1));
outnorthPane.add(horizontalImageLabel);
verticalImagelabel = new UILabel();
verticalImagelabel.setIcon(cachedVerticalPreviewImage.get(0));
outnorthPane.add(verticalImagelabel);
this.add(
FineUIUtils.wrapComponentWithTitle((column(10,
row(10,
column(cell(horizontalImageLabel)),
column(cell(verticalImagelabel)),
flex()
)).getComponent()),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Preview")));
}
public void refreshPreview(int[] index) {

18
designer-realize/src/main/java/com/fr/design/report/mobile/MobileOthersPane.java

@ -1,15 +1,15 @@
package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Created by plough on 2018/5/31.
@ -27,15 +27,11 @@ public class MobileOthersPane extends BasicBeanPane<ElementCaseMobileAttr> {
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L1, 0, 0));
//其他:页面再现时刷新/允许双击缩放
appearRefreshCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Appear_Refresh"));
contentPane.add(appearRefreshCheckPane, BorderLayout.WEST);
allowDoubleClickOrZoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr_Allow_Zoom"));
contentPane.add(allowDoubleClickOrZoomCheckPane, BorderLayout.CENTER);
borderPane.add(contentPane);
this.add(borderPane);
this.add(wrapComponentWithTitle(row(LayoutConstants.HORIZONTAL_GAP, cell(appearRefreshCheckPane), cell(allowDoubleClickOrZoomCheckPane)).getComponent(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other")));
}
@Override

44
designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java

@ -4,17 +4,19 @@ import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.data.index.Index;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.ButtonGroup;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
/**
* Created by Administrator on 2016/5/16/0016.
*/
@ -27,10 +29,6 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
}
private void initComponents(String title) {
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, p, p, p, p};
IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL);
horizonRadio.setSelected(true);
IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL);
@ -38,19 +36,20 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE);
addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio);
Component[][] components = new Component[][]{
new Component[] {
new UILabel(title),
horizonRadio,
verticalRadio,
bidirectionalRadio,
notFitRadio
}
};
JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10));
this.add(fitOpsPane);
Component row =
row(
cell(new UILabel(title)),
fix(10),
cell(horizonRadio),
fix(5),
cell(verticalRadio),
fix(5),
cell(bidirectionalRadio),
fix(5),
cell(notFitRadio),
flex()
).getComponent();
this.add(row);
}
private void addToButtonGroup(IndexRadioButton... radios) {
@ -81,7 +80,6 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
return radioButtons.get(i).getRadioButtonIndex();
}
}
return 0;
}

28
designer-realize/src/main/java/com/fr/design/report/mobile/MobileToolBarPane.java

@ -1,14 +1,18 @@
package com.fr.design.report.mobile;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Created by 方磊 on 2016/11/8.
@ -25,20 +29,20 @@ public class MobileToolBarPane extends BasicBeanPane<ElementCaseMobileAttr> {
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setLayout(new BorderLayout());
UILabel uiLabel = new UILabel("html5");
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15));
zoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Zoom"));
refreshCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Refresh"));
toobarsPane.add(uiLabel, BorderLayout.WEST);
toobarsPane.add(zoomCheckPane, BorderLayout.CENTER);
toobarsPane.add(refreshCheckPane, BorderLayout.EAST);
borderPane.add(toobarsPane);
this.add(borderPane);
this.add(
FineUIUtils.wrapComponentWithTitle((column(10,
row(cell(uiLabel)),
row(cell(zoomCheckPane)),
row(cell(refreshCheckPane)),
flex()
).getComponent()),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_ToolBar")));
}
@Override

30
designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -1,11 +1,17 @@
package com.fr.design.report.mobile;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* Created by Administrator on 2016/5/12/0012.
@ -23,23 +29,19 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
}
private void initComponents() {
this.setLayout(new BorderLayout());
AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane();
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel jPanel = new JPanel();
jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS));
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
reportMobileTemplateSettingsPane = new ReportMobileTemplateSettingsPane();
jPanel.add(reportMobileTemplateSettingsPane);
appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
jPanel.add(appFitBrowserPane);
jPanel.add(mobileOthersPane = new MobileOthersPane());
jPanel.add(appFitPreviewPane);
UIScrollPane scrollPane = new UIScrollPane(jPanel);
JPanel panel = new JPanel(new BorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP,
cell(reportMobileTemplateSettingsPane),
cell(appFitBrowserPane),
cell(mobileOthersPane = new MobileOthersPane()),
cell(appFitPreviewPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane);
}

58
designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java

@ -1,17 +1,21 @@
package com.fr.design.report.mobile;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Created by plough on 2018/1/8.
@ -25,51 +29,37 @@ public class ReportMobileTemplateSettingsPane extends BasicBeanPane<ElementCaseM
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel contentPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
contentPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L2, 0, 0));
contentPane.add(getMobileCanvasSizeCheckPane(), BorderLayout.CENTER);
borderPane.add(contentPane);
this.add(borderPane);
this.setLayout(new BorderLayout());
this.add(wrapComponentWithTitle(getMobileCanvasSizeCheckPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Settings")));
}
/**
* 模板设置面板
* @return
*/
private JPanel getMobileCanvasSizeCheckPane() {
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
JPanel panel = new JPanel(new BorderLayout());
mobileCanvasSizeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Mobile_Canvas_Size"));
panel.add(mobileCanvasSizeCheck, BorderLayout.NORTH);
panel.add(getCanvasDescPane(), BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
panel.add(column(LayoutConstants.VERTICAL_GAP,
cell(mobileCanvasSizeCheck),
cell(getCanvasDescPane())
).getComponent());
return panel;
}
private JPanel getCanvasDescPane() {
UILabel desc1 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc"));
UILabel desc2 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_In_Desc"));
UILabel desc3 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{desc1, null},
new Component[]{desc2, null},
new Component[]{desc3, null}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L7, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1, 0));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP, cell(desc1), cell(desc2), cell(desc3)).getComponent());
panel.setBorder(new ScaledEmptyBorder(0,20,0,0));
return panel;
}
private UILabel createDescLabel(String desc) {
UILabel label = new UILabel(desc);
label.setForeground(Color.gray);
FineUIStyle.setStyle(label, FineUIStyle.LABEL_TIP);
return label;
}

53
designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java

@ -4,53 +4,48 @@
package com.fr.design.webattr;
import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.editor.editor.LongEditor;
import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class CommonPane extends JPanel {
private UITextField titleTextField;
private LongEditor cacheValidateTimeEditor;
public CommonPane() {
this.initComponents();
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(6, 2, 4, 2));
JPanel northPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(northPane,BorderLayout.NORTH);
this.titleTextField = new UITextField(24);
this.setLayout(new BorderLayout());
this.titleTextField = new UITextField();
this.cacheValidateTimeEditor = new LongEditor();
JComponent[][] comps = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title") + ":"), this.titleTextField, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cache_Validate_Time") + ":"), this.cacheValidateTimeEditor, new UILabel("milliseconds")}
};
this.add(
TableLayoutHelper.createCommonTableLayoutPane(
comps,
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED},
4),
BorderLayout.CENTER);
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(column(LayoutConstants.VERTICAL_GAP,
//标题
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title"))).weight(0.2),
cell(this.titleTextField).weight(0.5),
flex(0.3)
),
//报表缓存有效时间
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cache_Validate_Time"))).weight(0.2),
row(cell(this.cacheValidateTimeEditor).weight(0.7), fix(5), cell(new UILabel("milliseconds")).weight(0.3)).weight(0.4),
flex(0.4)
)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
this.add(workPanel);
}
public void populate(ReportWebAttr reportWebAttr) {

56
designer-realize/src/main/java/com/fr/design/webattr/DragToolBarPane.java

@ -1,5 +1,8 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
@ -7,7 +10,6 @@ import com.fr.form.ui.Widget;
import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.DropMode;
import javax.swing.Icon;
@ -16,18 +18,22 @@ import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.DefaultListCellRenderer;
import javax.swing.SwingUtilities;
import javax.swing.TransferHandler;
import javax.swing.BorderFactory;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* richer:拖拽ToolBar button以实现自定义工具栏.服务器配置那儿的
@ -65,29 +71,45 @@ public class DragToolBarPane extends WidgetToolBarPane {
toolbarButtonList.setDropMode(DropMode.ON_OR_INSERT);
toolbarButtonList.setDragEnabled(true);
toolbarButtonList.setTransferHandler(new FromTransferHandler());
northToolBar = new ToolBarPane();
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
northToolBar.setBackground(Color.lightGray);
southToolBar = new ToolBarPane();
southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
southToolBar.setBackground(Color.lightGray);
toolbarButtonList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
//顶部工具栏
JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northToolBar = new ToolBarPane();
northToolBar.setOpaque(false);
northToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
SettingToolBar top = new SettingToolBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ToolBar_Top"), northToolBar);
top.setOpaque(false);
northContentPane.add(top, BorderLayout.EAST);
northContentPane.add(northToolBar, BorderLayout.CENTER);
northContentPane.setBackground(Color.lightGray);
northContentPane.setBorder(new ScaledEmptyBorder(4,0,4,0));
northContentPane.setOpaque(false);
JPanel topToolbarPanel = new JPanel(new BorderLayout());
topToolbarPanel.add(northContentPane);
topToolbarPanel.setBackground(FineUIUtils.getUIColor("Center.ZoneBorderColor", "defaultBorderColor"));
//底部工具栏
JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
southToolBar = new ToolBarPane();
southToolBar.setOpaque(false);
southToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
SettingToolBar bottom = new SettingToolBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ToolBar_Bottom"), southToolBar);
bottom.setOpaque(false);
southContentPane.add(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER);
southContentPane.setBackground(Color.lightGray);
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
movePane.add(northContentPane, BorderLayout.NORTH);
movePane.add(toolbarButtonList, BorderLayout.CENTER);
movePane.add(southContentPane, BorderLayout.SOUTH);
southContentPane.setBorder(new ScaledEmptyBorder(4,0,4,0));
southContentPane.setOpaque(false);
JPanel bottomToolbarPanel = new JPanel(new BorderLayout());
bottomToolbarPanel.add(southContentPane);
bottomToolbarPanel.setBackground(FineUIUtils.getUIColor("Center.ZoneBorderColor", "defaultBorderColor"));
// SplitPane
//整体工具栏图标面板
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
movePane.add(column(1,
cell(topToolbarPanel),
cell(toolbarButtonList),
cell(bottomToolbarPanel)
).getComponent());
this.add(new JScrollPane(movePane), BorderLayout.CENTER);
JPanel buttonPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
@ -98,7 +120,6 @@ public class DragToolBarPane extends WidgetToolBarPane {
southToolBar.removeButtonList();
southToolBar.repaint();
northToolBar.removeButtonList();
if (defaultToolBar == null) {
return;
}
@ -121,6 +142,7 @@ public class DragToolBarPane extends WidgetToolBarPane {
northToolBar.repaint();
}
});
buttonPane.add(removeButton);
this.add(buttonPane, BorderLayout.SOUTH);
}

30
designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java

@ -7,8 +7,8 @@ import com.fr.base.ConfigManager;
import com.fr.base.print.PrintSettingsAttrMark;
import com.fr.config.PrintConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.webattr.printsettings.GlobalNativePrintSettingPane;
@ -28,7 +28,7 @@ import java.awt.BorderLayout;
*/
public class EditReportServerParameterPane extends LoadingBasicPane {
private UITabbedPane tabbedPane;
private FineTabbedPane tabbedPane;
private PageToolBarPane pagePane;
private ViewToolBarPane viewPane;
@ -54,20 +54,22 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());
//Tabbed Pane
tabbedPane = new UITabbedPane();
defaultPane.add(tabbedPane, BorderLayout.CENTER);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WEB_Pagination_Setting"), pagePane = new PageToolBarPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WEB_Write_Setting"), writePane = new WriteToolBarPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Data_Analysis_Settings"), viewPane = new ViewToolBarPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_Css"), cssPane = new WebCssPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), jsPane = new WebJsPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Error_Handler_Template"), errorTemplatePane = new ErrorTemplatePane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Setting"), printSettingPane = new PrintSettingPane(new GlobalNativePrintSettingPane()));
//服务器-服务器配置
FineTabbedPane.TabPaneBuilder tabPaneBuilder = FineTabbedPane.builder()
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WEB_Pagination_Setting"), pagePane = new PageToolBarPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WEB_Write_Setting"), writePane = new WriteToolBarPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Data_Analysis_Settings"), viewPane = new ViewToolBarPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_Css"), cssPane = new WebCssPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), jsPane = new WebJsPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Error_Handler_Template"), errorTemplatePane = new ErrorTemplatePane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Setting"), printSettingPane = new PrintSettingPane(new GlobalNativePrintSettingPane()));
if (WorkContext.getCurrent().isRoot()) {
tabbedPane.addTab(Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"), serverFitAttrPane = new ServerFitAttrPane());
tabPaneBuilder.addTab(Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"), serverFitAttrPane = new ServerFitAttrPane());
tabbedPane = tabPaneBuilder.withTabLayout(new int[]{4,4}).withHeadRatio(0.8f).build();
} else {
tabbedPane = tabPaneBuilder.withTabLayout(new int[]{3,4}).withHeadRatio(0.8f).build();
}
defaultPane.add(tabbedPane, BorderLayout.CENTER);
}
@Override

237
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -1,9 +1,14 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -20,13 +25,10 @@ import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.javascript.JavaScriptActionPane;
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.design.mainframe.JWorkBook;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.IconDefinePane;
import com.fr.form.ui.Button;
import com.fr.form.ui.CustomToolBarButton;
@ -45,22 +47,21 @@ import com.fr.stable.StringUtils;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import com.fr.write.JavaScriptResourceInfo;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.ListCellRenderer;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingUtilities;
import javax.swing.DefaultListCellRenderer;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
@ -71,6 +72,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class EditToolBar extends BasicPane {
private static final String EMAIL = "email";
@ -102,9 +109,9 @@ public class EditToolBar extends BasicPane {
lastButton = (ToolBarButton) list.getSelectedValue();
if (lastButton.getWidget() instanceof Button) {
card.show(right, "button");
bp.populate(lastButton.getWidget());
bp.populate(lastButton.getWidget(), lastButton.getIcon());
} else {
bp.populate(lastButton.getWidget());
bp.populate(lastButton.getWidget(), lastButton.getIcon());
card.show(right, "none");
}
}
@ -140,51 +147,64 @@ public class EditToolBar extends BasicPane {
* 初始化
*/
public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel left = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setLayout(new BorderLayout());
//左侧按钮列表
JPanel leftPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
listModel = new DefaultListModel();
list = new JList(listModel);
list.setCellRenderer(render);
left.add(new JScrollPane(list), BorderLayout.CENTER);
list.addListSelectionListener(listSelectionListener);
list.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
list.setPreferredSize(FineUIScale.scale(new Dimension(-1, 380)));
leftPanel.add(list, BorderLayout.CENTER);
//添加外边框
leftPanel.setBorder(new FineRoundBorder());
if (listModel.getSize() > 0) {
list.setSelectedIndex(0);
}
//左侧按钮列表上方工具栏,上移-下移-删除
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(new MoveUpItemAction());
toolbarDef.addShortCut(new MoveDownItemAction());
toolbarDef.addShortCut(new RemoveAction());
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolBar);
left.add(toolBar, BorderLayout.NORTH);
toolBar.setBackground(FineUIUtils.getUIColor("Center.ZoneBorderColor", "defaultBorderColor"));
leftPanel.add(toolBar, BorderLayout.NORTH);
//右侧表单按钮属性面板
right = FRGUIPaneFactory.createCardLayout_S_Pane();
card = new CardLayout();
right.setLayout(card);
bp = new ButtonPane();
right.add("none", FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane());
right.add("button", bp);
right.setBorder(new ScaledEmptyBorder(0,10,0,0));
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPanel, right);
splitPane.setDividerLocation(150);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, left, right);
// splitPane.setDividerLocation(left.getMinimumSize().width);
splitPane.setDividerLocation(120);
this.add(splitPane);
list.addListSelectionListener(listSelectionListener);
JPanel backgroundPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, 0, 0, 0);
//下方样式设置面板
JPanel backgroundPane = new JPanel(new BorderLayout());
UIButton bgButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Background"));
defaultCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Background"));
bgButton.addActionListener(actioner);
backgroundPane.add(defaultCheckBox);
backgroundPane.add(bgButton);
JPanel bgPanel = new JPanel();
bgPanel.add(defaultCheckBox);
bgPanel.add(bgButton);
backgroundPane.add(bgPanel);
//添加按钮颜色面板默认不可见,控件显示增强开启才显示
JPanel buttonColorGroupPane = createButtonColorGroup();
buttonColorGroupPane.setVisible(false);
//样式设置面板布局,默认背景-按钮颜色
backgroundPane.add(column(10,
row(10, cell(defaultCheckBox).weight(0.15), cell(bgButton).weight(0.2), flex(0.65)).weight(1),
cell(buttonColorGroupPane).weight(1)
).getComponent());
if(WidgetThemeDesignerUtils.enableWidgetEnhance()) {
backgroundPane.add(createButtonColorGroup());
buttonColorGroupPane.setVisible(true);
}
backgroundPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_ToolBar_Style_Setting")));
this.add(backgroundPane, BorderLayout.SOUTH);
//样式设置面板设置标题
JPanel styleSettingPane = new JPanel(new BorderLayout());
styleSettingPane.add(wrapComponentWithTitle(backgroundPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_ToolBar_Style_Setting")));
styleSettingPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));;
this.add(column(cell(splitPane), cell(styleSettingPane)).getComponent());
}
ListCellRenderer render = new DefaultListCellRenderer() {
@ -273,7 +293,7 @@ public class EditToolBar extends BasicPane {
public MoveUpItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
this.setMnemonic('U');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
this.setSmallIcon(new LazyIcon("move_up"));
}
/**
@ -304,7 +324,7 @@ public class EditToolBar extends BasicPane {
public MoveDownItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
this.setMnemonic('D');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
this.setSmallIcon(new LazyIcon("move_down"));
}
/**
@ -338,7 +358,7 @@ public class EditToolBar extends BasicPane {
public class RemoveAction extends UpdateAction {
public RemoveAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Delete"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
this.setSmallIcon(new LazyIcon("clear"));
}
/**
@ -404,125 +424,120 @@ public class EditToolBar extends BasicPane {
Set<ExportToolBarProvider> set = ExtraDesignClassManager.getInstance().getArray(ExportToolBarProvider.XML_TAG);
exportToolBarProviders = set.toArray(new ExportToolBarProvider[set.size()]);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
//'设置表单按钮属性'面板
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
icon = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Icon"));
text = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Text"));
north.add(icon, BorderLayout.NORTH);
north.add(text, BorderLayout.CENTER);
nameField = new UITextField(8);
nameField = new UITextField();
iconPane = new IconDefinePane();
javaScriptPane = JavaScriptActionPane.createDefault();
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p};
Component[][] coms = new Component[][]{{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Printer_Alias") + ":"), nameField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Icon") + ":"), iconPane}};
JPanel nameIconPane = TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize);
north.add(nameIconPane, BorderLayout.SOUTH);
north.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property")));
JPanel nameIconPane = column(LayoutConstants.VERTICAL_GAP,
//显示按钮图标,显示按钮名称
row(LayoutConstants.HORIZONTAL_GAP, cell(icon), cell(text)),
//控件别名
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Printer_Alias"))),
cell(nameField)),
//控件图标
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Icon"))),
cell(iconPane))
).getComponent();
nameIconPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
north.add(wrapComponentWithTitle(nameIconPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property")), BorderLayout.SOUTH);
this.add(north, BorderLayout.NORTH);
JPanel none = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
//不同图标额外的设置表单按钮属性面板
centerPane = FRGUIPaneFactory.createCardLayout_S_Pane();
card = new CardLayout();
centerPane.setLayout(card);
centerPane.add(CUSTOM, getCustomPane());
centerPane.add(EXPORT, getExport());
centerPane.add(EMAIL, getEmail());
centerPane.add(NONE, none);
centerPane.add(getCpane(), APPEND_COUNT);
centerPane.add(getSubmitPane(), SUBMIT);
centerPane.add(CUSTOM, wrapComponentWithTitle(getCustomPane(), com.fr.design.i18n.Toolkit.i18nText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit") + "JS")));
centerPane.add(EXPORT, wrapComponentWithTitle(getExport(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property")));
centerPane.add(EMAIL, wrapComponentWithTitle(getEmail(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property")));
centerPane.add(NONE, FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane());
centerPane.add(APPEND_COUNT, column(LayoutConstants.VERTICAL_GAP,cell(getAppendCountPane())).getComponent());
centerPane.add(SUBMIT, wrapComponentWithTitle(getSubmitPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property")));
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.updateCenterPane(centerPane);
}
this.add(centerPane, BorderLayout.CENTER);
}
/**
* 自定义按钮Pane
* @return
*/
private JPanel getCustomPane() {
JPanel customPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
JPanel customPane = new JPanel(new BorderLayout());
button = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_User_Defined_Event"));
customPane.add(button);
customPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit") + "JS", null));
customPane.add(row(cell(button).weight(0.2), flex(0.8)).getComponent());
button.addActionListener(l);
return customPane;
}
/**
* 导出Pane
* @return
*/
private JPanel getExport() {
JPanel export = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
// export.setLayout(new BoxLayout(export, BoxLayout.Y_AXIS));
JPanel export = FRGUIPaneFactory.createBorderLayout_S_Pane();
pdf = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Output_PDF"));
excelP = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Output_Excel_Page"));
excelO = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Output_Excel_Simple"));
excelS = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Output_Excel_Sheet"));
word = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Output_Word"));
image = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Image"));
export.add(pdf);
export.add(Box.createVerticalStrut(2));
export.add(excelP);
export.add(Box.createVerticalStrut(2));
export.add(excelO);
export.add(Box.createVerticalStrut(2));
export.add(excelS);
export.add(Box.createVerticalStrut(2));
export.add(word);
export.add(Box.createVerticalStrut(2));
export.add(image);
export.add(column(10, cell(pdf), cell(excelP), cell(excelO), cell(excelS), cell(word), cell(image)).getComponent());
for (int i = 0; i < ArrayUtils.getLength(exportToolBarProviders); i++) {
export = exportToolBarProviders[i].updateCenterPane(export);
}
export.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property"), null));
return export;
}
/**
* 邮件Pane
* @return
*/
private JPanel getEmail() {
JPanel email = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
JPanel email = FRGUIPaneFactory.createBorderLayout_S_Pane();
customConsignee = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Custom_Consignee"));
consigneeByDepartment = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Consignee_By_Department"));
consigneeByRole = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Consignee_By_Role"));
email.add(customConsignee);
email.add(Box.createVerticalStrut(2));
email.add(consigneeByDepartment);
email.add(Box.createVerticalStrut(2));
email.add(consigneeByRole);
email.add(Box.createVerticalStrut(2));
email.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property"), null));
email.add(column(LayoutConstants.VERTICAL_GAP,
cell(customConsignee),
cell(consigneeByDepartment),
cell(consigneeByRole)
).getComponent());
return email;
}
private JPanel getCpane() {
JPanel appendCountPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
/**
* 插入记录Pane
* @return
*/
private JPanel getAppendCountPane() {
JPanel appendCountPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
count = new UIBasicSpinner(new SpinnerNumberModel(1, 0, Integer.MAX_VALUE, 1));
UILabel countLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_Row_Column_Numbers") + ":");
JPanel cpane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
cpane.add(countLabel);
cpane.add(count);
appendCountPane.add(cpane);
return cpane;
UILabel countLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_Row_Column_Numbers"));
appendCountPane.add(row(LayoutConstants.HORIZONTAL_GAP, cell(countLabel), cell(count)).getComponent());
return appendCountPane;
}
/**
* 提交Pane
* @return
*/
private JPanel getSubmitPane() {
isVerify = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"));
failSubmit = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Fail_Still_Submit"));
isCurSheet = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Only_Submit_Current_Sheet"));
JPanel submitPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
submitPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property"), null));
submitPane.add(isVerify);
submitPane.add(failSubmit);
submitPane.add(isCurSheet);
isVerify.addActionListener(actionListener);
JPanel submitPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
submitPane.add(column(LayoutConstants.VERTICAL_GAP,
cell(isVerify),
cell(failSubmit),
cell(isCurSheet)
).getComponent());
return submitPane;
}
@ -567,11 +582,11 @@ public class EditToolBar extends BasicPane {
*
* @param widget 对应组件
*/
public void populate(Widget widget) {
public void populate(Widget widget, Icon icon) {
this.widget = widget;
card.show(centerPane, "none");
if (widget instanceof Button) {
populateDefault();
populateDefault(icon);
}
if (widget instanceof Export) {
populateExport();
@ -640,12 +655,12 @@ public class EditToolBar extends BasicPane {
this.isCurSheet.setSelected(submit.isOnlySubmitSelect());
}
private void populateDefault() {
private void populateDefault(Icon icon) {
Button button = (Button) widget;
this.icon.setSelected(button.isShowIcon());
this.text.setSelected(button.isShowText());
this.nameField.setText(button.getText());
this.iconPane.populate(((Button) widget).getIconName());
this.iconPane.populateIcon(((Button) widget).getIconName(), icon);
}
/**
@ -739,11 +754,7 @@ public class EditToolBar extends BasicPane {
super.setSelectedIndex(newSelectedIndex, fireChanged);
}
};
bgColorButtonGroup.setPreferredSize(new Dimension(135, bgColorButtonGroup.getPreferredSize().height));
JPanel headPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(IntervalConstants.INTERVAL_L5, 0);
headPane.add(headLabel);
headPane.add(bgColorButtonGroup);
headPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L2, 0, 0));
return headPane;
bgColorButtonGroup.setPreferredSize(FineUIScale.scale(new Dimension(135, bgColorButtonGroup.getPreferredSize().height)));
return row(10, cell(headLabel).weight(0.15), cell(bgColorButtonGroup).weight(0.3), flex(0.55)).getComponent();
}
}

60
designer-realize/src/main/java/com/fr/design/webattr/ErrorTemplatePane.java

@ -1,47 +1,45 @@
package com.fr.design.webattr;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
public class ErrorTemplatePane extends BasicBeanPane<String> {
private UITextField templateField = null;
public ErrorTemplatePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
this.templateField = new UITextField(36);
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, p};
JPanel reportletNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
reportletNamePane.add(this.templateField);
Component[][] components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Path") + ":"), reportletNamePane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Parameters") + ":"), null},
{new UILabel("message" + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Message"))},
{new UILabel("charset" + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Charset"))},
{new UILabel("exception" + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Exception_Stack_Trace"))}
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(northPane, BorderLayout.NORTH);
this.setLayout(new BorderLayout());
this.templateField = new UITextField();
JPanel northPane = column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Path"))),
cell(this.templateField).weight(1)
),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Parameters"))),
row(
cell(new UILabel("message" + ":")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Message")))
),
row(
cell(new UILabel("charset" + ":")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Charset")))
),
row(
cell(new UILabel("exception" + ":")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Exception_Stack_Trace")))
)
).getComponent();
northPane.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(northPane);
}
@Override
@ -59,6 +57,4 @@ public class ErrorTemplatePane extends BasicBeanPane<String> {
public String updateBean() {
return this.templateField.getText();
}
}

27
designer-realize/src/main/java/com/fr/design/webattr/EventPane.java

@ -1,7 +1,11 @@
package com.fr.design.webattr;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itoolbar.UIToolbar;
@ -32,6 +36,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* richer:调用该类并且对事件名字国际化时需要严格按照"FR-Engine_Event_事件名"来进行命名
*/
@ -53,14 +60,8 @@ public class EventPane extends BasicPane {
int len = eventName.length;
this.eventName = Arrays.copyOf(eventName, len);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
listModel = new DefaultListModel();
eventList = new JList(listModel);
// eventList.setFixedCellHeight(20);
eventList.setCellRenderer(render);
eventList.addMouseListener(editListener);
this.add(new UIScrollPane(eventList), BorderLayout.CENTER);
//按钮栏
addAction = new AddMenuDef(this.eventName);
editAction = new EditAction();
removeAction = new RemoveAction();
ToolBarDef def = new ToolBarDef();
@ -69,8 +70,16 @@ public class EventPane extends BasicPane {
def.addShortCut(removeAction);
UIToolbar toolBar = ToolBarDef.createJToolBar();
def.updateToolBar(toolBar);
toolBar.setPreferredSize(new Dimension(toolBar.getWidth(), 26));
this.add(toolBar, BorderLayout.NORTH);
//列表
listModel = new DefaultListModel();
eventList = new JList(listModel);
eventList.setCellRenderer(render);
eventList.addMouseListener(editListener);
eventList.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
JScrollPane scrollPane = new UIScrollPane(eventList);
scrollPane.setBorder(new FineRoundBorder());
//让事件设置列表铺满,有特殊设置在外层调用处修改
this.add(column(LayoutConstants.VGAP_SMALL, cell(toolBar), cell(scrollPane).weight(1)).getComponent());
}
@Override

86
designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java

@ -1,7 +1,10 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
@ -11,8 +14,6 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.event.Listener;
import com.fr.general.ComparatorUtils;
@ -28,7 +29,6 @@ import com.fr.design.i18n.Toolkit;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputMethodEvent;
@ -44,6 +44,12 @@ import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapBoldLabelWithUnderline;
public class PageToolBarPane extends AbstractEditToolBarPane {
private UIRadioButton centerRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Center_Display"));
@ -59,7 +65,6 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
//固定行数分页,每页最多500行,最少1行数据
@ -68,14 +73,13 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
public PageToolBarPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
ButtonGroup buttonGroup = new ButtonGroup();
leftRadioButton.setSelected(true);
buttonGroup.add(centerRadioButton);
buttonGroup.add(leftRadioButton);
JPanel buttonPane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout());
buttonPane.add(centerRadioButton);
buttonPane.add(leftRadioButton);
isShowAsImageBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Is_Paint_Page"));
isAutoScaleBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_IS_Auto_Scale"));
isTDHeavyBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_IS_TD_HEAVY_EXPORT"), false);
@ -87,54 +91,66 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
}
});
editToolBarButton.addActionListener(editBtnListener);
JPanel editToolBarButtonPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
editToolBarButtonPanel.add(editToolBarButton);
isUseToolBarCheckBox.setSelected(true);
isUseToolBarCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
editToolBarButton.setEnabled(isUseToolBarCheckBox.isSelected());
}
});
double p = TableLayout.PREFERRED;
pageFixedRowCountTextField = new UITextField(5);
pageFixedRowCountTextField = new UITextField();
pageFixedRowCountTextField.setText("30");
pageFixedRowCountTextField.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Count_Tip"));
pageFixedRowCountTextField.addKeyListener(rowCountKeyListener);
pageFixedRowCountTextField.addInputMethodListener(rowCountInputMethodListener);
UILabel linesPerPageLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page") + ":");
Component[][] rowCountTextFieldComponents = {{linesPerPageLabel,pageFixedRowCountTextField}};
JPanel linesPerPagePane = TableLayoutHelper.createTableLayoutPane(rowCountTextFieldComponents, new double[]{p}, new double[]{p,p});
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"));
tipLabel.setForeground(TIPS_FONT_COLOR);
double[] columnSize = {p, p, p, p};
double[] rowSize = {p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Show_Location") + ":", UILabel.RIGHT), buttonPane, null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox, isTDHeavyBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Paging_Settings") + ":", UILabel.RIGHT), isPageFixedRowBox, linesPerPagePane, null},
new Component[]{null, tipLabel, null, null},
new Component[]{isUseToolBarCheckBox, editToolBarButtonPanel, null, null}
};
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
//报表显示位置:居中展示-左展示
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15),
cell(centerRadioButton).weight(0.2),
cell(leftRadioButton).weight(0.15),
flex(0.5)
),
//页面:以图片方式显示-iframe嵌入时自动缩放-重方式输出格子
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.15),
cell(isShowAsImageBox).weight(0.2),
cell(isAutoScaleBox).weight(0.25),
cell(isTDHeavyBox).weight(0.2),
flex(0.2)
),
//分页设置:按行分页-每页显示行数
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.15),
cell(isPageFixedRowBox).weight(0.2),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page"))).weight(0.15),
cell(pageFixedRowCountTextField).weight(0.2),
flex(0.3)
),
//提示
cell(tipLabel),
//使用工具栏-编辑
row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton))
).getComponent();
//事件编辑
JPanel eventPanel = new JPanel(new BorderLayout());
eventPane = new EventPane(new WebPage().supportedEvents());
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Editing_Listeners"));
wrapBoldLabelWithUnderline(label);
eventPanel.add(column(LayoutConstants.VGAP_SMALL, cell(label), cell(eventPane).weight(1)).getComponent());
JPanel northPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(northPanel, BorderLayout.NORTH);
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(northPanel),
cell(eventPanel).weight(1)
).getComponent());
eventPane = new EventPane(new WebPage().supportedEvents());
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
center.add(eventPane, BorderLayout.CENTER);
//wei : 默认没config.xml的情况下,就有默认工具栏
ToolBarManager toolBarManager = ToolBarManager.createDefaultToolBar();
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
this.toolBarManagers = new ToolBarManager[]{toolBarManager};
this.add(center, BorderLayout.CENTER);
}
@Override

69
designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java

@ -1,14 +1,13 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebPage;
@ -16,7 +15,6 @@ import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr;
import com.fr.design.i18n.Toolkit;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputMethodEvent;
@ -27,11 +25,15 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UIRadioButton centerRadioButton;
private UIRadioButton leftRadioButton;
@ -40,7 +42,6 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UICheckBox isTDHeavyBox;
private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
private static final String DEFAULT_ROW_COUNT = "30";
@ -52,6 +53,10 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
super();
}
/**
* 模板-模板Web属性-分页预览设置中其余设置面板通用部分在父类绘制
* @return
*/
@Override
protected JPanel createOtherSetPane() {
centerRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Center_Display"));
@ -60,9 +65,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
leftRadioButton.setSelected(true);
buttonGroup.add(centerRadioButton);
buttonGroup.add(leftRadioButton);
JPanel buttonpane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout());
buttonpane.add(centerRadioButton);
buttonpane.add(leftRadioButton);
isShowAsImageBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Is_Paint_Page"));
isAutoScaleBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_IS_Auto_Scale"));
isTDHeavyBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_IS_TD_HEAVY_EXPORT"), false);
@ -74,9 +77,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
}
});
double p = TableLayout.PREFERRED;
pageFixedRowCountTextField = new UITextField(5);
pageFixedRowCountTextField = new UITextField();
pageFixedRowCountTextField.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Count_Tip"));
pageFixedRowCountTextField.addKeyListener(new KeyAdapter() {
@Override
@ -101,23 +102,35 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
}
});
UILabel linesPerPageLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page") + ":");
Component[][] rowCountTextFieldComponents = {{linesPerPageLabel,pageFixedRowCountTextField}};
JPanel linesPerPagePane = TableLayoutHelper.createTableLayoutPane(rowCountTextFieldComponents, new double[]{p}, new double[]{p,p});
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"));
tipLabel.setForeground(TIPS_FONT_COLOR);
double[] columnSize = {p, p, p, p};
double[] rowSize = {p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location") + ":", UILabel.RIGHT), buttonpane, null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox, isTDHeavyBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Paging_Settings") + ":", UILabel.RIGHT), isPageFixedRowBox, linesPerPagePane, null},
new Component[]{null, tipLabel, null, null}
};
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
//其余设置面板布局
return column(LayoutConstants.VERTICAL_GAP,
//报表显示位置
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15),
cell(centerRadioButton).weight(0.2),
cell(leftRadioButton).weight(0.15),
flex(0.5)
),
//页面
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.15),
cell(isShowAsImageBox).weight(0.2),
cell(isAutoScaleBox).weight(0.25),
cell(isTDHeavyBox).weight(0.2),
flex(0.2)
),
//分页设置
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.15), cell(isPageFixedRowBox).weight(0.2),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page"))).weight(0.15),
cell(pageFixedRowCountTextField).weight(0.2),
flex(0.3)
),
//提示
cell(tipLabel)
).getComponent();
}

4
designer-realize/src/main/java/com/fr/design/webattr/ReportServerPrinterPane.java

@ -4,9 +4,9 @@
package com.fr.design.webattr;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.web.Printer;
/**
@ -23,7 +23,7 @@ public class ReportServerPrinterPane extends JPanel {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(6, 2, 4, 2));
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
serverPrinterPane = new ServerPrinterPane();
this.add(serverPrinterPane);
}

34
designer-realize/src/main/java/com/fr/design/webattr/ReportWebAttrPane.java

@ -3,8 +3,8 @@
*/
package com.fr.design.webattr;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.style.background.BackgroundPane4Browser;
@ -19,19 +19,13 @@ import java.awt.*;
*/
public class ReportWebAttrPane extends LoadingBasicPane {
private ReportWebAttr reportWebAttr;
private UITabbedPane tabbedPane;
private CommonPane commonPane;
private ReportServerPrinterPane serverPrintPane;
private PageWebSettingPane pageWeb;
private WriteWebSettingPane writeWeb;
private ViewWebSettingPane viewWeb;
private BackgroundPane backgroundPane;
protected WebCssPane cssPane;
protected WebJsPane jsPane;
@ -39,20 +33,20 @@ public class ReportWebAttrPane extends LoadingBasicPane {
protected synchronized void initComponents(JPanel container) {
JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());
//Tabbed Pane
tabbedPane = new UITabbedPane();
//模板-模板Web属性
FineTabbedPane tabbedPane = FineTabbedPane.builder()
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), commonPane = new CommonPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer(Server)"), serverPrintPane = new ReportServerPrinterPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Pagination_Setting"), pageWeb = new PageWebSettingPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Setting"), writeWeb = new WriteWebSettingPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings"), viewWeb = new ViewWebSettingPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Browser_Background"), backgroundPane = new BackgroundPane4Browser())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Import_Css"), cssPane = new WebCssPane())
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Import_JavaScript"), jsPane = new WebJsPane())
.withTabLayout(new int[]{4, 4})
.withHeadRatio(0.8f)
.build();
defaultPane.add(tabbedPane, BorderLayout.CENTER);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), commonPane = new CommonPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer(Server)"), serverPrintPane = new ReportServerPrinterPane());
tabbedPane.add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Pagination_Setting"), pageWeb = new PageWebSettingPane());
tabbedPane.add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Setting"), writeWeb = new WriteWebSettingPane());
tabbedPane.add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings"), viewWeb = new ViewWebSettingPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Browser_Background"), backgroundPane = new BackgroundPane4Browser());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Import_Css"), cssPane = new WebCssPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Import_JavaScript"), jsPane = new WebJsPane());
}
@Override

115
designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java

@ -1,5 +1,6 @@
package com.fr.design.webattr;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.core.WidgetOptionFactory;
@ -38,7 +39,6 @@ import com.fr.report.web.button.write.ImportExcelData;
import com.fr.report.web.button.write.ShowCellValue;
import com.fr.report.web.button.write.StashButton;
import com.fr.report.web.button.write.Submit;
import com.fr.report.web.button.write.SubmitForcibly;
import com.fr.report.web.button.write.Verify;
public class ReportWebWidgetConstants {
@ -61,8 +61,8 @@ public class ReportWebWidgetConstants {
}
// 提交按钮
public static final WidgetOption SUBMIT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Submit"), BaseUtils.readIcon("/com/fr/web/images/save.png"),
Submit.class);
public static final WidgetOption SUBMIT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Submit"),
BaseUtils.readIcon("/com/fr/web/images/save.png"), Submit.class);
// flash打印按钮
public static final WidgetOption FLASHPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Print[Client]"),
@ -70,102 +70,119 @@ public class ReportWebWidgetConstants {
// appletprint
public static final WidgetOption APPLETPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Applet_Print"),
BaseUtils.readIcon("/com/fr/web/images/appletPrint.png"), AppletPrint.class);
new LazyIcon("printApplet"), AppletPrint.class);
// PDF导出
public static final WidgetOption PDF = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_PDF"), BaseUtils.readIcon("/com/fr/web/images/pdf.png"),
PDF.class);
public static final WidgetOption PDF = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_PDF"),
new LazyIcon("pdfFile"), PDF.class);
// 客户端PDF打印
public static final WidgetOption PDFPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Print[Client]"),
BaseUtils.readIcon("/com/fr/web/images/pdfPrint.png"), PDFPrint.class);
new LazyIcon("printPdf"), PDFPrint.class);
// 邮件发送
public static final WidgetOption EMAIL = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Email"), BaseUtils.readIcon("/com/fr/web/images/email.png"), Email.class);
public static final WidgetOption PRINTPREVIEW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PrintP_Print_Preview"),
BaseUtils.readIcon("/com/fr/web/images/preview.png"), PrintPreview.class);
public static final WidgetOption EMAIL = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Email"),
new LazyIcon("email"), Email.class);
// 打印预览
public static final WidgetOption PRINTPREVIEW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PrintP_Print_Preview"),
new LazyIcon("printPreview"), PrintPreview.class);
// 导出成Excel 分页导出
public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Excel_Page"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class);
new LazyIcon("excel_import"), ExcelP.class);
// 导出成Excel 原样导出
public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Excel_Simple"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class);
new LazyIcon("excel_import"), ExcelO.class);
// 导出成Excel 分页分Sheet导出
public static final WidgetOption EXCELS = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Excel_Page_To_Sheet"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelS.class);
new LazyIcon("excel_import"), ExcelS.class);
// 导出成Word
public static final WidgetOption WORD = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Word"), BaseUtils.readIcon("/com/fr/web/images/word.png"), Word.class);
public static final WidgetOption WORD = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Word"),
new LazyIcon("wordFile"), Word.class);
// 页面设置
public static final WidgetOption PAGESETUP = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page_Setup"), BaseUtils.readIcon("/com/fr/web/images/pageSetup.png"), PageSetup.class);
public static final WidgetOption PAGESETUP = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page_Setup"),
new LazyIcon("pageSetup"), PageSetup.class);
// 导出
public static final WidgetOption EXPORT = WidgetOptionFactory
.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Export"), BaseUtils.readIcon("/com/fr/web/images/export.png"), Export.class);
public static final WidgetOption EXPORT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Export"),
new LazyIcon("export"), Export.class);
// 当前页/总页数
public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Page_Navi_Text"),
BaseUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class);
new LazyIcon("page_navi"), PageNavi.class);
// 首页
public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_First"), BaseUtils.readIcon("/com/fr/web/images/first.png"),
First.class);
public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_First"),
new LazyIcon("page_first"), First.class);
// 末页
public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Last"), BaseUtils.readIcon("/com/fr/web/images/last.png"),
Last.class);
public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Last"),
new LazyIcon("page_last"), Last.class);
// 前一页
public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Previous"),
BaseUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class);
new LazyIcon("page_previous"), Previous.class);
// 后一页
public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Next"), BaseUtils.readIcon("/com/fr/web/images/next.png"),
Next.class);
public static final WidgetOption SCALE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce"), BaseUtils.readIcon("/com/fr/web/images/scale.png"),
Scale.class);
public static final WidgetOption NEW_PRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Print"), BaseUtils.readIcon("/com/fr/web/images/print.png"), NewPrint.class);
public static final WidgetOption PRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Print_Compatible"), BaseUtils.readIcon("/com/fr/web/images/print.png"), Print.class);
public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Next"),
new LazyIcon("page_next"), Next.class);
//缩放
public static final WidgetOption SCALE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce"),
new LazyIcon("scale"), Scale.class);
// 打印
public static final WidgetOption NEW_PRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Print"),
new LazyIcon("print"), NewPrint.class);
// 打印兼容
public static final WidgetOption PRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Print_Compatible"),
new LazyIcon("print"), Print.class);
//插入记录
public static final WidgetOption APPENDCOLUMNROW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Record"),
BaseUtils.readIcon("/com/fr/web/images/appendRow.png"), AppendColumnRow.class);
//删除记录
public static final WidgetOption DELETECOLUMNROW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Delete_Record"),
BaseUtils.readIcon("/com/fr/web/images/deleteRow.png"), DeleteColumnRow.class);
public static final WidgetOption VERIFY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"), BaseUtils.readIcon("/com/fr/web/images/verify.png"),
Verify.class);
public static final WidgetOption SUBMITFORCIBLY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Submit_Forcibly"),
BaseUtils.readIcon("/com/fr/web/images/save2.png"), SubmitForcibly.class);
// show cell value
//数据校验
public static final WidgetOption VERIFY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"),
new LazyIcon("dataVerify"), Verify.class);
// show cell value 显示单元格值
public static final WidgetOption SHOWCELLVALUE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Show_Cell_Value"),
BaseUtils.readIcon("/com/fr/web/images/showValue.png"), ShowCellValue.class);
// import excel data
// import excel data 导入excel
public static final WidgetOption IMPORTEXCELDATA = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Import_Excel_Data"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ImportExcelData.class);
new LazyIcon("excel_import"), ImportExcelData.class);
//自定义导入excel
public static final WidgetOption IMPORTEXCELDATA_CUSTOMIZED = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Import_Excel_Data_Customized"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), CustomizeImportExcelData.class);
new LazyIcon("excel_import"), CustomizeImportExcelData.class);
// 打印机偏移设置
public static final WidgetOption SETPRINTEROFFSET = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_SetPrinterOffset"), BaseUtils.readIcon("/com/fr/web/images/pianyi.png"), SetPrinterOffset.class);
public static final WidgetOption SETPRINTEROFFSET = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_SetPrinterOffset"),
new LazyIcon("printerOffset"), SetPrinterOffset.class);
public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory
.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Custom_Form_Button"), CustomToolBarButton.class);
//自定义按钮
public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Custom_Form_Button"),
new LazyIcon("customButton"), CustomToolBarButton.class);
// 数据暂存
public static final WidgetOption WRITESTASH = WidgetOptionFactory
.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine-Write_Stash"), BaseUtils.readIcon("/com/fr/web/images/edit/stash.png"), StashButton.class);
// 数据清空
public static final WidgetOption WRITESTASHCLEAR = WidgetOptionFactory
.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine-Write_Clear"), BaseUtils.readIcon("/com/fr/web/images/edit/clearstash.png"), ClearStashedButton.class);
//Excel导入
public static final WidgetOption WRITESTASHCLEAR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine-Write_Clear"),
new LazyIcon("clearStash"), ClearStashedButton.class);
//Excel导入_多次
public static final WidgetOption IMPORTEXCEL= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Repeat"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelImport.class);
new LazyIcon("excel_import"), ExcelImport.class);
//Excel导入_覆盖
public static final WidgetOption IMPORTEXCEL_COVER= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Cover"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ImExcelCover.class);
new LazyIcon("excel_import"), ImExcelCover.class);
//Excel导入_清空
public static final WidgetOption IMPORTEXCEL_CLEAN= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Clean"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ImExcelClean.class);
new LazyIcon("excel_import"), ImExcelClean.class);
//Excel导入_增量
public static final WidgetOption IMPORTEXCEL_APPEND= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Append"),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ImExcelAppend.class);
new LazyIcon("excel_import"), ImExcelAppend.class);
}

10
designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java

@ -1,5 +1,7 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.config.Configuration;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
@ -11,7 +13,7 @@ import com.fr.report.fit.ReportFitConfig;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.awt.Color;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@ -78,10 +80,14 @@ public class ServerFitAttrPane extends BaseFitAttrPane {
};
}
/**
* 服务器配置-PC端自适应属性面板中需要添加提示
*/
@Override
protected void initPrompt() {
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Designer_Fit_Attr_Pane_Hint"));
uiLabel.setForeground(Color.lightGray);
FineUIStyle.setStyle(uiLabel, FineUIStyle.LABEL_TIP);
uiLabel.setBorder(new ScaledEmptyBorder(5, 5, 5, 0));
contentJPanel.add(uiLabel);
}
}

64
designer-realize/src/main/java/com/fr/design/webattr/ServerPrinterPane.java

@ -3,7 +3,10 @@
*/
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -11,12 +14,10 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.GeneralUtils;
import com.fr.report.web.Printer;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JList;
@ -28,7 +29,7 @@ import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -36,6 +37,11 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class ServerPrinterPane extends BasicPane {
private JList printerList;
@ -52,38 +58,28 @@ public class ServerPrinterPane extends BasicPane {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(6, 2, 4, 2));
this.setLayout(new BorderLayout());
//Kevin Wang: 为左侧打印机添加五个图形形式的按钮
JToolBar toolbar = new JToolBar();
this.add(toolbar, BorderLayout.NORTH);
Dimension preferDimension = new Dimension(24, 24);
addButton = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
addButton = new UIButton(new LazyIcon("add"));
addButton.addActionListener(addActionListener);
addButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"));//"add"
addButton.setPreferredSize(preferDimension);
editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/edit.png"));
editButton = new UIButton(new LazyIcon("edit"));
editButton.addActionListener(editActionListener);
editButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));//"edit"
editButton.setPreferredSize(preferDimension);
removeButton = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
removeButton = new UIButton(new LazyIcon("remove"));
removeButton.addActionListener(this.removeActionListener);
removeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));//"remove"
removeButton.setPreferredSize(preferDimension);
moveUpButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
moveUpButton = new UIButton(new LazyIcon("move_up"));
moveUpButton.addActionListener(this.moveUpActionListener);
moveUpButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));//"moveUp"
moveUpButton.setPreferredSize(preferDimension);
moveDownButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
moveDownButton = new UIButton(new LazyIcon("move_down"));
moveDownButton.addActionListener(this.moveDownActionListener);
moveDownButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));//"moveDown"
moveDownButton.setPreferredSize(preferDimension);
toolbar.add(addButton);
toolbar.add(editButton);
@ -93,11 +89,12 @@ public class ServerPrinterPane extends BasicPane {
printerList = new JList(new DefaultListModel());
printerList.addListSelectionListener(printerSelectionListener);
printerList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
JScrollPane printerListScrollPane = new JScrollPane(printerList);
printerListScrollPane.setBorder(new FineRoundBorder());
//shark:双击printerlist也可以编辑
printerList.addMouseListener(mouseClickedListener);
this.add(new JScrollPane(printerList), BorderLayout.CENTER);
//
this.add(column(cell(toolbar), cell(printerListScrollPane).weight(1)).getComponent());
this.checkButtonEnabled();
}
@ -315,25 +312,24 @@ public class ServerPrinterPane extends BasicPane {
this.initComponents();
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(20, 5, 0, 0));
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
centerPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer") + ":"), BorderLayout.WEST);
this.setLayout(new BorderLayout());
DefaultComboBoxModel printerComboModel = new DefaultComboBoxModel();
printerCombo = new UIComboBox(printerComboModel);
centerPane.add(printerCombo);
//添加打印机面板
JPanel centerPane = column(
flex(),
row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer") + ":")),
cell(printerCombo).weight(1)
),
flex()
).getComponent();
// populate printer list.
String[] serverPrinterList = GeneralUtils.getSystemPrinterNameArray();
for (int d = 0; d < serverPrinterList.length; d++) {
printerComboModel.addElement(serverPrinterList[d]);
}
this.add(centerPane);
}

31
designer-realize/src/main/java/com/fr/design/webattr/SettingToolBar.java

@ -1,40 +1,49 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JPanel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
public class SettingToolBar extends JPanel {
private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private Icon setIcon = new LazyIcon("tool_config");
private Icon delIcon = new LazyIcon("clear");
private UIButton setButton;
private UIButton delButton;
private ToolBarPane toolBarPane;
public SettingToolBar(String name,ToolBarPane toolBarPane) {
super();
// this.setBackground(Color.lightGray);
this.add(new UILabel(name));
super(new BorderLayout());
this.toolBarPane = toolBarPane;
setButton = GUICoreUtils.createTransparentButton(setIcon, setIcon, setIcon);
setButton = new UIButton(setIcon);
setButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit_Button_ToolBar"));
setButton.setAction(new SetAction());
delButton = GUICoreUtils.createTransparentButton(delIcon, delIcon, delIcon);
delButton = new UIButton(delIcon);
delButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Button_ToolBar"));
delButton.setAction(new DelAction());
this.add(setButton);
this.add(delButton);
this.add(row(LayoutConstants.HGAP_LARGE,
fix(LayoutConstants.HGAP_LARGE),
cell(new UILabel(name)),
cell(setButton),
cell(delButton)
).getComponent());
}
public void setEnabled(boolean b) {

21
designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java

@ -1,6 +1,5 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
@ -8,13 +7,12 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.Insets;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.Icon;
public class ToolBarButton extends UIButton implements MouseListener {
private Widget widget;
@ -27,16 +25,8 @@ public class ToolBarButton extends UIButton implements MouseListener {
public ToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon);
this.widget = widget;
if (widget instanceof com.fr.form.ui.Button) {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
setIcon(new ImageIcon(iimage));
}
}
}
//直接设置Icon图标
setIcon(icon);
this.addMouseListener(this);
setMargin(new Insets(0, 0, 0, 0));
}
@ -79,7 +69,6 @@ public class ToolBarButton extends UIButton implements MouseListener {
this.no = no;
}
protected void paintBorder(Graphics g) {
this.setBorderType(UIButton.NORMAL_BORDER);
super.paintBorder(g);

131
designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java

@ -1,11 +1,15 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
@ -23,19 +27,23 @@ import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.BorderFactory;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 新的拖拽ToolBar button以实现自定义工具栏 报表web设置那儿的.应该不叫ToolBarDragPane因为实际没有提供drag功能
*
@ -48,9 +56,12 @@ public class ToolBarDragPane extends WidgetToolBarPane {
private int row = 7;
private DefaultTableModel toolbarButtonTableModel;
private JTable layoutTable;
private UICheckBox isUseToolBarCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_ToolBar") + ":"); // 是否使用工具栏
private UICheckBox isUseToolBarCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_ToolBar")); // 是否使用工具栏
private boolean isEnabled;
/**
* 工具栏Pane
*/
public ToolBarDragPane() {
WidgetOption[] options = ExtraDesignClassManager.getInstance().getWebWidgetOptions();
if(options != null){
@ -59,9 +70,13 @@ public class ToolBarDragPane extends WidgetToolBarPane {
}
toolbarButtonTableModel = new TableModel(row ,COLUMN);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
//工具栏上方面板
JPanel northPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
isUseToolBarCheckBox.setSelected(true);
northPanel.add(isUseToolBarCheckBox, BorderLayout.WEST);
//恢复默认按钮
UIButton defaultButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Restore_Default"));
// 恢复默认按钮
defaultButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
northToolBar.removeButtonList();
@ -78,26 +93,30 @@ public class ToolBarDragPane extends WidgetToolBarPane {
ToolBarDragPane.this.repaint();
}
});
northPanel.add(defaultButton, BorderLayout.EAST);
north.add(isUseToolBarCheckBox, BorderLayout.WEST);
JPanel aa = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
aa.add(defaultButton);
north.add(aa, BorderLayout.CENTER);
this.add(north, BorderLayout.NORTH);
//顶部工具栏
JPanel northContentPane = new JPanel(new BorderLayout());
northToolBar = new ToolBarPane();
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
// northToolBar.setBackground(Color.lightGray);
UIButton topButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_up.png"));
topButton.setBorder(null);
// topButton.setMargin(null);
northToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
northToolBar.setOpaque(false);
SettingToolBar top = new SettingToolBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ToolBar_Top"), northToolBar);
top.setOpaque(false);
northContentPane.add(northToolBar, BorderLayout.CENTER);
northContentPane.add(top, BorderLayout.EAST);
northContentPane.setOpaque(false);
northContentPane.setBorder(new ScaledEmptyBorder(4,0,4,0));
JPanel topToolbarPanel = new JPanel(new BorderLayout());
topToolbarPanel.add(northContentPane);
topToolbarPanel.setBackground(FineUIUtils.getUIColor("Center.ZoneBorderColor", "defaultBorderColor"));
//移入顶部工具栏按钮
UIButton topButton = new UIButton(new LazyIcon("move_up"));
topButton.setOpaque(false);
topButton.setContentAreaFilled(false);
topButton.setFocusPainted(false);
topButton.setRequestFocusEnabled(false);
topButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (isSelectedtable()) {
@ -113,15 +132,26 @@ public class ToolBarDragPane extends WidgetToolBarPane {
}
}
});
UIButton downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_down.png"));
downButton.setBorder(null);
//图标列表面板,增加外边距
initLayoutTable();
JPanel innerTablePanel = new JPanel(new BorderLayout());
innerTablePanel.add(layoutTable);
innerTablePanel.setOpaque(false);
innerTablePanel.setBorder(new ScaledEmptyBorder(4,4,4,4));
JPanel buttonTablePanel = new JPanel(new BorderLayout());
buttonTablePanel.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
buttonTablePanel.setBorder(new FineRoundBorder());
buttonTablePanel.add(innerTablePanel);
//移入底部工具栏按钮
UIButton downButton = new UIButton(new LazyIcon("move_down"));
downButton.setMargin(null);
downButton.setOpaque(false);
downButton.setContentAreaFilled(false);
downButton.setFocusPainted(false);
downButton.setRequestFocusEnabled(false);
downButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (isSelectedtable()) {
@ -138,48 +168,44 @@ public class ToolBarDragPane extends WidgetToolBarPane {
}
});
initLayoutTable();
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
// center.setBackground(Color.WHITE);
center.add(topButton, BorderLayout.NORTH);
JPanel small = FRGUIPaneFactory.createBorderLayout_S_Pane();
// small.setBackground(Color.WHITE);
small.add(new UILabel(StringUtils.BLANK), BorderLayout.NORTH);
small.add(layoutTable, BorderLayout.CENTER);
center.add(small, BorderLayout.CENTER);
center.add(downButton, BorderLayout.SOUTH);
southToolBar = new ToolBarPane();
southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
// southToolBar.setBackground(Color.lightGray);
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
SettingToolBar top = new SettingToolBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ToolBar_Top"), northToolBar);
northContentPane.add(top, BorderLayout.EAST);
northContentPane.add(northToolBar, BorderLayout.CENTER);
// northContentPane.setBackground(Color.lightGray);
//底部工具栏
JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
southToolBar = new ToolBarPane();
southToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
southToolBar.setOpaque(false);
SettingToolBar bottom = new SettingToolBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ToolBar_Bottom"), southToolBar);
bottom.setOpaque(false);
southContentPane.add(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER);
// southContentPane.setBackground(Color.lightGray);
southContentPane.setOpaque(false);
southContentPane.setBorder(new ScaledEmptyBorder(4,0,4,0));
JPanel bottomToolbarPanel = new JPanel(new BorderLayout());
bottomToolbarPanel.add(southContentPane);
bottomToolbarPanel.setBackground(FineUIUtils.getUIColor("Center.ZoneBorderColor", "defaultBorderColor"));
movePane.add(northContentPane, BorderLayout.NORTH);
movePane.add(center, BorderLayout.CENTER);
movePane.add(southContentPane, BorderLayout.SOUTH);
this.add(new JScrollPane(movePane), BorderLayout.CENTER);
isUseToolBarCheckBox.setSelected(true);
//工具栏面板center布局:顶部工具栏-上移动按钮-图标面板-下移动按钮-底部工具栏
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
movePane.add(column(1,
cell(topToolbarPanel),
cell(topButton),
cell(buttonTablePanel),
cell(downButton),
cell(bottomToolbarPanel)
).getComponent());
//工具栏整体面板
this.add(column(LayoutConstants.VERTICAL_GAP, cell(northPanel), cell(new JScrollPane(movePane))).getComponent());
}
/**
* 图标列表
*/
private void initLayoutTable() {
layoutTable = new JTable(toolbarButtonTableModel);
layoutTable.setDefaultRenderer(Object.class, tableRenderer);
layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
layoutTable.setColumnSelectionAllowed(false);
layoutTable.setRowSelectionAllowed(false);
// layoutTable.setBackground(Color.WHITE);
layoutTable.setOpaque(false);
layoutTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) {
@ -280,6 +306,7 @@ public class ToolBarDragPane extends WidgetToolBarPane {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
this.setOpaque(false);
if (value instanceof WidgetOption) {
WidgetOption nameOption = (WidgetOption)value;

3
designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java

@ -13,7 +13,7 @@ import com.fr.report.web.annotation.OldPrintMethod;
import javax.swing.BorderFactory;
import javax.swing.SwingUtilities;
import javax.swing.TransferHandler;
import java.awt.Component;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.MouseAdapter;
@ -55,6 +55,7 @@ public class ToolBarPane extends BasicBeanPane<ToolBar> {
public void initComponent() {
this.addMouseListener(listener);
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2));
this.setTransferHandler(new ToolBarHandler(TransferHandler.COPY));
this.setBorder(BorderFactory.createTitledBorder(""));
}

38
designer-realize/src/main/java/com/fr/design/webattr/ViewToolBarPane.java

@ -1,7 +1,9 @@
package com.fr.design.webattr;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
@ -9,7 +11,6 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.event.Listener;
import com.fr.report.web.Location;
@ -27,23 +28,24 @@ import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapBoldLabelWithUnderline;
public class ViewToolBarPane extends AbstractEditToolBarPane {
private EventPane eventPane;
private UICheckBox isUseToolBarCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_ToolBar"));
private UIButton editToolBarButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
private UILabel showListenersLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Editing_Listeners") + ":");
private UILabel showListenersLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Editing_Listeners"));
private UICheckBox sortCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Sort_Sort"));
private UICheckBox conditonFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Selection_Filter"));
private UICheckBox listFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_List_Filter"));
public ViewToolBarPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(allPanel, BorderLayout.CENTER);
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
allPanel.add(northPane, BorderLayout.NORTH);
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
editToolBarButton.addActionListener(editBtnListener);
isUseToolBarCheckBox.setSelected(true);
isUseToolBarCheckBox.addActionListener(new ActionListener() {
@ -56,13 +58,23 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
sortCheckBox.setSelected(false);
conditonFilterBox.setSelected(false);
listFilterBox.setSelected(false);
northPane.add(GUICoreUtils.createFlowPane(new Component[]{sortCheckBox, conditonFilterBox, listFilterBox}, FlowLayout.LEFT, 6));
northPane.add(GUICoreUtils.createFlowPane(new Component[] {isUseToolBarCheckBox, editToolBarButton}, FlowLayout.LEFT));
northPane.add(GUICoreUtils.createFlowPane(showListenersLabel, FlowLayout.LEFT));
JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(sortCheckBox), cell(conditonFilterBox), cell(listFilterBox)),
row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton))
).getComponent();
//事件编辑
JPanel eventPanel = new JPanel(new BorderLayout());
eventPane = new EventPane(new WebView().supportedEvents());
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
center.add(eventPane, BorderLayout.CENTER);
allPanel.add(center, BorderLayout.CENTER);
wrapBoldLabelWithUnderline(showListenersLabel);
eventPanel.add(column(LayoutConstants.VGAP_SMALL, cell(showListenersLabel), cell(eventPane).weight(1)).getComponent());
//整体布局
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(northPanel),
cell(eventPanel).weight(1)
).getComponent());
//wei : 默认没config.xml的情况下,就有默认工具栏
ToolBarManager toolBarManager = ToolBarManager.createDefaultViewToolBar();
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());

19
designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java

@ -4,18 +4,20 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebView;
import com.fr.web.attr.ReportWebAttr;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class ViewWebSettingPane extends WebSettingPane<WebView> {
private UICheckBox sortCheckBox;
private UICheckBox conditionFilterBox;
@ -25,17 +27,24 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
super();
}
/**
* 模板-模板Web属性-数据分析设置中其余设置面板通用部分在父类绘制
* @return
*/
@Override
protected JPanel createOtherSetPane() {
sortCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Sort_Sort"));
conditionFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Selection_Filter"));
listFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_List_Filter"));
sortCheckBox.setSelected(true);
conditionFilterBox.setSelected(true);
listFilterBox.setSelected(true);
return GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview") + ":"),
sortCheckBox, conditionFilterBox, listFilterBox}, FlowLayout.LEFT, 6);
return row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15),
cell(sortCheckBox).weight(0.15),
cell(conditionFilterBox).weight(0.15),
cell(listFilterBox).weight(0.15),
flex(0.4)
).getComponent();
}
@Override

47
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -1,5 +1,8 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.EditingStringListPane;
import com.fr.design.gui.ibutton.UIButton;
@ -16,57 +19,60 @@ import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.web.attr.ReportWebAttr;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
public class WebCssPane extends BasicPane {
private UITextField localText;
UIButton chooseFile;
private EditingStringListPane centerPane;
public WebCssPane() {
this.setLayout(new BorderLayout(0, 20));
this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
JPanel outnorth = new JPanel(new BorderLayout(0, 5));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT,8,0));
//磁盘文件
localText = new UITextField();
localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
localText.setEditable(false);
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection"));
chooseFile.setPreferredSize(new Dimension(75, 23));
chooseFile.addActionListener(chooseFileListener);
northPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Disk_File") + ":"), FlowLayout.LEFT);
northPane.add(localText, FlowLayout.CENTER);
northPane.add(chooseFile, FlowLayout.RIGHT);
outnorth.add(northPane,BorderLayout.NORTH);
UILabel infor = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning",
//红色提示信息
UILabel info = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning",
ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME));
infor.setForeground(new Color(207, 42, 39));
outnorth.add(infor,BorderLayout.CENTER);
this.add(outnorth, BorderLayout.NORTH);
FineUIStyle.setStyle(info, FineUIStyle.LABEL_WARNING_TIP);
centerPane = new EditingStringListPane() {
@Override
protected void selectedChanged(String selected) {
localText.setText(selected);
checkEnableState();
}
@Override
protected String getAddOrEditString() {
return localText.getText();
}
};
this.add(centerPane, BorderLayout.CENTER);
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Disk_File"))),
cell(localText).weight(0.8),
cell(chooseFile)
),
cell(info),
cell(centerPane)
).getComponent());
this.add(workPanel);
}
private ActionListener chooseFileListener = new ActionListener() {
@ -122,6 +128,5 @@ public class WebCssPane extends BasicPane {
String a = valueList.get(i);
reportWebAttr.addCSSImport(a);
}
}
}

79
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -1,5 +1,8 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.frpane.EditingStringListPane;
@ -19,15 +22,12 @@ import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.web.attr.ReportWebAttr;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
@ -40,6 +40,10 @@ import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
public class WebJsPane extends BasicPane {
private UITextField localText;
private UITextField urlText;
@ -48,15 +52,15 @@ public class WebJsPane extends BasicPane {
private EditingStringListPane editingPane;
UIButton chooseFile;
UIButton testConnection;
UILabel infor1;
UILabel infor2;
UILabel info1;
UILabel info2;
public WebJsPane() {
this.setLayout(new BorderLayout(0, 20));
this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Disk_File") + ":", true);
urlFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Url_Location")+ ":", false);
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Disk_File"), true);
urlFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Url_Location"), false);
ButtonGroup bg = new ButtonGroup();
bg.add(localFileRadioButton);
bg.add(urlFileRadioButton);
@ -85,38 +89,24 @@ public class WebJsPane extends BasicPane {
testConnection.setPreferredSize(chooseFile.getPreferredSize());
}
createNorthPane();
createEditingPane();
}
private void createNorthPane() {
JPanel outnorth = new JPanel(new BorderLayout(0, 5));
JPanel firstnorth = new JPanel(new BorderLayout(0, 5));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT,7,0));
northPane.add(localFileRadioButton);
northPane.add(localText);
northPane.add(chooseFile);
firstnorth.add(northPane,BorderLayout.NORTH);
infor1 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1",
ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME));
infor1.setForeground(new Color(207, 42, 39));
firstnorth.add(infor1,BorderLayout.CENTER);
JPanel secondnorth = new JPanel(new BorderLayout(0, 5));
JPanel centerPane = new JPanel(new FlowLayout(FlowLayout.LEFT,7,0));
centerPane.add(urlFileRadioButton);
centerPane.add(urlText);
centerPane.add(testConnection);
secondnorth.add(centerPane,BorderLayout.NORTH);
infor2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2", ProjectConstants.WEBAPP_NAME));
infor2.setForeground(new Color(207, 42, 39));
secondnorth.add(infor2,BorderLayout.CENTER);
outnorth.add(firstnorth,BorderLayout.NORTH);
outnorth.add(secondnorth,BorderLayout.CENTER);
this.add(outnorth, BorderLayout.NORTH);
info1 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1", ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME));
FineUIStyle.setStyle(info1, FineUIStyle.LABEL_WARNING_TIP);
info2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2", ProjectConstants.WEBAPP_NAME));
FineUIStyle.setStyle(info2, FineUIStyle.LABEL_WARNING_TIP);
JPanel outNorth = column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(localFileRadioButton), cell(localText).weight(0.8), cell(chooseFile)),
cell(info1),
row(LayoutConstants.HORIZONTAL_GAP, cell(urlFileRadioButton), cell(urlText).weight(0.8), cell(testConnection)),
cell(info2)
).getComponent();
JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(outNorth);
this.add(workPanel, BorderLayout.NORTH);
}
private void createEditingPane() {
@ -130,7 +120,7 @@ public class WebJsPane extends BasicPane {
if (url.matches("^[a-zA-z]+://.+js")) {
return url;
} else {
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning"));
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add_JS_warning"));
return "";
}
}
@ -153,6 +143,10 @@ public class WebJsPane extends BasicPane {
checkEnableState();
}
};
JPanel workPanel = new JPanel(new BorderLayout());
editingPane.setBorder(new ScaledEmptyBorder(10,0,0,0));
workPanel.add(editingPane);
this.add(editingPane, BorderLayout.CENTER);
}
@ -162,7 +156,6 @@ public class WebJsPane extends BasicPane {
}
private ActionListener chooseFileListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FILEChooserPane fileChooser = FILEChooserPane.getInstance(false, false, true,
@ -191,7 +184,7 @@ public class WebJsPane extends BasicPane {
public void actionPerformed(ActionEvent arg0) {
String uri = urlText.getText();
if (!uri.matches("^[a-zA-z]+://.+js")) {
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning"));
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add_JS_warning"));
return;
}
InputStream in = null;
@ -224,14 +217,14 @@ public class WebJsPane extends BasicPane {
localRadioSelectAction();
urlFileRadioButton.setForeground(new Color(143, 142, 139));
localFileRadioButton.setForeground(Color.black);
infor1.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1", ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME));
infor2.setText(" ");
info1.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1", ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME));
info2.setText(" ");
} else if (urlFileRadioButton.isSelected()) {
urlRadioSelectAction();
localFileRadioButton.setForeground(new Color(143, 142, 139));
urlFileRadioButton.setForeground(Color.black);
infor2.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2", ProjectConstants.WEBAPP_NAME));
infor1.setText(" ");
info2.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2", ProjectConstants.WEBAPP_NAME));
info1.setText(" ");
}
if (StringUtils.isEmpty(urlText.getText()) && StringUtils.isEmpty(localText.getText())) {
editingPane.setAddEnabled(false);

92
designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java

@ -1,13 +1,14 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.event.Listener;
import com.fr.report.web.ToolBarManager;
@ -22,6 +23,11 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapBoldLabelWithUnderline;
public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane<ReportWebAttr> {
private static final String[] CHOOSEITEM = new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single"),
@ -37,52 +43,58 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
private static final int ZERO = 0;
private static final long LONGZERO = 0L;
/**
* 模板-模板Web属性-分页预览设置/填报页面设置/数据分析设置通用面板
*/
public WebSettingPane() {
JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 6));
//以下设置
choseComboBox = new UIComboBox(CHOOSEITEM);
choseComboBox.addItemListener(itemListener);
buttonPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set") + ":"));
buttonPane.add(choseComboBox);
JPanel buttonPane = row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"))).weight(0.15),
cell(choseComboBox).weight(0.85)
).getComponent();
//工具栏
dragToolBarPane = new ToolBarDragPane();
dragToolBarPane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance());
JPanel eventpanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventpanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Set") + ':'), BorderLayout.NORTH);
eventPane = new EventPane(getEventNames());
eventpanel.add(eventPane, BorderLayout.CENTER);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] columnSize = {f};
JPanel othersetpane = createOtherSetPane();
JPanel panel ;
if (othersetpane != null) {
Component[][] components = new Component[][]{
new Component[]{buttonPane},
new Component[]{othersetpane},
new Component[]{dragToolBarPane},
new Component[]{eventpanel}
};
double[] rowSize1 = { p,p,p,f };
panel = TableLayoutHelper.createTableLayoutPane(components,rowSize1,columnSize);
//事件设置
JPanel eventPanel = new JPanel(new BorderLayout());
eventPane = new EventPane(getEventNames());
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Set"));
wrapBoldLabelWithUnderline(label);
eventPanel.add(column(LayoutConstants.VGAP_SMALL, cell(label), cell(eventPane)).getComponent());
//其余设置面板,不同页面中分别绘制
JPanel otherSetPane = createOtherSetPane();
//横向分割线
JPanel separatorLine = new JPanel();
separatorLine.setBorder(FineBorderFactory.createDefaultUnderlineBorder());
separatorLine.setPreferredSize(FineUIScale.scale(new Dimension(1, 1)));
//整体布局
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
if (otherSetPane != null) {
panel.add(column(LayoutConstants.VERTICAL_GAP,
cell(buttonPane),
cell(otherSetPane),
cell(separatorLine),
cell(dragToolBarPane),
cell(eventPanel)
).getComponent());
} else {
Component[][] components = new Component[][]{
new Component[]{buttonPane},
new Component[]{dragToolBarPane},
new Component[]{eventpanel}
};
double[] rowSize2 = { p,p,f };
panel = TableLayoutHelper.createTableLayoutPane(components,rowSize2,columnSize);
panel.add(column(LayoutConstants.VERTICAL_GAP,
cell(buttonPane),
cell(separatorLine),
cell(dragToolBarPane),
cell(eventPanel)
).getComponent());
}
this.setLayout(new BorderLayout());
UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane, BorderLayout.CENTER);
this.add(new UIScrollPane(panel));
}
ItemListener itemListener = new ItemListener() {

78
designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java

@ -1,9 +1,11 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
@ -14,7 +16,6 @@ import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.event.Listener;
import com.fr.report.web.Location;
@ -35,6 +36,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapBoldLabelWithUnderline;
public class WriteToolBarPane extends AbstractEditToolBarPane {
private EventPane eventPane;
private UICheckBox colorBox;
@ -45,66 +52,90 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private UILabel sheetShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Label_Page_Display_Position"));
private UIRadioButton centerRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Center_Display"));
private UIRadioButton leftRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Left_Display"));
private UILabel rptShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location") + ":", UILabel.LEFT);
private UILabel rptShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"));
private UICheckBox isUseToolBarCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_ToolBar"));
private UIButton editToolBarButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
private UILabel showListenersLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Editing_Listeners") + ":");
private UILabel showListenersLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Editing_Listeners"));
private UICheckBox unloadCheck;
private UICheckBox showWidgets;
private UICheckBox isAutoStash;//自动暂存
public WriteToolBarPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(allPanel, BorderLayout.CENTER);
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
allPanel.add(northPane, BorderLayout.NORTH);
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
//sheet标签页显示位置
ButtonGroup sheetButtonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true);
sheetButtonGroup.add(topRadioButton);
sheetButtonGroup.add(bottomRadioButton);
northPane.add(GUICoreUtils.createFlowPane(new Component[]{sheetShowLocationLabel, topRadioButton, bottomRadioButton}, FlowLayout.LEFT));
JPanel sheetPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(sheetShowLocationLabel),
cell(topRadioButton),
cell(bottomRadioButton)).getComponent();
//Sean:报表显示位置
ButtonGroup rptButtonGroup = new ButtonGroup();
leftRadioButton.setSelected(true);
rptButtonGroup.add(leftRadioButton);
rptButtonGroup.add(centerRadioButton);
northPane.add(GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT));
colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Face_Write_Current_Edit_Row_Background") + ":");
JPanel showLocPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(rptShowLocationLabel),
cell(centerRadioButton),
cell(leftRadioButton)
).getComponent();
//当前编辑行背景设置
colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Face_Write_Current_Edit_Row_Background"));
colorBox.setSelected(false);
colorBox.addActionListener(colorListener);
colorButton = new UINoThemeColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png"));
northPane.add(GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT));
colorButton = new UINoThemeColorButton(new LazyIcon("background"));
JPanel backgroundPane = row(cell(colorBox), fix(LayoutConstants.HGAP_SMALL), cell(colorButton)).getComponent();
//勾选框
unloadCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unload_Check"));
unloadCheck.setSelected(true);
showWidgets = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Show_Widgets"));
showWidgets.setSelected(false);
isAutoStash = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Auto_Stash"));
isAutoStash.setSelected(false);
northPane.add(GUICoreUtils.createFlowPane(new Component[]{unloadCheck, showWidgets, isAutoStash}, FlowLayout.LEFT));
JPanel unloadCheckPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(unloadCheck),
cell(showWidgets),
cell(isAutoStash)
).getComponent();
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
northPane.add(sheetPane);
northPane.add(showLocPane);
northPane.add(backgroundPane);
northPane.add(unloadCheckPane);
//工具栏编辑
editToolBarButton.addActionListener(editBtnListener);
isUseToolBarCheckBox.setSelected(true);
isUseToolBarCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
editToolBarButton.setEnabled(isUseToolBarCheckBox.isSelected());
}
});
northPane.add(GUICoreUtils.createFlowPane(new Component[]{isUseToolBarCheckBox, editToolBarButton}, FlowLayout.LEFT));
northPane.add(new UILabel());
northPane.add(GUICoreUtils.createFlowPane(showListenersLabel, FlowLayout.LEFT));
JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
cell(northPane),
row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton))
).getComponent();
//事件编辑
JPanel eventPanel = new JPanel(new BorderLayout());
eventPane = new EventPane(new WebWrite().supportedEvents());
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
center.add(eventPane, BorderLayout.CENTER);
allPanel.add(center, BorderLayout.CENTER);
wrapBoldLabelWithUnderline(showListenersLabel);
eventPanel.add(column(LayoutConstants.VGAP_SMALL, cell(showListenersLabel), cell(eventPane).weight(1)).getComponent());
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(northPanel),
cell(eventPanel).weight(1)
).getComponent());
//wei : 默认没config.xml的情况下,就有默认工具栏
ToolBarManager toolBarManager = ToolBarManager.createDefaultWriteToolBar();
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
@ -112,7 +143,6 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
}
private ActionListener editBtnListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
final DragToolBarPane dragToolbarPane = new DragToolBarPane();
dragToolbarPane.setDefaultToolBar(ToolBarManager.createDefaultWriteToolBar(), getToolBarInstance());

58
designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

@ -1,14 +1,14 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebWrite;
@ -16,13 +16,15 @@ import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
private UICheckBox colorBox;
private UIColorButton colorButton;
@ -40,47 +42,63 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
super();
}
/**
* 模板-模板Web属性-填报页面设置中其余设置面板通用部分在父类绘制
* @return
*/
@Override
protected JPanel createOtherSetPane() {
colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Background_Of_Current_Row") + ":");
colorBox.setSelected(true);
colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png"));
colorBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
colorButton.setEnabled(colorBox.isSelected());
}
});
JPanel backgroundPane = GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT);
//sheet标签页显示位置
topRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top"));
bottomRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"));
sheetShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Label_Page_Display_Position"), UILabel.LEFT);
sheetShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Label_Page_Display_Position"));
ButtonGroup buttonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton);
buttonGroup.add(bottomRadioButton);
JPanel sheetPane = GUICoreUtils.createFlowPane(new Component[]{sheetShowLocationLabel, topRadioButton, bottomRadioButton}, FlowLayout.LEFT);
JPanel sheetPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(sheetShowLocationLabel),
cell(topRadioButton),
cell(bottomRadioButton)).getComponent();
//Sean: 报表显示位置since 706
rptShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location") + ":", UILabel.LEFT);
rptShowLocationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"));
centerRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Center_Display"));
leftRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Left_Display"));
ButtonGroup rptShowButtonGroup = new ButtonGroup();
leftRadioButton.setSelected(true);
rptShowButtonGroup.add(centerRadioButton);
rptShowButtonGroup.add(leftRadioButton);
JPanel showLocPane = GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT);
JPanel showLocPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(rptShowLocationLabel),
cell(centerRadioButton),
cell(leftRadioButton)
).getComponent();
//填报当前编辑行背景设置
colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Background_Of_Current_Row"));
colorBox.setSelected(true);
colorButton = new UIColorButton(new LazyIcon("background"));
colorBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
colorButton.setEnabled(colorBox.isSelected());
}
});
JPanel backgroundPane = row(cell(colorBox), cell(colorButton)).getComponent();
//勾选设置
unloadCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unload_Check"));
unloadCheck.setSelected(true);
showWidgets = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Show_Widgets"));
showWidgets.setSelected(false);
isAutoStash = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Auto_Stash"));
isAutoStash.setSelected(false);
JPanel unloadCheckPane = GUICoreUtils.createFlowPane(new Component[]{unloadCheck, showWidgets, isAutoStash}, FlowLayout.LEFT);
JPanel unloadCheckPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(unloadCheck),
cell(showWidgets),
cell(isAutoStash)
).getComponent();
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
northPane.add(sheetPane);
northPane.add(showLocPane);

211
designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java

@ -1,8 +1,11 @@
package com.fr.design.webattr.printsettings;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.PaperSize;
import com.fr.base.Utils;
import com.fr.base.print.NativePrintAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
@ -12,8 +15,6 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.report.UnitFieldPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
@ -24,15 +25,12 @@ import com.fr.stable.StringUtils;
import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
@ -42,6 +40,12 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Created by plough on 2018/3/5.
*/
@ -82,37 +86,40 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
}
private void initComponents() {
JPanel printPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel northPane = getHeaderPane();
printPane.add(northPane, BorderLayout.NORTH);
centerPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Settings"));
centerPane.add(getNativePrintMainSettingPane());
printPane.add(centerPane, BorderLayout.CENTER);
//默认配置
initCenterPane();
JPanel printPane = column(LayoutConstants.VERTICAL_GAP,
cell(getHeaderPane()),
cell(wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Settings")))
).getComponent();
this.setLayout(new BorderLayout());
this.add(printPane, BorderLayout.CENTER);
}
/**
* 打印设置-本地软件打印-headerPane
* @return
*/
private JPanel getHeaderPane() {
UILabel tipDownload = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Native_Print_Need_Client"));
UILabel tipDownload = new UILabel("Fine-Design_Report_Tip_Native_Print_Need_Client");
FineUIStyle.setStyle(tipDownload, FineUIStyle.LABEL_TIP);
// 打印时需要打印设置窗口
showDialogCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Show_Print_Setting_Window_When_Printing"));
showDialogCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
UILabel showDialogCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Settings"));
JPanel showDialogCheckPane = GUICoreUtils.createFlowPane(new Component[]{
showDialogCheck, showDialogCheckTip}, FlowLayout.LEFT);
UILabel showDialogTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Settings"));
FineUIStyle.setStyle(showDialogTip, FineUIStyle.LABEL_TIP);
JPanel showDialogCheckPane = row(LayoutConstants.VERTICAL_GAP,
cell(showDialogCheck),
cell(showDialogTip)
).getComponent();
// 打印需要指定 sheet
needSelectSheetCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Need_Select_Sheet_When_Printing"));
needSelectSheetCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
UILabel needSelectSheetCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Invalid_In_Page_View"));
JPanel needSelectSheetCheckPane = GUICoreUtils.createFlowPane(new Component[]{
needSelectSheetCheck, needSelectSheetCheckTip}, FlowLayout.LEFT);
UILabel needSelectSheetTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Invalid_In_Page_View"));
FineUIStyle.setStyle(needSelectSheetTip, FineUIStyle.LABEL_TIP);
JPanel needSelectSheetCheckPane = row(LayoutConstants.VERTICAL_GAP,
cell(needSelectSheetCheck),
cell(needSelectSheetTip)
).getComponent();
return createHeaderPane(tipDownload, showDialogCheckPane, needSelectSheetCheckPane);
}
@ -166,62 +173,58 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
};
}
private JPanel getNativePrintMainSettingPane() {
/**
* 打印设置-本地软件打印-默认配置Pane
*/
private void initCenterPane() {
// 打印机
String[] printerArray = getAllPrinterNames();
printerComboBox = new UIComboBox(printerArray);
printerComboBox.setPreferredSize(new Dimension(200, printerComboBox.getPreferredSize().height));
JPanel printerPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
printerPane.add(printerComboBox);
printerComboBox = new UIComboBox(getAllPrinterNames());
// 份数
copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(copySpinner, 5);
JPanel copyPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
copyPane.add(copySpinner);
// 页码标签
JPanel printAreaLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
printAreaLabelPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number")), BorderLayout.NORTH);
printAreaLabelPane.setBorder(new ScaledEmptyBorder(2,0,0,0));
// 继承页面纸张设置
inheritPagePaperSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Paper_Setting"));
inheritPagePaperSettingCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Paper_Setting"));
JPanel paperSettingPane = getPaperSettingPane();
JPanel paperSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPagePaperSettingCheck, paperSettingPane, true);
// 继承页面布局设置
inheritPageLayoutSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Layout_Setting"));
JPanel layoutSettingPane = getLayoutSettingPane();
JPanel layoutSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPageLayoutSettingCheck, layoutSettingPane, true);
// 页码标签
UILabel printAreaLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number") + ":");
JPanel printAreaLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
printAreaLabelPane.add(printAreaLabel, BorderLayout.NORTH);
printAreaLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
// 边距
inheritPageMarginSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Margin_Setting"));
pageMarginSettingPane = new PageMarginSettingPane();
pageMarginSettingPane.setBorder(BorderFactory.createEmptyBorder(10, -10, 0, 0));
JPanel pageMarginCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPageMarginSettingCheck, pageMarginSettingPane, true);
// 缩放
fitPaperSizeCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_To_Fit_Paper_Size"));
JPanel scalePane = getScalePane();
scalePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
JPanel scaleCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(fitPaperSizeCheck, scalePane, true);
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {60, p};
Component[][] components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer") + ":"), printerPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number") + ":"), copyPane},
{printAreaLabelPane, getPrintAreaPane()},
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper") + ":"), paperSettingCheckPane},
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout") + ":"), layoutSettingCheckPane},
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin") + ":"), pageMarginCheckPane},
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce") + ":"), scaleCheckPane},
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 15);
// 整体布局
centerPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.1),
cell(printerComboBox).weight(0.35),
flex(0.55)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1),
cell(copySpinner).weight(0.15),
flex(0.75)),
row(cell(printAreaLabelPane).weight(0.1),
cell(getPrintAreaPane()).weight(0.7),
flex(0.2)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper"))).weight(0.1),
cell(paperSettingCheckPane).weight(0.5),
flex(0.4)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1),
cell(layoutSettingCheckPane).weight(0.2),
flex(0.7)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.1),
cell(pageMarginCheckPane).weight(0.5),
flex(0.4)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.1),
cell(scaleCheckPane).weight(0.3),
flex(0.6))
).getComponent();
}
private String[] getAllPrinterNames() {
@ -273,34 +276,24 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
}
});
// 下拉框
JPanel comboPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
comboPanel.add(predefinedPaperSizeComboBox);
comboPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));
customPaperSizePane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_M_Pane();
// 宽度设置
JPanel customWidthPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
customWidthPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":"));
customWidthFieldPane = new UnitFieldPane(Constants.UNIT_MM);
customWidthFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getWidth());
customWidthPane.add(customWidthFieldPane);
// 高度设置
JPanel customHeightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
customHeightPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":"));
customHeightFieldPane = new UnitFieldPane(Constants.UNIT_MM);
customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight());
customHeightPane.add(customHeightFieldPane);
customPaperSizePane.add(customWidthPane);
customPaperSizePane.add(customHeightPane);
customPaperSizePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(comboPanel, BorderLayout.NORTH);
panel.add(customPaperSizePane, BorderLayout.CENTER);
return panel;
customPaperSizePane = row(LayoutConstants.HORIZONTAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":")),
cell(customWidthFieldPane)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":")),
cell(customHeightFieldPane)
)
).getComponent();
return column(10, cell(predefinedPaperSizeComboBox), cell(customPaperSizePane)).getComponent();
}
private void updateCustomPaperSizeArea() {
@ -309,23 +302,19 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
}
private JPanel getLayoutSettingPane() {
JPanel layoutSettingPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
layoutSettingPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
portraitRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Portrait"));
portraitRadioButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape"));
layoutSettingPane.add(portraitRadioButton);
layoutSettingPane.add(landscapeRadioButton);
ButtonGroup layoutButtonGroup = new ButtonGroup();
layoutButtonGroup.add(portraitRadioButton);
layoutButtonGroup.add(landscapeRadioButton);
portraitRadioButton.setSelected(true);
return layoutSettingPane;
return row(10, cell(portraitRadioButton), cell(landscapeRadioButton)).getComponent();
}
// 页码范围
/**
* 页码范围
* @return
*/
private JPanel getPrintAreaPane() {
allPageRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_All_Pages"));
currentPageRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Current_Page"));
@ -363,17 +352,12 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
doublePrintComboBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Odd_Page"));
doublePrintComboBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Even_Page"));
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, p, p};
Component[][] components = {
{allPageRadioButton, null, null},
{currentPageRadioButton, null, null},
{customPageRadioButton, specifiedAreaField, areaFieldTip},
{doublePrintRadioButton, doublePrintComboBox, new JPanel()}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 8);
return column(LayoutConstants.VERTICAL_GAP,
cell(allPageRadioButton),
cell(currentPageRadioButton),
row(cell(customPageRadioButton).weight(0.1), cell(specifiedAreaField).weight(0.3), cell(areaFieldTip).weight(0.1)),
row(cell(doublePrintRadioButton).weight(0.1),cell(doublePrintComboBox).weight(0.3), flex(0.1))
).getComponent();
}
private JPanel getScalePane() {
@ -381,25 +365,12 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
scalePercentField.setMaxIntegerLength(3);
scalePercentField.setMaxDecimalLength(0);
scalePercentField.setMaxValue(200);
UILabel percent = new UILabel("%");
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, p};
Component[][] components = {
{scalePercentField, percent}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0);
return row(cell(scalePercentField), cell(new UILabel("%"))).getComponent();
}
// 返回包含一个标签的 panel,标签始终位于 panel 顶部
JPanel getTopAlignLabelPane(String labelText) {
JPanel labelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelPane.add(new UILabel(labelText), BorderLayout.NORTH);
labelPane.add(new JPanel(), BorderLayout.CENTER);
return labelPane;
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).getComponent();
}
public void populate(NativePrintAttr nativePrintAttr) {

76
designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java

@ -1,46 +1,41 @@
package com.fr.design.webattr.printsettings;
import com.fr.base.print.NativePrintAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 本地打印设置面板全局
* Created by plough on 2018/10/31.
*/
public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane {
private static final int PRINT_PORT_FIELD_COLUMNS = 8;
// 服务器配置面板特有的组件
private UICheckBox defaultDownloadUrlCheck; // 采用默认的软件下载地址
private UITextField customUrlFieldWin;
private UITextField customUrlFieldMac;
private UINumberField printPortField; // 打印软件端口号
@Override
JPanel createHeaderPane(Component... comps) {
Component[] allComps = new Component[comps.length + 1];
System.arraycopy(comps, 0, allComps, 0, comps.length);
allComps[comps.length] = getExtraSettingPane();
JPanel headerPane = GUICoreUtils.createHeaderLayoutPane(allComps);
headerPane.setBorder(BorderFactory.createEmptyBorder(2, 12, 5, 0));
return headerPane;
return GUICoreUtils.createHeaderLayoutPane(allComps);
}
@Override
protected void extraUpdate(NativePrintAttr nativePrintAttr) {
if (defaultDownloadUrlCheck.isSelected()) {
@ -61,56 +56,35 @@ public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane
printPortField.setValue(nativePrintAttr.getPrintPort());
}
// 服务器配置中,特有的设置面板
/**
* 服务器配置中特有的设置面板
* @return
*/
private JPanel getExtraSettingPane() {
// 软件下载地址
defaultDownloadUrlCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"));
JPanel downloadUrlSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(defaultDownloadUrlCheck, getCustomUrlSettingPane(), true);
downloadUrlSettingCheckPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
JPanel downloadTipPane = getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Software_Download_Url") + ": ");
downloadTipPane.setBorder(BorderFactory.createEmptyBorder(0, 0, -6, 0));
JPanel downloadUrlTitle = getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Software_Download_Url"));
// 打印软件端口号
UILabel printPortTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Native_Print_Port") + ": ");
JPanel printPortFiledPane = getPrintPortFieldPane();
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, p};
Component[][] components = {
{
downloadTipPane, downloadUrlSettingCheckPane
}, {
printPortTip, printPortFiledPane
}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0);
}
private JPanel getPrintPortFieldPane() {
UILabel printPortTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Native_Print_Port"));
printPortField = new UIIntNumberField();
printPortField.setMaxValue(NativePrintAttr.MAX_PRINT_PORT_VALUE);
printPortField.setColumns(PRINT_PORT_FIELD_COLUMNS);
JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
panel.add(printPortField);
return panel;
return column(LayoutConstants.VERTICAL_GAP,
row(cell(downloadUrlTitle).weight(0.25), cell(downloadUrlSettingCheckPane).weight(0.75)),
row(cell(printPortTip).weight(0.25), cell(printPortField).weight(0.25), flex(0.5))
).getComponent();
}
/**
* 自定义软件下载地址Pane
* @return
*/
private JPanel getCustomUrlSettingPane() {
customUrlFieldWin = new UITextField(20);
customUrlFieldMac = new UITextField(20);
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {60, p};
Component[][] components = {
{new UILabel("windows: "), customUrlFieldWin},
{new UILabel("macOS: "), customUrlFieldMac}
};
JPanel urlSettingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 10);
urlSettingPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
return urlSettingPane;
return column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel("windows")).weight(0.2), cell(customUrlFieldWin).weight(0.6), flex(0.2)).weight(1),
row(cell(new UILabel("macOS")).weight(0.2), cell(customUrlFieldMac).weight(0.6), flex(0.2)).weight(1)
).getComponent();
}
}

75
designer-realize/src/main/java/com/fr/design/webattr/printsettings/NoClientPrintSettingPane.java

@ -1,21 +1,24 @@
package com.fr.design.webattr.printsettings;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.print.NoClientPrintAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* 零客户端打印设置面板
* Created by plough on 2018/3/5.
@ -34,60 +37,48 @@ public class NoClientPrintSettingPane extends JPanel {
}
private void initComponents() {
JPanel printPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
printPane.add(createHeaderPane(), BorderLayout.NORTH);
initCenterPane();
printPane.add(centerPane, BorderLayout.CENTER);
JPanel printPane = column(LayoutConstants.VERTICAL_GAP,
cell(createHeaderPane()),
cell(wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Settings")))
).getComponent();
this.setLayout(new BorderLayout());
this.add(printPane, BorderLayout.CENTER);
}
/**
* 打印设置-零客户端打印-默认配置
*/
private void initCenterPane() {
centerPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Settings"));
inheritPageMarginSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Margin_Setting"));
pageMarginSettingPane = new PageMarginSettingPane();
pageMarginSettingPane.setBorder(BorderFactory.createEmptyBorder(10, -10, 0, 0));
JPanel pageMarginCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPageMarginSettingCheck, pageMarginSettingPane, true);
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {60, p};
Component[][] components = {
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin") + ":"), pageMarginCheckPane}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 15);
centerPane.add(panel);
centerPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))),
cell(pageMarginCheckPane)).getComponent();
}
/**
* 打印设置-零客户端打印-headerPane
* @return
*/
private JPanel createHeaderPane() {
//打印时可设置打印边距
setMarginWhenPrintCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Set_Margin_When_Printing"));
setMarginWhenPrintCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
UILabel marginTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Print_Margin"));
JPanel setMarginWhenPrintPane = GUICoreUtils.createFlowPane(new Component[] {
setMarginWhenPrintCheck, marginTip}, FlowLayout.LEFT);
UILabel setMarginWhenPrintTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Print_Margin"));
FineUIStyle.setStyle(setMarginWhenPrintTip, FineUIStyle.LABEL_TIP);
ieQuietPrintCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_No_Print_Settings_In_IE"));
ieQuietPrintCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
//针式打印优化
needlePrinterOptimizeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Needle_Printer_Optimize"));
needlePrinterOptimizeCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
UILabel needleTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Needle_Printer_Optimize_Tip"));
JPanel needlePrinterOptimizePane = GUICoreUtils.createFlowPane(new Component[] {
needlePrinterOptimizeCheck, needleTip}, FlowLayout.LEFT);
JPanel headerPane = GUICoreUtils.createHeaderLayoutPane(setMarginWhenPrintPane, ieQuietPrintCheck, needlePrinterOptimizePane);
headerPane.setBorder(BorderFactory.createEmptyBorder(2, 12, 12, 0));
return headerPane;
UILabel needlePrinterOptimizeTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Needle_Printer_Optimize_Tip"));
FineUIStyle.setStyle(needlePrinterOptimizeTip, FineUIStyle.LABEL_TIP);
return column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(setMarginWhenPrintCheck), cell(setMarginWhenPrintTip)),
cell(ieQuietPrintCheck),
row(LayoutConstants.HORIZONTAL_GAP, cell(needlePrinterOptimizeCheck), cell(needlePrinterOptimizeTip))
).getComponent();
}
private void initListeners() {
setMarginWhenPrintCheck.addItemListener(new ItemListener() {
@Override

43
designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java

@ -1,8 +1,8 @@
package com.fr.design.webattr.printsettings;
import com.fr.base.Margin;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.UnitFieldPane;
import com.fr.stable.Constants;
@ -10,6 +10,10 @@ import com.fr.stable.Constants;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Created by plough on 2018/3/5.
*/
@ -23,40 +27,25 @@ public class PageMarginSettingPane extends JPanel {
initComponents();
}
private void initComponents() {
// 页边距设置面板
JPanel marginPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_M_Pane();
// left
JPanel marginLeftPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
marginPane.add(marginLeftPane);
JPanel marginLeftTextPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginLeftPane.add(marginLeftTextPane);
marginLeftTextPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":"));
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginLeftTextPane.add(marginTopUnitFieldPane);
JPanel marginLeftUnitPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginLeftPane.add(marginLeftUnitPane);
marginLeftUnitPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":"));
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginLeftUnitPane.add(marginBottomUnitFieldPane);
// right
JPanel marginRightPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
marginPane.add(marginRightPane);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane))
).getComponent();
// peter:这个一个垂直的上下的字符panel.
JPanel marginRightTextPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginRightPane.add(marginRightTextPane);
marginRightTextPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":"));
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightTextPane.add(marginLeftUnitFieldPane);
JPanel marginRightUnitPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
marginRightPane.add(marginRightUnitPane);
marginRightUnitPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right") + ":"));
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitPane.add(marginRightUnitFieldPane);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")), cell(marginLeftUnitFieldPane)),
row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right") + ":")), cell(marginRightUnitFieldPane))
).getComponent();
JPanel marginPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(marginLeftPane),
cell(marginRightPane)).getComponent();
this.setLayout(new BorderLayout());
this.add(marginPane, BorderLayout.CENTER);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save