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 BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel"; String LABEL_BOLD = "boldLabel";
String LABEL_TIP = "tipLabel"; String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel";
String PLAIN_BUTTON = "plainButton"; String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup"; String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton"; 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; package com.fr.design.data.datapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.impl.RecursionTableData; import com.fr.data.impl.RecursionTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; 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.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.List; 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 { public class TreeTableDataDictPane extends BasicPane implements Previewable {
private UILabel selectTableDataLabel; private UILabel selectTableDataLabel;
@ -54,23 +58,28 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
} }
public TreeTableDataDictPane(String treeName) { public TreeTableDataDictPane(String treeName) {
this.setLayout(new BorderLayout(5, 30)); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 0)); this.setBorder(new ScaledEmptyBorder(10,10,10,10));
selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") + " :"); //请选择一个数据集
selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") );
setTableDataNameComboBox(treeName); setTableDataNameComboBox(treeName);
tableDataNameComboBox.setPreferredSize(new Dimension(180, 20));
JPanel tableFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
tableFlowPane.add(selectTableDataLabel);
tableFlowPane.add(tableDataNameComboBox);
tableDataNameComboBox.addItemListener(new ItemListener() { tableDataNameComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
tdChange(true); tdChange(true);
} }
}); });
tableFlowPane.add(new PreviewLabel(this)); JPanel tableFlowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(tableFlowPane, BorderLayout.NORTH); 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(); 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); 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")); lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length"));
parentMarkRadio.addItemListener(new ItemListener() { parentMarkRadio.addItemListener(new ItemListener() {
@ -95,45 +104,44 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
markButtonGroup.add(parentMarkRadio); markButtonGroup.add(parentMarkRadio);
markButtonGroup.add(lengthMarkRadio); 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); originFieldDependsOnParentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"));
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); parentFieldLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field"));
treeDataFieldLabel2 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT); 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()}); originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
parentFieldPane = 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()}); originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
makeParentEnable(); makeParentEnable();
JPanel p1 = createCenterFlowZeroGapBorderPane(originFieldDependsOnParentLabel, originFieldDependsOnParentPane); //树数据集面板
JPanel p2 = createCenterFlowZeroGapBorderPane(parentFieldLabel, parentFieldPane); centerPane.add(column(10,
JPanel border1 = new JPanel(); cell(parentMarkRadio),
border1.setLayout(new BorderLayout(0, 10)); row(LayoutConstants.HGAP_LARGE,
border1.add(p1, BorderLayout.NORTH); cell(originFieldDependsOnParentLabel).weight(0.12),
border1.add(p2, BorderLayout.CENTER); cell(originFieldDependsOnParentPane).weight(0.3),
JPanel p4 = createCenterFlowZeroGapBorderPane(originFieldDependsOnLengthLabel, originFieldDependsOnLengthPane); flex(0.58)
JPanel border2 = new JPanel(); ),
border2.setLayout(new BorderLayout(0, 20)); row(LayoutConstants.HGAP_LARGE,
border2.add(p4, BorderLayout.NORTH); 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); JPanel previewPanel = new JPanel(new BorderLayout());
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();
UIButton treeDataPreviewButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); 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() { treeDataPreviewButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -163,7 +171,8 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
PreviewTablePane.previewTableData(rtd); 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) { 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 java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell; 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.row;
import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/** /**
* Database Connection pane. * Database Connection pane.
@ -280,9 +282,13 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
// ChartSet // ChartSet
String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")}; String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")};
charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY)); charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY));
JPanel chartSetPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); JPanel chartSetPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
chartSetPane.add(GUICoreUtils.createNamedPane(charSetComboBox, Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":")); chartSetPane.add(row(
advancedPanel.add(chartSetPane); 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) { 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; package com.fr.design.data.datapane.connect;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.HashMap; import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import javax.naming.Context; import javax.naming.Context;
import javax.swing.BorderFactory;
import javax.swing.JDialog; 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 com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.FRExplainLabel; import com.fr.design.gui.ilable.FRExplainLabel;
import com.fr.design.layout.FRGUIPaneFactory; 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.design.dialog.BasicPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; 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 { public class JNDIDefPane extends JPanel {
private static Map<String, String> jndiMap = new HashMap<String, String>(); private static Map<String, String> jndiMap = new HashMap<String, String>();
@ -66,57 +68,51 @@ public class JNDIDefPane extends JPanel {
private JDialog otherAttrDialog; private JDialog otherAttrDialog;
public JNDIDefPane() { public JNDIDefPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(new BorderLayout());
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);
jndiNameTextField = new UITextField(20);
JNDIFactoryComboBox = new UIComboBox(new String[] { "", "weblogic.jndi.WLInitialContextFactory", "com.ibm.websphere.naming.WsnInitialContextFactory", 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", }); "org.jboss.naming.HttpNamingContextFactory", "org.jnp.interfaces.NamingContextFactory", "com.caucho.burlap.BurlapContextFactory", });
JNDIFactoryComboBox.setEditable(true); JNDIFactoryComboBox.setEditable(true);
JNDIFactoryComboBox.addActionListener(jndiListener); JNDIFactoryComboBox.addActionListener(jndiListener);
JNDIFactoryComboBox.setPreferredSize(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2)); JNDIFactoryComboBox.setPreferredSize(FineUIScale.scale(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2)));
// ContextPane // 上下文
double f = TableLayout.FILL; JPanel contextPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double p = TableLayout.PREFERRED; contextPane.add(column(LayoutConstants.VERTICAL_GAP,
double[] rowSize = { p, p, p, p }; row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("INITIAL_CONTEXT_FACTORY")).weight(0.35), cell(JNDIFactoryComboBox).weight(0.65)),
double[] columnSize = { f, f }; row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("PROVIDER_URL")).weight(0.35), cell(PROVIDER_URL_TF).weight(0.65)),
Component[][] comps = { { new UILabel("INITIAL_CONTEXT_FACTORY:", SwingConstants.RIGHT), JNDIFactoryComboBox }, row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("SECURITY_PRINCIPAL")).weight(0.35), cell(SECURITY_PRINCIPAL_TF).weight(0.65)),
{ new UILabel("PROVIDER_URL:", SwingConstants.RIGHT), PROVIDER_URL_TF }, { new UILabel("SECURITY_PRINCIPAL:", SwingConstants.RIGHT), SECURITY_PRINCIPAL_TF }, row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("SECURITY_CREDENTIALS")).weight(0.35), cell(SECURITY_CREDENTIALS_TF).weight(0.65))
{ new UILabel("SECURITY_CREDENTIALS:", SwingConstants.RIGHT), SECURITY_CREDENTIALS_TF } }; ).getComponent());
centerPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, columnSize, 2));
//其他属性
// ActionLabel JPanel otherAttributePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel actionPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(actionPane);
actionPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 6));
ActionLabel actionLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Other_Attributes")); 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() { actionLabel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
//其他属性弹窗
JDialog wDialog = createJDialog(); JDialog wDialog = createJDialog();
wDialog.setVisible(true); 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 private JPanel getTopAlignLabelPane(String labelText) {
UILabel explainLabe11l = new FRExplainLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_DES")); return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText)))
innerthis.add(new JScrollPane(explainLabe11l)); .with(it -> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
} }
public void populate(JNDIDatabaseConnection jndiDatabase) { public void populate(JNDIDatabaseConnection jndiDatabase) {
@ -216,21 +212,23 @@ public class JNDIDefPane extends JPanel {
class OtherAttrPane extends BasicPane { class OtherAttrPane extends BasicPane {
public OtherAttrPane() { public OtherAttrPane() {
// JPanel northFlowPane // JPanel northFlowPane
JPanel northFlowPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel northFlowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(northFlowPane, BorderLayout.NORTH); northFlowPane.setBorder(new ScaledEmptyBorder(10,10,10,10));
// ContextPane // ContextPane
double f = TableLayout.FILL; northFlowPane.add(column(LayoutConstants.VERTICAL_GAP,
double[] rowSize = { f, f, f, f, f, f, f, f, f, f, f }; row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("OBJECT_FACTORIES")).weight(0.35), cell(OBJECT_FACTORIES_TF)).weight(0.65),
double[] columnSize = { f, f }; row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("STATE_FACTORIES")).weight(0.35), cell(STATE_FACTORIES_TF)).weight(0.65),
Component[][] comps = { { new UILabel("OBJECT_FACTORIES:", SwingConstants.RIGHT), OBJECT_FACTORIES_TF }, row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("URL_PKG_PREFIXES")).weight(0.35), cell(URL_PKG_PREFIXES_TF)).weight(0.65),
{ new UILabel("STATE_FACTORIES:", SwingConstants.RIGHT), STATE_FACTORIES_TF }, { new UILabel("URL_PKG_PREFIXES:", SwingConstants.RIGHT), URL_PKG_PREFIXES_TF }, row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("DNS_URL")).weight(0.35), cell(DNS_URL_TF)).weight(0.65),
{ new UILabel("DNS_URL:", SwingConstants.RIGHT), DNS_URL_TF }, { new UILabel("AUTHORITATIVE:", SwingConstants.RIGHT), AUTHORITATIVE_TF }, row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("AUTHORITATIVE")).weight(0.35), cell(AUTHORITATIVE_TF)).weight(0.65),
{ new UILabel("BATCHSIZE:", SwingConstants.RIGHT), BATCHSIZE_TF }, { new UILabel("REFERRAL:", SwingConstants.RIGHT), REFERRAL_TF }, row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("BATCHSIZE")).weight(0.35), cell(BATCHSIZE_TF)).weight(0.65),
{ new UILabel("SECURITY_PROTOCOL:", SwingConstants.RIGHT), SECURITY_PROTOCOL_TF }, row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("REFERRAL")).weight(0.35), cell(REFERRAL_TF)).weight(0.65),
{ new UILabel("SECURITY_AUTHENTICATION:", SwingConstants.RIGHT), SECURITY_AUTHENTICATION_TF }, { new UILabel("LANGUAGE:", SwingConstants.RIGHT), LANGUAGE_TF }, row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("SECURITY_PROTOCOL")).weight(0.35), cell(SECURITY_PROTOCOL_TF)).weight(0.65),
{ new UILabel("APPLET:", SwingConstants.RIGHT), APPLET_TF } }; row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("SECURITY_AUTHENTICATION")).weight(0.35), cell(SECURITY_AUTHENTICATION_TF)).weight(0.65),
northFlowPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, columnSize, 2)); 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 @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.ActionEvent;
import java.awt.event.ActionListener; 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; import com.fr.design.gui.ibutton.UIButton;
@ -16,7 +17,7 @@ public class PreviewLabel extends UIButton {
Previewable previewable; Previewable previewable;
public PreviewLabel(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.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.setCursor(new Cursor(Cursor.HAND_CURSOR)); this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.previewable = previewable; this.previewable = previewable;
@ -27,7 +28,7 @@ public class PreviewLabel extends UIButton {
PreviewLabel.this.previewable.preview(); PreviewLabel.this.previewable.preview();
} }
}); });
this.setPreferredSize(new Dimension(24, 20)); this.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
} }
public static interface Previewable { 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; package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.data.impl.ClassTableData; import com.fr.data.impl.ClassTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; 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.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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.general.IOUtils;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
@ -23,35 +23,29 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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> { public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private UITextField classNameTextField; private UITextField classNameTextField;
private UITableEditorPane<ParameterProvider> editorPane; private UITableEditorPane<ParameterProvider> editorPane;
public ClassTableDataPane() { public ClassTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
// 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);
//类名
classNameTextField = new UITextField();
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select"));
browserButton.setPreferredSize(new Dimension( browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height));
browserButton.getPreferredSize().width,
classNameTextField.getPreferredSize().height));
reportletNamePane.add(browserButton);
browserButton.addActionListener(new ActionListener() { browserButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
final ClassNameSelectPane bPane = new ClassNameSelectPane(); final ClassNameSelectPane bPane = new ClassNameSelectPane();
@ -69,15 +63,26 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
} }
}); });
Component[][] components = { JPanel tipPanel = column(LayoutConstants.VERTICAL_GAP,
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name") + ":"), reportletNamePane}, cell(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_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\"")),
{null, 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))))
{null,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 = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); 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(northPane, BorderLayout.NORTH);
this.add(initSouthPanel(), BorderLayout.SOUTH); this.add(initSouthPanel(), BorderLayout.CENTER);
} }
private JPanel initSouthPanel() { private JPanel initSouthPanel() {
JPanel jpanel = new JPanel(); 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")); }, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para"));
jpanel.add(editorPane, BorderLayout.CENTER); jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel; 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; package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -52,7 +53,8 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// additional methods // additional methods
protected void initComponents() { 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 // prepare the data in this way as default if no arguments is passed in
dataJTable = new JTable(new EmbeddedTableModel(new EmbeddedTableData())); dataJTable = new JTable(new EmbeddedTableModel(new EmbeddedTableData()));
@ -84,7 +86,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// peter:控制Panel // peter:控制Panel
JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0)); //northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0));
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。 // kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0"); 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; 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.Parameter;
import com.fr.base.ParameterHelper; import com.fr.base.ParameterHelper;
import com.fr.base.Utils; 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.TextTableData;
import com.fr.data.impl.XMLTableData; import com.fr.data.impl.XMLTableData;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane; 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.itoolbar.UIToolbar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit; 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.mainframe.DesignerContext;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils; 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.XMLReadable;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -62,9 +62,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -80,6 +78,12 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; 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> { public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private static final int TEXT = 0; private static final int TEXT = 0;
private static final int EXCEL = 1; private static final int EXCEL = 1;
@ -104,8 +108,6 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIButton testConnection; private UIButton testConnection;
private XMLNodeTree xmlNodeTree; private XMLNodeTree xmlNodeTree;
private Parameter[] params; private Parameter[] params;
private JPanel filePath;
private XMLNodeTreePane nodeTreePane;
private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题 private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题
private UIRadioButton tableDismemberRadioButton;// 制表符 private UIRadioButton tableDismemberRadioButton;// 制表符
@ -116,41 +118,32 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一 private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一
private UIComboBox charsetComboBox; private UIComboBox charsetComboBox;
private UILabel encodeLabel; private UILabel encodeLabel;
private UILabel dismenberLabel;
private UILabel keyPointLaber; private UILabel keyPointLaber;
private ExpandMutableTreeNode selectedNode = null; private ExpandMutableTreeNode selectedNode = null;
private ExpandMutableTreeNode finalSelectedNode = null; private ExpandMutableTreeNode finalSelectedNode = null;
private ArrayList<String> xmlColumnsList = new ArrayList<String>(); private ArrayList<String> xmlColumnsList = new ArrayList<String>();
private static final int SETPANELWIDTH = 337; private static final double LOCAL_WIDTH_RATIO = 0.62;
private static final int WIDTH = 317; private static final double URL_WIDTH_RATIO = 0.56;
private static final int HEIGHT = 453;
private static final int GAP = 23;
public FileTableDataPane() { public FileTableDataPane() {
this(SETPANELWIDTH, WIDTH, HEIGHT, GAP); this(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
} }
public FileTableDataPane(int setPanelWidth, int width, int height, int gap) { public FileTableDataPane(double localWidthRatio, double urlWidthRatio) {
this.setLayout(new BorderLayout(gap, 0)); this.setLayout(new BorderLayout());
JPanel northPanel = new JPanel(new BorderLayout()); this.setBorder(new ScaledEmptyBorder(10,10,10,10));
JPanel type = new JPanel(); //文件类型
type.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type") + ":")); JPanel fileType = new JPanel(new BorderLayout());
String[] item = {"TXT", "Excel", "XML"}; String[] item = {"TXT", "Excel", "XML"};
fileTypeComboBox = new UIComboBox(item); fileTypeComboBox = new UIComboBox(item);
fileTypeComboBox.setPreferredSize(new Dimension(100, 20)); fileType.add(row(LayoutConstants.HGAP_LARGE,
type.add(fileTypeComboBox); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"))).weight(0.12),
northPanel.add(type, BorderLayout.WEST); 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() { ParameterTableModel model = new ParameterTableModel() {
@Override @Override
public UITableEditAction[] createAction() { public UITableEditAction[] createAction() {
@ -158,65 +151,75 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} }
}; };
editorPane = new UITableEditorPane<ParameterProvider>(model); editorPane = new UITableEditorPane<ParameterProvider>(model);
editorPane.setPreferredSize(new Dimension(355, 130)); editorPane.setBorder(new ScaledEmptyBorder(0,0,0,10));
centerPanel.add(editorPane, BorderLayout.SOUTH); editorPane.setPreferredSize(FineUIScale.scale(new Dimension(-1, 150)));
JPanel southPanel = new JPanel(new BorderLayout()); //左侧文件地址pane
JPanel setPanel = new JPanel(); JPanel leftPanel = new JPanel(new BorderLayout());
southPanel.add(setPanel, BorderLayout.CENTER); leftPanel.add(column(
setPanel.setPreferredSize(new Dimension(setPanelWidth, 460)); LayoutConstants.VERTICAL_GAP,
setPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"))); cell(getCenterPanel(localWidthRatio, urlWidthRatio)),
JPanel controlPane = textSetPanel(width, height); cell(editorPane)
setPanel.add(controlPane, BorderLayout.NORTH); ).getComponent());
fileTypeComboBox.addActionListener(getFileTypeListener(setPanel, width, height)); //右侧设定pane
JPanel rightPanel = new JPanel(new BorderLayout());
this.add(northPanel, BorderLayout.NORTH); rightPanel.setBorder(new ScaledEmptyBorder(0,0,0,10));
this.add(centerPanel, BorderLayout.CENTER); rightPanel.add(getTextSetPanel());
this.add(southPanel, BorderLayout.EAST); fileTypeComboBox.addActionListener(getFileTypeListener(rightPanel));
}
//文件数据集整体布局,服务器数据集/模板数据集下的文件数据集,创建文件数据集,三处面板通用布局
private void addToCenterPanel(JPanel centerPanel) { this.add(column(LayoutConstants.VERTICAL_GAP,
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File") + ":", true); cell(fileType),
urlFileRadioButton = new UIRadioButton("URL:", false); 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(); ButtonGroup bg = new ButtonGroup();
bg.add(localFileRadioButton); bg.add(localFileRadioButton);
bg.add(urlFileRadioButton); bg.add(urlFileRadioButton);
localFileRadioButton.addActionListener(radioActionListener); localFileRadioButton.addActionListener(radioActionListener);
urlFileRadioButton.addActionListener(radioActionListener); urlFileRadioButton.addActionListener(radioActionListener);
urlFileRadioButton.setForeground(new Color(143, 142, 139));
localFileRadioButton.setForeground(Color.black);
localText = new UITextField(); localText = new UITextField();
localText.setPreferredSize(new Dimension(195, 20));
urlText = new UITextField(); urlText = new UITextField();
urlText.setPreferredSize(new Dimension(195, 20));
urlText.setEditable(false); urlText.setEditable(false);
// 选择按钮
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Selection")); chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Selection"));
chooseFile.addActionListener(chooseFileListener); chooseFile.addActionListener(chooseFileListener);
// 测试连接按钮
testConnection = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); testConnection = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"));
testConnection.setEnabled(false); testConnection.setEnabled(false);
testConnection.addActionListener(testConnectionListener);// 测试连接按钮 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,提示信息
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>" 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> "; + "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips = new UILabel(tipContent); 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() { 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()); JPanel previewPanel = new JPanel(new BorderLayout());
UIButton preview = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); UIButton preview = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
preview.addActionListener(new ActionListener() { preview.addActionListener(new ActionListener() {
@ -259,56 +262,33 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} }
}); });
previewPanel.add(preview, BorderLayout.EAST); 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 // xml设置pane
JPanel controlPane = new JPanel(); encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
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") + ":");
encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
encodingComboBox.setSelectedIndex(4); encodingComboBox.setSelectedIndex(4);
encodingComboBox.setPreferredSize(new Dimension(90, 20)); return column(
LayoutConstants.VGAP_MEDIUM,
JPanel treeContainerPane = new JPanel(); row(LayoutConstants.HORIZONTAL_GAP, cell(encodeLabel).weight(0.2), cell(encodingComboBox).weight(0.8)),
treeContainerPane.setLayout(new BorderLayout(8, 8)); cell(new XMLNodeTreePane()),
nodeTreePane = new XMLNodeTreePane(); cell(getPreviewPanel())
treeContainerPane.add(nodeTreePane, BorderLayout.CENTER); ).getComponent();
}
comboboxPanel.add(encodeLabel, BorderLayout.WEST); /**
comboboxPanel.add(encodingComboBox, BorderLayout.CENTER); * Excel设定Pane
* @return
northPane.add(comboboxPanel, BorderLayout.EAST); */
northTopPane.add(northPane, BorderLayout.WEST); private JPanel getExcelSetPanel() {
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));
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false); needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false);
needColumnNameCheckBox.setPreferredSize(new Dimension(checkBoxWidth, 20)); return column(cell(needColumnNameCheckBox), cell(getPreviewPanel())).getComponent();
northPane.add(needColumnNameCheckBox, BorderLayout.EAST);
controlPane.add(northPane, BorderLayout.NORTH);
previewPanel(controlPane);
return controlPane;
} }
private String getFilePathFromUrlOrLocal() { private String getFilePathFromUrlOrLocal() {
@ -346,34 +326,31 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
// return (uri.matches("https*://.+|\\$\\{.+\\}.*")); // return (uri.matches("https*://.+|\\$\\{.+\\}.*"));
} }
private JPanel textSetPanel(int width, int height) { /**
// text设置pane * TXT设定Pane
JPanel controlPane = new JPanel(); * @return
controlPane.setLayout(new BorderLayout()); */
controlPane.setPreferredSize(new Dimension(width, height)); private JPanel getTextSetPanel() {
JPanel northPane = new JPanel(new BorderLayout(8, 8)); initRatioButton();
addToNorthPane(northPane); //编码类型
controlPane.add(northPane, BorderLayout.WEST); encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
previewPanel(controlPane); charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
return controlPane; return column(cell(getTxtCenterPane()), cell(getPreviewPanel())).getComponent();
} }
private void addToNorthPane(JPanel northPane) { /**
double f = TableLayout.FILL; * 初始化Button
double p = TableLayout.PREFERRED; */
double[] columnSize = {f, p, p}; private void initRatioButton(){
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") + ":");
tableDismemberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"), false); 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")); 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 = 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")); 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 = 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")); 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")); otherDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"));
otherDismenberTextField = new UITextField(8); otherDismenberTextField = new UITextField();
otherDismenberTextField.setEditable(false); otherDismenberTextField.setEditable(false);
otherDismenberRadioButton.addChangeListener(new ChangeListener() { otherDismenberRadioButton.addChangeListener(new ChangeListener() {
@Override @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(); ButtonGroup bg2 = new ButtonGroup();
bg2.add(tableDismemberRadioButton); bg2.add(tableDismemberRadioButton);
bg2.add(spaceDismenberRadioButton); bg2.add(spaceDismenberRadioButton);
@ -392,18 +370,38 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
bg2.add(otherDismenberRadioButton); bg2.add(otherDismenberRadioButton);
ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true); ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true);
UIComponentUtils.setLineWrap(ignoreOneMoreDelimiterCheckBox); 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}, * 获取TXT中心Pane
{dismenberLabel, tableDismemberRadioButton, null}, * @return
{null, spaceDismenberRadioButton, null}, */
{null, commaDismenberRadioButton, null}, private JPanel getTxtCenterPane(){
{null, otherDismenberRadioButton, otherDismenberTextField}, //分隔符选项
{ignoreOneMoreDelimiterCheckBox, null, null} JPanel separatorOptionsPanel = column(
}; LayoutConstants.VERTICAL_GAP,
northPane.add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.EAST); 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() { private ActionListener radioActionListener = new ActionListener() {
@ -480,24 +478,24 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
return suffixToString; return suffixToString;
} }
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) { private ActionListener getFileTypeListener(final JPanel rightPanel) {
ActionListener fileTypeListener = new ActionListener() { ActionListener fileTypeListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
setPanel.removeAll(); rightPanel.removeAll();
localText.setText(""); localText.setText("");
urlText.setText(""); urlText.setText("");
if (fileTypeComboBox.getSelectedIndex() == XML) { if (fileTypeComboBox.getSelectedIndex() == XML) {
setPanel.add(xmlSetPanel(width, height), BorderLayout.NORTH); rightPanel.add(getXmlSetPanel());
} else if (fileTypeComboBox.getSelectedIndex() == EXCEL) { } else if (fileTypeComboBox.getSelectedIndex() == EXCEL) {
setPanel.add(excelSetPanel(width, height), BorderLayout.NORTH); rightPanel.add(getExcelSetPanel());
} else { } 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>" 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> "; + "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips.setText(tipContent); tips.setText(tipContent);
setPanel.revalidate(); rightPanel.revalidate();
} }
}; };
@ -507,7 +505,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private class RefreshAction extends UITableEditAction { private class RefreshAction extends UITableEditAction {
public RefreshAction() { public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh")); 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 @Override
@ -818,9 +816,10 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
JPanel toolbarPanel = new JPanel(new BorderLayout()); JPanel toolbarPanel = new JPanel(new BorderLayout());
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
xmlNodeTree = new XMLNodeTree(); xmlNodeTree = new XMLNodeTree();
xmlNodeTree.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
this.add(new JScrollPane(xmlNodeTree)); 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(); refreshAction = new RefreshParameterAction();
ToolBarDef toolbarDef = new ToolBarDef(); ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(refreshAction); toolbarDef.addShortCut(refreshAction);
@ -840,7 +839,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
public RefreshParameterAction() { public RefreshParameterAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setMnemonic('r'); this.setMnemonic('r');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); this.setSmallIcon(new LazyIcon("refresh"));
} }
@Override @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{ public class FileTableDataSmallHeightPane extends FileTableDataPane{
//wikky:文件数据集在模板数据集下面的界面参数。 //wikky:文件数据集在模板数据集下面的界面参数。
private static final int SETPANELWIDTH = 265; private static final double LOCAL_WIDTH_RATIO = 0.58;
private static final int WIDTH = 245; private static final double URL_WIDTH_RATIO = 0.51;
private static final int HEIGHT = 475;
private static final int GAP = 13;
public FileTableDataSmallHeightPane(){ 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{ public class FileTableDataSmallPane extends FileTableDataPane{
//wikky:文件数据集在服务器数据集下面的界面参数。 //wikky:文件数据集在服务器数据集下面的界面参数。
private static final int SETPANELWIDTH = 265; private static final double LOCAL_WIDTH_RATIO = 0.59;
private static final int WIDTH = 245; private static final double URL_WIDTH_RATIO = 0.52;
private static final int HEIGHT = 436;
private static final int GAP = 13;
public FileTableDataSmallPane(){ 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; 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.base.*;
import com.fr.data.impl.ConditionTableData; import com.fr.data.impl.ConditionTableData;
import com.fr.data.impl.MultiTDTableData; import com.fr.data.impl.MultiTDTableData;
import com.fr.data.impl.UnionTableData; import com.fr.data.impl.UnionTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
@ -39,6 +43,10 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map.Entry; 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> { public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData> {
private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...” private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...”
@ -52,28 +60,25 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
public MultiTDTableDataPane() { public MultiTDTableDataPane() {
this(StringUtils.EMPTY); this(StringUtils.EMPTY);
} }
public MultiTDTableDataPane(String multiName) { public MultiTDTableDataPane(String multiName) {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(initNorthPane(multiName), BorderLayout.CENTER); this.add(initNorthPane(multiName), BorderLayout.CENTER);
this.add(initSouthPanel(), BorderLayout.SOUTH); this.add(initSouthPanel(), BorderLayout.SOUTH);
} }
private JPanel initNorthPane(String multiName) { private JPanel initNorthPane(String multiName) {
JPanel jpanel = new JPanel(); JPanel jpanel = new JPanel();
jpanel.setLayout(new BorderLayout()); jpanel.setLayout(new BorderLayout());
jpanel.setBorder(new ScaledEmptyBorder(0,0,10,0));
JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); //选择要合并的数据集-预览
JPanel northPanel = new JPanel(new BorderLayout());
UILabel chooseTableData = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Select_To_Merge")); UILabel chooseTableData = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Select_To_Merge"));
UIButton previewButton = new UIButton(); UIButton previewButton = new UIButton(new LazyIcon("preview"));
previewButton.setIcon(BaseUtils.readIcon("/com/fr/web/images/preview.png"));
previewButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
previewButton.addActionListener(getPreviewActionListener()); previewButton.addActionListener(getPreviewActionListener());
northPanel.add(chooseTableData); northPanel.add(row(cell(chooseTableData), cell(previewButton)).getComponent());
northPanel.add(previewButton);
centerPanel = new JPanel(); centerPanel = new JPanel();
JScrollPane js = new JScrollPane(centerPanel); JScrollPane js = new JScrollPane(centerPanel);
@ -84,17 +89,19 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
jpanel.add(northPanel, BorderLayout.NORTH); jpanel.add(northPanel, BorderLayout.NORTH);
jpanel.add(js, BorderLayout.CENTER); jpanel.add(js, BorderLayout.CENTER);
return jpanel; return jpanel;
} }
private void initAllBarPane(String multiName) { private void initAllBarPane(String multiName) {
UILabel headLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Nam_Formula"));
setResMap(); setResMap();
int len = resMap.size(); int len = resMap.size();
// 10个正好不会出现滚动条 // 10个正好不会出现滚动条
centerPanel.setLayout(new GridLayout(len < MIN_BAR_NUMBER ? MIN_BAR_NUMBER : len + 1, 1)); 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()) { for (Entry<String, TableDataWrapper> stringTableDataWrapperEntry : resMap.entrySet()) {
TableDataWrapper tableDataWrappe = stringTableDataWrapperEntry.getValue(); TableDataWrapper tableDataWrappe = stringTableDataWrapperEntry.getValue();
@ -103,7 +110,6 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
centerPanel.add(new BarPanel(tmp, tableDataWrappe.getIcon())); centerPanel.add(new BarPanel(tmp, tableDataWrappe.getIcon()));
} }
} }
} }
protected void setResMap() { 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")); }, StringUtils.BLANK + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Default_Parameter"));
jpanel.add(editorPane, BorderLayout.CENTER); jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel; return jpanel;
} }
private class RefreshAction extends UITableEditAction { private class RefreshAction extends UITableEditAction {
public RefreshAction() { public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh")); 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 @Override
@ -249,9 +254,6 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
} }
class BarPanel extends JPanel { class BarPanel extends JPanel {
private static final int BAR_HEIGHT = 33;
private String name; private String name;
private Icon icon; private Icon icon;
private UICheckBox chekbox; private UICheckBox chekbox;
@ -283,10 +285,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
private void initUI() { private void initUI() {
String tmp = name; String tmp = name;
this.setLayout(new FlowLayout(FlowLayout.LEFT)); this.setLayout(new BorderLayout());
JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
leftPanel.setPreferredSize(new Dimension(190, BAR_HEIGHT));
chekbox = new UICheckBox(); chekbox = new UICheckBox();
UILabel tabledataName = new UILabel(tmp); UILabel tabledataName = new UILabel(tmp);
while (tabledataName.getPreferredSize().width > MAX_LENTH_OF_DATASET) { while (tabledataName.getPreferredSize().width > MAX_LENTH_OF_DATASET) {
@ -299,25 +298,40 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
chekbox.addActionListener(tableDataCheckboxListener); chekbox.addActionListener(tableDataCheckboxListener);
iconLabel.addMouseListener(chooseTableDataListener); iconLabel.addMouseListener(chooseTableDataListener);
tabledataName.addMouseListener(chooseTableDataListener); tabledataName.addMouseListener(chooseTableDataListener);
leftPanel.add(chekbox); JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.add(iconLabel); leftPanel.add(row(LayoutConstants.HORIZONTAL_GAP, cell(chekbox), cell(iconLabel), cell(tabledataName)).getComponent());
leftPanel.add(tabledataName);
JPanel rightPanel = new JPanel(); JPanel rightPanel = new JPanel();
formulaContentTextField = new UITextField(BAR_HEIGHT); formulaContentTextField = new UITextField();
formulaContentTextField.setEnabled(false); formulaContentTextField.setEnabled(false);
formulaContentTextField.getDocument().addDocumentListener(documentListener); formulaContentTextField.getDocument().addDocumentListener(documentListener);
formulaButton = new UIButton("..."); formulaButton = new UIButton("...");
formulaButton.setEnabled(false); formulaButton.setEnabled(false);
formulaButton.setPreferredSize(new Dimension(25, 23)); formulaButton.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
formulaButton.addActionListener(getFormulaActionListener()); formulaButton.addActionListener(getFormulaActionListener());
rightPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + " =")); rightPanel.add(
rightPanel.add(formulaContentTextField); row(20,
rightPanel.add(formulaButton); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + "=")),
row(LayoutConstants.HGAP_LARGE, cell(formulaContentTextField), cell(formulaButton))
this.setPreferredSize(new Dimension(-1, BAR_HEIGHT)); ).getComponent()
this.add(leftPanel, BorderLayout.WEST); );
this.add(rightPanel, BorderLayout.CENTER);
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() { public void populate() {

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

@ -1,17 +1,21 @@
package com.fr.design.dialog; 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.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; 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. * Created by plough on 2018/11/7.
@ -36,16 +40,16 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
private void initComponents() { private void initComponents() {
chooseComboBox = new UIComboBox(CHOOSEITEM); chooseComboBox = new UIComboBox(CHOOSEITEM);
chooseComboBox.addItemListener(itemListener); chooseComboBox.addItemListener(itemListener);
//以下设置,部分面板通用
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set")); UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
belowSetLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); buttonPane = row(
buttonPane = GUICoreUtils.createFlowPane(new Component[] { FineUIScale.scale(32),
belowSetLabel, chooseComboBox}, FlowLayout.LEFT, 0, 0); cell(belowSetLabel),
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 0)); cell(chooseComboBox)
).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(buttonPane, BorderLayout.NORTH);
this.contentPane = getContentPane(); 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; 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.common.annotations.Open;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.DesignSizeI18nManager;
@ -17,6 +20,9 @@ import java.awt.Dimension;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Window; import java.awt.Window;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
@Open @Open
public abstract class BasicPane extends JPanel { public abstract class BasicPane extends JPanel {
@ -299,16 +305,19 @@ public abstract class BasicPane extends JPanel {
private PropertyChangeAdapter changeListener; private PropertyChangeAdapter changeListener;
public NamePane(BasicPane bPane) { public NamePane(BasicPane bPane) {
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout());
nameTextField = new UITextField();
nameTextField = new UITextField(30); Name = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Name"));
Name = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Name") + ":"); JPanel northPane = new JPanel(new BorderLayout());
JPanel northPane = new JPanel(new BorderLayout(4, 4)); northPane.setBorder(new ScaledEmptyBorder(0,10,0,10));
northPane.add(Name, BorderLayout.WEST); northPane.add(row(
northPane.add(nameTextField, BorderLayout.CENTER); LayoutConstants.HGAP_LARGE,
northPane.add(showfield = new UILabel(" "), BorderLayout.EAST); 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.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.add(northPane, BorderLayout.NORTH);
this.centerPane = bPane; this.centerPane = bPane;
this.add(bPane, BorderLayout.CENTER); 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; 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.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.JListUtils; import com.fr.design.utils.gui.JListUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel; import javax.swing.JOptionPane;
import javax.swing.DefaultListCellRenderer;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -29,13 +35,17 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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>> { public abstract class EditingStringListPane extends BasicBeanPane<List<String>> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private DefaultListModel model; private DefaultListModel model;
private JList jlist; private JList jlist;
private UIButton addButton; private UIButton addButton;
private UIButton editButton; private UIButton modifyButton;
private UIButton removeButton; private UIButton removeButton;
private UIButton moveUpButton; private UIButton moveUpButton;
private UIButton moveDownButton; private UIButton moveDownButton;
@ -43,6 +53,11 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
public EditingStringListPane() { public EditingStringListPane() {
super(); super();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
//按钮
JPanel buttonPane = initButtonPane();
buttonPane.setBorder(new ScaledEmptyBorder(0,0,10,0));
this.add(buttonPane, BorderLayout.NORTH);
//列表
model = new DefaultListModel(); model = new DefaultListModel();
jlist = new JList(model); jlist = new JList(model);
jlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@ -56,34 +71,43 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
} }
}); });
jlist.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); JScrollPane scrollPane = new JScrollPane(jlist);
editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify")); scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(620,350)));
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); scrollPane.setBorder(new FineRoundBorder());
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); this.add(scrollPane, BorderLayout.CENTER);
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);
this.addListener(); this.addListener();
this.addButton.setEnabled(false); this.addButton.setEnabled(false);
this.checkEnableState(); 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() { private void addListener() {
addListener1(); addListener1();
@ -119,7 +143,6 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
private void addListener1() { private void addListener1() {
addButton.addActionListener(new ActionListener() { addButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String newvalue = getAddOrEditString(); String newvalue = getAddOrEditString();
@ -133,7 +156,7 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
} }
} }
}); });
editButton.addActionListener(new ActionListener() { modifyButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -174,7 +197,7 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
private void setEditEnabled(boolean enabled) { private void setEditEnabled(boolean enabled) {
this.removeButton.setEnabled(enabled); this.removeButton.setEnabled(enabled);
this.editButton.setEnabled(enabled); this.modifyButton.setEnabled(enabled);
this.moveUpButton.setEnabled(enabled); this.moveUpButton.setEnabled(enabled);
this.moveDownButton.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; package com.fr.design.gui.ilable;
import java.awt.Color; import com.fine.theme.utils.FineUIStyle;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import com.fr.design.gui.ilable.UILabel;
public class FRExplainLabel extends UILabel { public class FRExplainLabel extends UILabel {
@ -19,6 +18,6 @@ public class FRExplainLabel extends UILabel {
private void init(){ private void init(){
setIcon(icon); 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; package com.fr.design.parameter;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; 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 javax.swing.JPanel;
import java.awt.BorderLayout; 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> { public class ParameterPane extends BasicBeanPane<Parameter> {
@ -34,27 +37,24 @@ public class ParameterPane extends BasicBeanPane<Parameter> {
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
//名字
nameTextField = new UITextField(10); nameTextField = new UITextField(10);
nameTextField.setEditable(false); nameTextField.setEditable(false);
//默认值
JPanel textFieldPanel=FRGUIPaneFactory.createBorderLayout_S_Pane();
textFieldPanel.add(nameTextField,BorderLayout.CENTER);
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(); valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
// richer:要排列显示的控件 // richer:要排列显示的控件
Component[][] components = {{null}, JPanel centerPane = column(LayoutConstants.VERTICAL_GAP,
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"),textFieldPanel }, row(20,
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":"),valueEditor } cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(0.1),
}; cell(nameTextField).weight(0.8),
double p =TableLayout.PREFERRED; flex(0.1)),
double f =TableLayout.FILL; row(20,
double[] rowSize = {p, p, p, p}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":")).weight(0.1),
double[] columnSize = {p, p, f, p, p}; cell(valueEditor).weight(0.8),
flex(0.1))
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane( ).getComponent();
components, rowSize, columnSize, 20, 10); centerPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 0));
this.add(centerPane, BorderLayout.CENTER); 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; 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.BaseFormula;
import com.fr.base.iofile.attr.WatermarkAttr; 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.dialog.BasicPane;
import com.fr.design.editor.editor.FormulaEditor; import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.gui.icombobox.UIComboBox; 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.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner; import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; 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.style.color.NewColorSelectPane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory; import javax.swing.SwingUtilities;
import javax.swing.SwingConstants; import javax.swing.UIManager;
import javax.swing.JComponent; import javax.swing.JDialog;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; 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.BorderLayout;
import java.awt.Color; 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.FocusEvent;
import java.awt.event.FocusListener; import java.awt.event.FocusListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusAdapter; 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 UIComboBox fontSizeComboBox;
//横向间距 //横向间距
private UISpinner horizontalGapSpinner; private UISpinner horizontalGapSpinner;
//向间距 //向间距
private UISpinner verticalGapSpinner; private UISpinner verticalGapSpinner;
// 文字颜色 // 文字颜色
private NewColorSelectPane colorPane; private NewColorSelectPane colorPane;
@ -69,7 +75,7 @@ public class WatermarkPane extends BasicPane {
//纵向间距最小值 //纵向间距最小值
public static final int VERTICAL_GAP_MIX = 50; public static final int VERTICAL_GAP_MIX = 50;
private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20); private JPanel leftPane;
public WatermarkPane() { public WatermarkPane() {
initComponents(); initComponents();
@ -77,26 +83,45 @@ public class WatermarkPane extends BasicPane {
private void initComponents() { private void initComponents() {
message = new UILabel(); message = new UILabel();
this.setBorder(BorderFactory.createEmptyBorder(4, 4, -5, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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(); 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 = new WatermarkPreviewPane();
watermarkPreviewPane.setOpaque(false);
previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER); previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER);
leftPane = column(
// 设置 LayoutConstants.VGAP_SMALL,
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))),
contentPane.add(rightPane, BorderLayout.EAST); cell(previewPaneWrapper)
rightPane.add(initRightPane(), BorderLayout.NORTH); ).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) { public void populate(WatermarkAttr watermark) {
@ -129,60 +154,59 @@ public class WatermarkPane extends BasicPane {
this.formulaPane = formulaPane; this.formulaPane = formulaPane;
} }
protected UIScrollPane initRightPane() { /**
* 配置Pane
* @return
*/
protected JPanel getRightPane() {
// 文字
formulaPane = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula")); formulaPane = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula"));
// 字号
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
fontSizeComboBox.setEditable(true); fontSizeComboBox.setEditable(true);
//水印间距
horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200); horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UnsignedIntUISpinner(50, Integer.MAX_VALUE, 1, 100); 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( horizontalGapSpinner.getTextField().addFocusListener(
createFocusListener4GapNumberField(horizontalGapSpinner, HORIZONTAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Horizontal_Gap_Over_Warning"))); 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"))); verticalGapSpinner.getTextField().addFocusListener(createFocusListener4GapNumberField(verticalGapSpinner, VERTICAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Vertical_Gap_Over_Warning")));
//next 按钮 释放时也要判断是否要弹出提示 //next 按钮 释放时也要判断是否要弹出提示
horizontalGapSpinner.getNextButton().addMouseListener(createMouseListener4GapNextButton(horizontalGapSpinner, HORIZONTAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Horizontal_Gap_Over_Warning"))); 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"))); 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)); JPanel watermarkGapTipsPane = row(LayoutConstants.HGAP_LARGE,
fontSizeTypePane.add(fontSizeComboBox, BorderLayout.CENTER); flex(0.15),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"))).weight(0.2),
//水印间距面板 flex(0.3),
JPanel watermarkGapPane = new JPanel(new BorderLayout(10, 0)); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"))).weight(0.2),
JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 0); flex(0.15)
jp.add(horizontalGapSpinner); ).getComponent();
jp.add(verticalGapSpinner); //水印间距排列
watermarkGapPane.add(jp, BorderLayout.CENTER); JPanel watermarkGapPane = column(
row(LayoutConstants.HGAP_LARGE,
JPanel watermarkGapTipsPane = new JPanel(new BorderLayout()); cell(horizontalGapSpinner).weight(0.5),
JPanel tipsJp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 0); cell(verticalGapSpinner).weight(0.5)
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)); cell(watermarkGapTipsPane)
watermarkGapTipsPane.add(tipsJp, BorderLayout.CENTER); ).getComponent();
// 颜色选择器
colorPane = new NewColorSelectPane(false); 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); 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)),
double p = TableLayout.PREFERRED; row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Size"))).weight(0.3), cell(fontSizeComboBox).weight(0.7)),
double[] rowSize = {p, p, p, p, p}; row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Watermark_Gap"))).weight(0.3), cell(watermarkGapPane).weight(0.7)),
double[] columnSize = {p, MAX_WIDTH}; row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text_Color"))).weight(0.3), cell(colorPane).weight(0.7))
).getComponent();
JPanel rightContentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ rightContentPane.setOpaque(false);
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Watermark_Text")), formulaPane}, return rightContentPane;
{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}, private JPanel getTopAlignLabelPane(String labelText) {
{colorLabelPane, colorPane}, return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).
}, rowSize, columnSize, 10); with(it -> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
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;
} }
protected void populateFontSize(int fontSize) { 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() { private void initComponents() {
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0)); //buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
} }
@Override @Override

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

@ -1,12 +1,12 @@
package com.fr.design.report.fit; package com.fr.design.report.fit;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.fit.provider.FitAttrModelProvider; import com.fr.design.report.fit.provider.FitAttrModelProvider;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.fit.ReportFitAttr; import com.fr.report.fit.ReportFitAttr;
import javax.swing.*; import javax.swing.*;
@ -17,6 +17,8 @@ import java.util.Comparator;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; 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; import static com.fr.design.i18n.Toolkit.i18nText;
public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
@ -26,26 +28,23 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected UIComboBox itemChoose; protected UIComboBox itemChoose;
protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>(); protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>();
private ReportFitConfigPane fitConfigPane; private ReportFitConfigPane fitConfigPane;
public FitAttrModel fitAttrModel; public FitAttrModel fitAttrModel;
private static final int BELOW_SET_COMPONENT_HSPACE = 8;
protected BaseFitAttrPane() { protected BaseFitAttrPane() {
initFitAttrModel(); initFitAttrModel();
} }
private void initFitAttrModel() { private void initFitAttrModel() {
//旧决策报表
fitAttrModelList.add(new FrmFitAttrModel()); fitAttrModelList.add(new FrmFitAttrModel());
//普通报表
fitAttrModelList.add(new CptFitAttrModel()); fitAttrModelList.add(new CptFitAttrModel());
//决策报表
fitAttrModelList.add(new AdaptiveFrmFitAttrModel()); fitAttrModelList.add(new AdaptiveFrmFitAttrModel());
Set<FitAttrModelProvider> fitAttrModelProviders = ExtraDesignClassManager.getInstance().getArray(FitAttrModelProvider.XML_TAG); Set<FitAttrModelProvider> fitAttrModelProviders = ExtraDesignClassManager.getInstance().getArray(FitAttrModelProvider.XML_TAG);
for (FitAttrModelProvider fitAttrModelProvider : fitAttrModelProviders) { for (FitAttrModelProvider fitAttrModelProvider : fitAttrModelProviders) {
fitAttrModelList.add(fitAttrModelProvider); fitAttrModelList.add(fitAttrModelProvider);
} }
fitAttrModelList = fitAttrModelList.stream().sorted(Comparator.comparing(FitAttrModel::getPriority).reversed()).collect(Collectors.toList()); 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); contentJPanel.remove(fitConfigPane);
} }
this.fitConfigPane = fitAttrModel instanceof CptFitAttrModel ? new ReportFitConfigPane(fitAttrModel, true) : new FormFitConfigPane(fitAttrModel, true); this.fitConfigPane = fitAttrModel instanceof CptFitAttrModel ? new ReportFitConfigPane(fitAttrModel, true) : new FormFitConfigPane(fitAttrModel, true);
//添加自适应面板
contentJPanel.add(fitConfigPane); contentJPanel.add(fitConfigPane);
} }
@ -82,34 +82,33 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected abstract String[] getItemNames(); protected abstract String[] getItemNames();
protected void initComponents() { 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(); initItemChoose();
//服务器配置-PC端自适应属性面板中需要添加提示
initPrompt(); initPrompt();
this.setLayout(new BorderLayout());
this.add(contentJPanel);
} }
/**
* 以下设置Pane
*/
private void initItemChoose() { private void initItemChoose() {
JPanel chooseJPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
ItemListener itemListener = getItemListener();
itemChoose = new UIComboBox(getItemNames()); itemChoose = new UIComboBox(getItemNames());
ItemListener itemListener = getItemListener();
itemChoose.addItemListener(itemListener); itemChoose.addItemListener(itemListener);
belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); //以下设置横向布局
JPanel hSpaceLabel = new JPanel(); JPanel buttonPane = row(20, cell(belowSetLabel), cell(itemChoose)).getComponent();
hSpaceLabel.setSize(BELOW_SET_COMPONENT_HSPACE, 0); buttonPane.setBorder(new ScaledEmptyBorder(0,5,5,0));
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ //整体面板添加‘以下设置Pane’
belowSetLabel, hSpaceLabel, itemChoose}, FlowLayout.LEFT); contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
chooseJPanel.add(buttonPane); contentJPanel.setBorder(new ScaledEmptyBorder(5,10,5,10));
chooseJPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); contentJPanel.add(buttonPane);
contentJPanel.add(chooseJPanel);
} }
protected abstract ItemListener getItemListener(); protected abstract ItemListener getItemListener();
public void populate(ReportFitAttr reportFitAttr) { 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; package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SVGLoader;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.fit.menupane.FitRadioGroup; import com.fr.design.report.fit.menupane.FitRadioGroup;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -23,13 +24,16 @@ import java.awt.Rectangle;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; 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 { public class FormFitConfigPane extends ReportFitConfigPane {
private static final int ICON_OFFSET_X = 25; private static final int ICON_OFFSET_X = 25;
private static final int ICON_OFFSET_Y = 3; private static final int ICON_OFFSET_Y = 3;
private static final int ICON_SIZE = 16; 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 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 DEFAULT_ITEM = 0;
private static final int CUSTOM_ITEM = 1; private static final int CUSTOM_ITEM = 1;
public FormFitConfigPane(FitAttrModel fitAttrModel) { public FormFitConfigPane(FitAttrModel fitAttrModel) {
@ -41,12 +45,11 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} }
protected JPanel initECConfigPane() { protected JPanel initECConfigPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = new JPanel(new BorderLayout());
if (fitAttrModel.getFitTypeNames().length != 0) { if (fitAttrModel.getFitTypeNames().length != 0) {
Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1]; Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1];
initRadioGroup(ecConfigRadioGroup, fitAttrModel.getFitName(), fitAttrModel.getFitTypeNames(), ecComponents); initRadioGroup(ecConfigRadioGroup, fitAttrModel.getFitName(), fitAttrModel.getFitTypeNames(), ecComponents);
jPanel.add(createSubAttrPane(ecComponents), BorderLayout.CENTER); jPanel.add(column(10, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent());
jPanel.add(createTipPane(), BorderLayout.SOUTH);
} }
return jPanel; return jPanel;
} }
@ -79,7 +82,6 @@ public class FormFitConfigPane extends ReportFitConfigPane {
UIPopupMenu uiPopupMenu = new UIPopupMenu() { UIPopupMenu uiPopupMenu = new UIPopupMenu() {
@Override @Override
protected void paintBorder(Graphics g) { protected void paintBorder(Graphics g) {
} }
}; };
uiPopupMenu.setLayout(new BorderLayout(0, 0)); uiPopupMenu.setLayout(new BorderLayout(0, 0));
@ -107,7 +109,6 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} else { } else {
hidePreviewPane(); hidePreviewPane();
} }
} }
}); });
} }
@ -138,13 +139,12 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} }
private JPanel createTipPane() { 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")); UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"));
jPanel.add(label1); FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP);
label1.setForeground(Color.lightGray);
UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2")); UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"));
jPanel.add(label2); FineUIStyle.setStyle(label2, FineUIStyle.LABEL_TIP);
label2.setForeground(Color.lightGray); jPanel.add(column(LayoutConstants.HORIZONTAL_GAP, cell(label1), cell(label2)).getComponent());
return jPanel; return jPanel;
} }
@ -159,5 +159,4 @@ public class FormFitConfigPane extends ReportFitConfigPane {
protected void updateECConfigRadioGroup(ReportFitAttr reportFitAttr) { protected void updateECConfigRadioGroup(ReportFitAttr reportFitAttr) {
reportFitAttr.setFitStateInPC(ecConfigRadioGroup.getSelectRadioIndex()); 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; package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.general.FRFont; 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 Color DEFAULT_PAINT_COLOR = Color.decode("#419BF9");
private static final int FIT_FONT_SIZE = 15; private static final int FIT_FONT_SIZE = 15;
private static final int NO_FIT_FONT_SIZE = 10; 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(){ 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; package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager; 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.general.ComparatorUtils;
import com.fr.report.fit.ReportFitAttr; import com.fr.report.fit.ReportFitAttr;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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; import static com.fr.design.i18n.Toolkit.i18nText;
public class ReportFitConfigPane extends JPanel { public class ReportFitConfigPane extends JPanel {
@ -36,21 +38,24 @@ public class ReportFitConfigPane extends JPanel {
} }
private void initComponent() { private void initComponent() {
JPanel contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
this.add(contentJPanel);
fontRadioGroup = new FontRadioGroup(); fontRadioGroup = new FontRadioGroup();
ecConfigRadioGroup = new FitRadioGroup(); ecConfigRadioGroup = new FitRadioGroup();
contentJPanel.add(initAttrJPanel()); this.add(initContentPanel());
contentJPanel.add(initPreviewJPanel());
} }
private JPanel initAttrJPanel() { private JPanel initContentPanel() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); //字体
Component[] fontComponents = new Component[3]; Component[] fontComponents = new Component[3];
initRadioGroup(fontRadioGroup, i18nText("Fine-Designer_Fit-Font"), new String[]{i18nText("Fine-Designer_Fit"), i18nText("Fine-Designer_Fit-No")}, fontComponents); 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); previewJPanel = new NewFitPreviewPane();
return jPanel; previewJPanel.setPreferredSize(FineUIScale.scale(new Dimension(300, 204)));
//面板布局 字体-(null/报表块/表格)-预览区域
return column(10,
cell(createSubAttrPane(fontComponents)),
cell(initECConfigPane()),
cell(previewJPanel)
).getComponent();
} }
protected JPanel initECConfigPane() { protected JPanel initECConfigPane() {
@ -61,21 +66,14 @@ public class ReportFitConfigPane extends JPanel {
return jPanel; return jPanel;
} }
protected JPanel createSubAttrPane(Component[] components) { protected JPanel createSubAttrPane(Component[] components) {
double[] rowSize = new double[]{20}; double[] rowSize = new double[]{20};
double[] columnSize = new double[components.length]; double[] columnSize = new double[components.length];
for (int i = 0; i < columnSize.length; i++) { for (int i = 1; i < columnSize.length; i++) {
if (i == 0) {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth();
} else {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth(); columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth();
} }
}
JPanel attrJPanel = TableLayoutHelper.createTableLayoutPane(new Component[][]{components}, rowSize, columnSize); JPanel attrJPanel = TableLayoutHelper.createTableLayoutPane(new Component[][]{components}, rowSize, columnSize);
attrJPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); return row(cell(components[0]).weight(0.16),cell(attrJPanel).weight(0.84)).getComponent();
return attrJPanel;
} }
protected void initRadioGroup(FitRadioGroup fitRadioGroup, String name, String[] options, Component[] components) { 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())); 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) { public void populateBean(ReportFitAttr ob) {
fontRadioGroup.selectIndexButton(ob.isFitFont() ? 0 : 1); fontRadioGroup.selectIndexButton(ob.isFitFont() ? 0 : 1);
populateECConfigRadioGroup(ob.fitStateInPC()); 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.UpdateAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.fun.DefaultValueAdjustProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -90,6 +91,9 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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 // Noninstantiable utility class
public final class GUICoreUtils { public final class GUICoreUtils {
@ -992,12 +996,7 @@ public final class GUICoreUtils {
dynamicPane.setVisible(e.getStateChange() == visibleState); dynamicPane.setVisible(e.getStateChange() == visibleState);
} }
}); });
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); return column(LayoutConstants.VERTICAL_GAP, cell(checkBox), cell(dynamicPane)).getComponent();
panel.add(checkBox, BorderLayout.NORTH);
JPanel dynamicPaneWrapper = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
dynamicPaneWrapper.add(dynamicPane);
panel.add(dynamicPaneWrapper, BorderLayout.CENTER);
return panel;
} }
/** /**

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

@ -1,40 +1,38 @@
package com.fr.design.widget; 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.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.web.CustomIconPane; import com.fr.design.web.CustomIconPane;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import javax.swing.Icon;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import javax.swing.ImageIcon;
import java.awt.Image;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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 { public class IconDefinePane extends BasicPane {
private UILabel showIconImageLable; private UILabel showIconImageLable;
private UIButton editIconButton; private UIButton editIconButton;
private UIButton removeIconButton; private UIButton removeIconButton;
private String curIconName; private String curIconName;
private Icon curIcon;
public IconDefinePane() { 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 = new UILabel();
showIconImageLable.setPreferredSize(new Dimension(20, 20));
editIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); 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() { editIconButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { 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")); removeIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Delete"));
iconButtonPane.add(removeIconButton);
removeIconButton.addActionListener(new ActionListener() { removeIconButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
curIconName = null; curIconName = null;
@ -62,9 +59,10 @@ public class IconDefinePane extends BasicPane {
} }
}); });
this.add(this.showIconImageLable); JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable), cell(this.editIconButton), cell(this.removeIconButton)).getComponent();
this.add(this.editIconButton); iconButtonPane.setBorder(new ScaledEmptyBorder(0,0,0,0));
this.add(this.removeIconButton); this.setLayout(new BorderLayout());
this.add(iconButtonPane, BorderLayout.CENTER);
} }
@Override @Override
@ -86,6 +84,16 @@ public class IconDefinePane extends BasicPane {
setShowIconImage(); setShowIconImage();
} }
/**
* 直接更新icon
* @param iconName
* @param icon
*/
public void populateIcon(String iconName, Icon icon) {
this.curIconName = iconName;
showIconImageLable.setIcon(icon);
}
public String update() { public String update() {
return this.curIconName; 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"> <svg width="32" height="32" viewBox="0 0 32 32" 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"/> <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> </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"> <svg width="32" height="32" viewBox="0 0 32 32" 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"/> <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> </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", "reportFit": "toolbar/reportFit.svg",
"mobileAttr": "toolbar/mobileAttr.svg", "mobileAttr": "toolbar/mobileAttr.svg",
"watermark": "toolbar/watermark.svg", "watermark": "toolbar/watermark.svg",
"dataVerify": "toolbar/dataVerify.svg",
"clearStash": "toolbar/clearStash.svg",
"print": "toolbar/print.svg", "print": "toolbar/print.svg",
"printPdf": "toolbar/printPdf.svg",
"printApplet": "toolbar/printApplet.svg",
"printPreview": "toolbar/printPreview.svg",
"pageSetup": "toolbar/pageSetup.svg", "pageSetup": "toolbar/pageSetup.svg",
"reportHeader": "toolbar/reportHeader.svg", "reportHeader": "toolbar/reportHeader.svg",
"reportFooter": "toolbar/reportFooter.svg", "reportFooter": "toolbar/reportFooter.svg",
@ -215,6 +220,15 @@
"workOrderCenter": "toolbar/workOrderCenter.svg", "workOrderCenter": "toolbar/workOrderCenter.svg",
"actCenter": "toolbar/actCenter.svg", "actCenter": "toolbar/actCenter.svg",
"sign": "toolbar/sign.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", "cellelement_small": "cellelement.svg",
"forbid": "expand/forbid.svg", "forbid": "expand/forbid.svg",
"horizontal_expand": "expand/horizontal.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.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000 Label.strongHintColor = #FF0000
Label.warningColor = #F1393C
#---- HelpButton ---- #---- HelpButton ----
@ -1305,6 +1306,9 @@ CellOtherSetPane.height=$Component.defaultHeight
[style]Label.tipLabel = \ [style]Label.tipLabel = \
foreground: $Label.tipColor foreground: $Label.tipColor
[style]Label.warningTipLabel = \
foreground: $Label.warningColor
[style]Button.plainButton = \ [style]Button.plainButton = \
border: null; \ border: null; \
background: 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.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*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.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20 com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*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.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 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.file.MultiTemplateTabPane.popUpMenu=170*65
com.fr.design.formula.FormulaPane=900*600 com.fr.design.formula.FormulaPane=900*600
com.fr.design.formula.FormulaPaneWhenReserveFormula=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.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.js.JavaScript; import com.fr.js.JavaScript;
@ -23,8 +22,6 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
@ -32,6 +29,11 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Set; 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> { public class ListenerEditPane extends BasicBeanPane<Listener> {
private UITextField nameText; private UITextField nameText;
private UIComboBox styleBox; private UIComboBox styleBox;
@ -66,10 +68,10 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
public void initComponents(String[] defaultArgs) { public void initComponents(String[] defaultArgs) {
cards = new ArrayList<>(); cards = new ArrayList<>();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
nameText = new UITextField(8); nameText = new UITextField(8);
nameText.setEditable(false); nameText.setEditable(false);
namePane.add(nameText, BorderLayout.WEST);
final List<String> style = new ArrayList<>(Arrays.asList(JS, DBCOMMIT, CUSTOMACTION, EMAIL, MOBILEPOPUP)); final List<String> style = new ArrayList<>(Arrays.asList(JS, DBCOMMIT, CUSTOMACTION, EMAIL, MOBILEPOPUP));
styleBox = new UIComboBox(style.toArray()); styleBox = new UIComboBox(style.toArray());
boolean workbook = DesignerContext.getDesignerFrame().getSelectedJTemplate().isJWorkBook(); boolean workbook = DesignerContext.getDesignerFrame().getSelectedJTemplate().isJWorkBook();
@ -77,15 +79,13 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
style.add(EXPORT); style.add(EXPORT);
} }
styleBox = new UIComboBox(style.toArray()); styleBox = new UIComboBox(style.toArray());
namePane.add(styleBox);
namePane = GUICoreUtils.createFlowPane(new Component[]{ JPanel eventName = row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name"))), cell(nameText)).getComponent();
new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"), JPanel eventType = row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Type"))), cell(styleBox)).getComponent();
nameText, namePane = row(cell(eventName).weight(0.3), cell(eventType).weight(0.4), flex(0.3)).getComponent();
new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"),
styleBox}, this.add(wrapComponentWithTitle(namePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name_Type")), BorderLayout.NORTH);
FlowLayout.LEFT);
namePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Event_Name_Type")));
this.add(namePane, BorderLayout.NORTH);
card = new CardLayout(); card = new CardLayout();
hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane(); hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane();
hyperlinkPane.setLayout(card); hyperlinkPane.setLayout(card);

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

@ -1,6 +1,9 @@
package com.fr.design.report; 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.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
@ -14,14 +17,18 @@ import com.fr.io.attr.ExcelExportAttr;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Color; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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 { public class ExcelExportPane extends BasicPane {
private UICheckBox isExportHidedRow; private UICheckBox isExportHidedRow;
private UICheckBox isExportHidenColumn; private UICheckBox isExportHidenColumn;
@ -48,81 +55,52 @@ public class ExcelExportPane extends BasicPane {
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
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);
isExportHidedRow = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Export_Hided_Row")); isExportHidedRow = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Export_Hided_Row"));
isExportHidedRow.setSelected(false); isExportHidedRow.setSelected(false);
outNorthPane.add(isExportHidedRow);
isExportHidenColumn = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Export_Hided_Column")); isExportHidenColumn = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Export_Hided_Column"));
isExportHidenColumn.setSelected(false); isExportHidenColumn.setSelected(false);
outNorthPane.add(isExportHidenColumn); JPanel exportSettingPane = column(LayoutConstants.VERTICAL_GAP, row(cell(isExportHidedRow)), row(cell(isExportHidenColumn))).getComponent();
// 内容保护
JPanel outSouthPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"));
outSouthPane.setPreferredSize(new Dimension(580, 280));
outPane.add(outSouthPane);
// 文件保护 // 文件保护
fileProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_File_Protect"), false); fileProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_File_Protect"), false);
outSouthPane.add(fileProtect);
// 文件密码和密码框 // 文件密码和密码框
passwordWritePane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); 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")); UILabel filePassword = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Password"));
passwordWriteFlowPane.add(filePassword);
passwordField = new UITextField(11); passwordField = new UITextField(11);
passwordWriteFlowPane.add(passwordField);
passwordWritePane.add(passwordWriteFlowPane);
fileProtect.addActionListener(new ActionListener() { fileProtect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (fileProtect.isSelected()) { passwordWritePane.setVisible(fileProtect.isSelected());
passwordWritePane.setVisible(true);
} else {
passwordWritePane.setVisible(false);
} }
}
}); });
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); writeProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_Write_Protect"), false);
outSouthPane.add(writeProtect);
// 编辑保护勾选后展示的内容 // 编辑保护勾选后展示的内容
writeProtectPane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); writeProtectPane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
outSouthPane.add(writeProtectPane);
// 工作表密码 // 工作表密码
workbookPassword = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Password"), true); 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); protectedField = new UITextField(11);
protectedWordPane.add(workbookPassword);
protectedWordPane.add(protectedField);
// 仅限预览 // 仅限预览
onlyForPreview = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Export_Only_For_Preview")); onlyForPreview = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Export_Only_For_Preview"));
JPanel onlyForPreviewPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
onlyForPreviewPane.add(onlyForPreview);
wrapButtonsInButtonGroup(workbookPassword, onlyForPreview); wrapButtonsInButtonGroup(workbookPassword, onlyForPreview);
writeProtectPane.add(protectedWordPane); writeProtectPane.add(column(LayoutConstants.VERTICAL_GAP,
writeProtectPane.add(onlyForPreviewPane); 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() { writeProtect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (writeProtect.isSelected()) { writeProtectPane.setVisible(writeProtect.isSelected());
writeProtectPane.setVisible(true);
} else {
writeProtectPane.setVisible(false);
}
} }
}); });
// 导出水印 // 导出水印
exportWaterMark = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark"), 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 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 actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark_Use"), UIConstants.FLESH_BLUE);
actionLabel.addActionListener(new ActionListener() { actionLabel.addActionListener(new ActionListener() {
@Override @Override
@ -133,10 +111,31 @@ public class ExcelExportPane extends BasicPane {
exportWaterMark.setSelected(true); exportWaterMark.setSelected(true);
} }
}); });
tips.add(uiLabel); //内容保护
tips.add(actionLabel); JPanel contextProtectPane = column(LayoutConstants.VERTICAL_GAP,
outSouthPane.add(tips); 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 @Override

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

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

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

@ -1,23 +1,26 @@
package com.fr.design.report; 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.base.extension.FileExtension;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.ImageExportAttr;
import com.fr.io.attr.ReportExportAttr; import com.fr.io.attr.ReportExportAttr;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Component;
import java.awt.Dimension;
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 static final String GLOBAL_CONF = Toolkit.i18nText("Fine-Design_Image_Export_Setting");
public ImageExportPane() { public ImageExportPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
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));
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips")); UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"));
tipLabel.setForeground(Color.GRAY); FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
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);
initGlobalSettings(); initGlobalSettings();
Component centerPane = column(LayoutConstants.VERTICAL_GAP,
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":")).weight(0.4),
JComponent[][] comps = { cell(this.globalResolutionBtnS).weight(0.4),
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":"), this.globalResolutionBtnS, this.globalResolutionBtnM, this.globalResolutionBtnL}, cell(this.globalResolutionBtnM).weight(0.4),
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":"), this.globalFormatJpg, null, this.globalFormatPng}, cell(this.globalResolutionBtnL).weight(0.4),
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.globalRenderQuality, null, this.globalRenderSpeed}, flex()),
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":"), this.templateThumbnail, null, this.templatePaging} row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":")).weight(0.4),
}; cell(this.globalFormatJpg).weight(0.8),
centerPane.add( cell(this.globalFormatPng).weight(0.4),
TableLayoutHelper.createCommonTableLayoutPane( flex()),
comps, row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":")).weight(0.4),
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, cell(this.globalRenderQuality).weight(0.8),
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, cell(this.globalRenderSpeed).weight(0.4),
GAP), flex()),
BorderLayout.CENTER); row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":")).weight(0.4),
centerPane.add(tipsTitlePane,BorderLayout.SOUTH); cell(this.templateThumbnail).weight(0.8),
outNorthPane.add(centerPane, BorderLayout.CENTER); 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() { private void initGlobalSettings() {
globalResolutionBtnS = new UIRadioButton("96dpi"); globalResolutionBtnS = new UIRadioButton("96dpi");
globalResolutionBtnM = new UIRadioButton("192dpi", true); 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; package com.fr.design.report;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; 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.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.io.attr.PDFExportAttr; import com.fr.io.attr.PDFExportAttr;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Dimension; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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 { public class PDFExportPane extends BasicPane {
private UICheckBox isNeedPassword; private UICheckBox isNeedPassword;
private UITextField passwordField; private UITextField passwordField;
@ -25,20 +28,9 @@ public class PDFExportPane extends BasicPane {
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
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);
isNeedPassword = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Password"), false); isNeedPassword = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Password"), false);
JPanel passwordPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); passwordWritePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
passwordPane.add(isNeedPassword);
passwordWritePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
passwordPane.add(passwordWritePane);
passwordField = new UITextField(11); passwordField = new UITextField(11);
passwordWritePane.add(passwordField); passwordWritePane.add(passwordField);
isNeedPassword.addActionListener(new ActionListener() { isNeedPassword.addActionListener(new ActionListener() {
@ -46,7 +38,11 @@ public class PDFExportPane extends BasicPane {
passwordWritePane.setVisible(isNeedPassword.isSelected()); 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 @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.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import javax.swing.*; import javax.swing.Icon;
import javax.swing.JList;
import com.fr.design.gui.ispinner.ColumnRowSpinner; 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.PaperSettingProvider;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; 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.stable.unit.MM;
import com.fr.design.utils.gui.GUICoreUtils; 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 * @author richer
* @since 6.5.5 创建于2011-6-14 页面设置面板 * @since 6.5.5 创建于2011-6-14 页面设置面板
@ -74,14 +87,12 @@ public class PageSetupPane extends BasicPane {
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
UITabbedPane centerTabbedPane = new UITabbedPane();
this.add(centerTabbedPane, BorderLayout.CENTER);
pagePane = new PagePane(); pagePane = new PagePane();
otherPane = new OtherPane(); otherPane = new OtherPane();
centerTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"), pagePane); FineTabbedPane tabbedPane = FineTabbedPane.builder().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); .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), otherPane).build();
this.add(tabbedPane, BorderLayout.CENTER);
} }
@Override @Override
@ -149,61 +160,39 @@ public class PageSetupPane extends BasicPane {
private Report report; private Report report;
public PagePane() { public PagePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
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();
portraitRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Portrait")); portraitRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Portrait"));
portraitRadioButton.setMnemonic('t'); portraitRadioButton.setMnemonic('t');
portraitpanel.add(portraitRadioButton);
innerorientationPane.add(portraitpanel);
portraitRadioButton.addActionListener(previewListener); portraitRadioButton.addActionListener(previewListener);
JPanel landscapepanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape")); landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape"));
innerorientationPane.add(landscapepanel);
landscapeRadioButton.setMnemonic('L'); landscapeRadioButton.setMnemonic('L');
landscapepanel.add(landscapeRadioButton);
landscapeRadioButton.addActionListener(previewListener); landscapeRadioButton.addActionListener(previewListener);
ButtonGroup layoutButtonGroup = new ButtonGroup(); ButtonGroup layoutButtonGroup = new ButtonGroup();
layoutButtonGroup.add(portraitRadioButton); layoutButtonGroup.add(portraitRadioButton);
layoutButtonGroup.add(landscapeRadioButton); layoutButtonGroup.add(landscapeRadioButton);
portraitRadioButton.setSelected(true); 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(); showPagePane = new ShowPagePane();
spp.add(showPagePane); Component spp = wrapComponentWithTitle(
defaultPane.add(spp); row(cell(showPagePane),
defaultPane.add(twoPane); flex()).getComponent(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")
);
// paper size // paper size
JPanel paperSizePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Paper_Size")); predefinedRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Predefined"));
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.setMnemonic('P'); predefinedRadioButton.setMnemonic('P');
predefinedRadioButton.addActionListener(previewListener); 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.setMnemonic('C');
customRadioButton.addActionListener(previewListener); customRadioButton.addActionListener(previewListener);
predefinedComboBox = new UIComboBox(); predefinedComboBox = new UIComboBox();
paperWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0)); paperWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0));
((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7); ((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7);
paperHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0)); 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(); txt = ((JSpinner.NumberEditor) paperHeightSpinner.getEditor()).getTextField();
((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false); ((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false);
unitLabel = new UnitFieldPane.UnitLabel(Constants.UNIT_MM, paperHeightSpinner.getPreferredSize().height); 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")}; 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]; Object[] tmpPaperSizeNameArray = ReportConstants.PaperSizeNameSizeArray[i];
predefinedComboBox.addItem(tmpPaperSizeNameArray[1]); 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(); ButtonGroup paperSizeRadioButtonGroup = new ButtonGroup();
paperSizeRadioButtonGroup.add(predefinedRadioButton); paperSizeRadioButtonGroup.add(predefinedRadioButton);
paperSizeRadioButtonGroup.add(customRadioButton); paperSizeRadioButtonGroup.add(customRadioButton);
// size and textfields. // tow radio buttons.
JPanel paperSizeRightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel innerPaperSizePane = column(10,
innerpaperSizePane.add(paperSizeRightPane); row(10, cell(predefinedRadioButton), cell(predefinedComboBox).weight(0.8), flex()),
row(cell(customRadioButton),
paperSizeRightPane.add(customRadioButton); fix(10),
paperSizeRightPane.add(paperWidthSpinner); cell(paperWidthSpinner).weight(0.4),
paperSizeRightPane.add(new UILabel("x")); fix(5),
paperSizeRightPane.add(paperHeightSpinner); cell(new UILabel("x")),
paperSizeRightPane.add(switchInch); 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:设置边距.. // 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(); StringBuffer temp = new StringBuffer();
for (int i = 0; i < 11; i++) { for (int i = 0; i < 11; i++) {
temp.append("&nbsp"); temp.append("&nbsp");
@ -275,70 +256,50 @@ public class PageSetupPane extends BasicPane {
zeroMarginWarn.setForeground(Color.RED); zeroMarginWarn.setForeground(Color.RED);
// left // 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); 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); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginLeftUnitPane.add(marginBottomUnitFieldPane); JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)),
// right row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane))
JPanel marginRightPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); ).getComponent();
marginPane.add(marginRightPane);
// peter:这个一个垂直的上下的字符panel. // 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); 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); 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); marginTopUnitFieldPane.getTextField().addFocusListener(fa);
marginBottomUnitFieldPane.getTextField().addFocusListener(fa); marginBottomUnitFieldPane.getTextField().addFocusListener(fa);
marginLeftUnitFieldPane.getTextField().addFocusListener(fa); marginLeftUnitFieldPane.getTextField().addFocusListener(fa);
marginRightUnitFieldPane.getTextField().addFocusListener(fa); marginRightUnitFieldPane.getTextField().addFocusListener(fa);
JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane), cell(zeroMarginWarn)).getComponent();
marginPane.add(zeroMarginWarn); //方向-页边距
JPanel twoPane = row(10,
// header and footer cell(wrapComponentWithTitle(orientationPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25),
JPanel outhfHeightPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height")); cell(wrapComponentWithTitle(marginPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8)
JPanel hfHeightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); ).getComponent();
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") + ":"));
//高度
headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); 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); 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. // print gridlines.
JPanel printOptionPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); Component defaultPane = column(LayoutConstants.VERTICAL_GAP, cell(spp), cell(twoPane), cell(paperSizePane), cell(heightPane)).getComponent();
defaultPane.add(printOptionPane);
printOptionPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); JPanel workPanel = new JPanel(new BorderLayout());
workPanel.add(defaultPane);
workPanel.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(workPanel);
} }
@Override @Override
@ -387,11 +348,6 @@ public class PageSetupPane extends BasicPane {
} }
}; };
/**
* Populate
*
* @param reportSettings rpt settings.
*/
public void populate(Report report, int unitType) { public void populate(Report report, int unitType) {
this.report = report; this.report = report;
ReportSettingsProvider reportSettings = report.getReportSettings(); ReportSettingsProvider reportSettings = report.getReportSettings();
@ -602,13 +558,11 @@ public class PageSetupPane extends BasicPane {
* Create icon radio pane for Portrait and Landscape. * Create icon radio pane for Portrait and Landscape.
*/ */
private JPanel createIconRadioPane(Icon icon, UIRadioButton radioButton) { 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; private UIRadioButton isShrinkToFit4Width;
public OtherPane() { public OtherPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
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);
// page order 分页顺序
Icon topBottomIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/down.png"); 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); 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'); topBottomRadioButton.setMnemonic('B');
Icon leftRightIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/over.png"); 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); 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'); leftRightRadioButton.setMnemonic('R');
ButtonGroup pageOrderButtonGroup = new ButtonGroup(); ButtonGroup pageOrderButtonGroup = new ButtonGroup();
pageOrderButtonGroup.add(topBottomRadioButton); pageOrderButtonGroup.add(topBottomRadioButton);
pageOrderButtonGroup.add(leftRightRadioButton); pageOrderButtonGroup.add(leftRightRadioButton);
topBottomRadioButton.setSelected(true); topBottomRadioButton.setSelected(true);
// center on page JPanel pageOrderPane = row(
JPanel outcenterOnPagePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Placement_Center_On_Page")); cell(new UILabel(topBottomIcon)),
JPanel centerOnPagePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); cell(topBottomRadioButton),
outcenterOnPagePane.add(centerOnPagePane); fix(20),
defaultPane.add(outcenterOnPagePane); 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 = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Horizontally"), false, false);
this.horizonalCenterCheckBox.setMnemonic('H'); this.horizonalCenterCheckBox.setMnemonic('H');
this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically"), false, false); this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically"), false, false);
this.verticalCenterCheckBox.setMnemonic('V'); 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)); // first page number. 起始页码
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") + ": "));
// marks: 这个地方必须为大于零的整数 // marks: 这个地方必须为大于零的整数
firstPageNumberSpinner = new UISpinner(1, Integer.MAX_VALUE, 1, 1); firstPageNumberSpinner = new UISpinner(1, Integer.MAX_VALUE, 1, 1);
firstPaneNumberPane.add(firstPageNumberSpinner); JPanel firstPaneNumberPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_First_Page_Number"))),
defaultPane.add(Box.createVerticalStrut(4)); cell(firstPageNumberSpinner)
).getComponent();
// print gridlines.
JPanel printOptionPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
defaultPane.add(printOptionPane);
printOptionPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
JPanel autoShrinkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); // print gridlines. 根据单元格内容自动调整
autoShrinkPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Shrink_To_Fit_Content")));
isShrinkToFit4None = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No")); 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")); 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")); isShrinkToFit4Width = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Column_Width"));
ButtonGroup bp = new ButtonGroup(); ButtonGroup bp = new ButtonGroup();
autoShrinkPane.add(isShrinkToFit4None);
autoShrinkPane.add(isShrinkToFit4Height);
autoShrinkPane.add(isShrinkToFit4Width);
bp.add(isShrinkToFit4None); bp.add(isShrinkToFit4None);
bp.add(isShrinkToFit4Height); bp.add(isShrinkToFit4Height);
bp.add(isShrinkToFit4Width); bp.add(isShrinkToFit4Width);
JPanel autoShrinkPane = row(LayoutConstants.HORIZONTAL_GAP,
printOptionPane.add(autoShrinkPane); 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 @Override

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

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

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

@ -1,6 +1,9 @@
package com.fr.design.report; 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.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
@ -15,14 +18,19 @@ import com.fr.io.attr.WordExportAttr;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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 { public class WordExportPane extends BasicPane {
private UICheckBox isExportAsTable; private UICheckBox isExportAsTable;
// 编辑保护 // 编辑保护
@ -43,46 +51,31 @@ public class WordExportPane extends BasicPane {
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
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);
isExportAsTable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Is_Need_Word_Adjust"), false); isExportAsTable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Is_Need_Word_Adjust"), false);
MultilineLabel wordLineLabel = new MultilineLabel(); MultilineLabel wordLineLabel = new MultilineLabel();
wordLineLabel.setPreferredSize(new Dimension(560, 50));
wordLineLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alert_Word")); wordLineLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alert_Word"));
wordLineLabel.setForeground(Color.GRAY); wordLineLabel.setForeground(Color.GRAY);
outNorthPane.add(isExportAsTable); JPanel exportSettingPane = new JPanel(new BorderLayout());
outNorthPane.add(wordLineLabel); exportSettingPane.add(column(LayoutConstants.VERTICAL_GAP, cell(isExportAsTable), cell(wordLineLabel)).getComponent());
// 内容保护
JPanel outSouthPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"));
outSouthPane.setPreferredSize(new Dimension(580, 250));
outPane.add(outSouthPane);
// 编辑保护 // 编辑保护
writeProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_Write_Protect"), false); writeProtect = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_Write_Protect"), false);
outSouthPane.add(writeProtect);
// 编辑保护勾选后展示的内容 // 编辑保护勾选后展示的内容
writeProtectPane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); writeProtectPane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
outSouthPane.add(writeProtectPane);
// 工作表密码 // 工作表密码
workbookPassword = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sheet_Password"), true); 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); protectedField = new UITextField(11);
protectedWordPane.add(workbookPassword);
protectedWordPane.add(protectedField);
// 仅限预览 // 仅限预览
onlyForPreview = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Export_Only_For_Preview")); onlyForPreview = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Export_Only_For_Preview"));
JPanel onlyForPreviewPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
onlyForPreviewPane.add(onlyForPreview);
wrapButtonsInButtonGroup(workbookPassword, onlyForPreview); wrapButtonsInButtonGroup(workbookPassword, onlyForPreview);
writeProtectPane.add(protectedWordPane); writeProtectPane.add(column(LayoutConstants.VERTICAL_GAP,
writeProtectPane.add(onlyForPreviewPane); 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() { writeProtect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (writeProtect.isSelected()) { if (writeProtect.isSelected()) {
@ -91,15 +84,11 @@ public class WordExportPane extends BasicPane {
writeProtectPane.setVisible(false); writeProtectPane.setVisible(false);
} }
} }
}); });
// 导出水印 // 导出水印
exportWaterMark = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark"), 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 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 actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Report_Export_WaterMark_Use"), UIConstants.FLESH_BLUE);
actionLabel.addActionListener(new ActionListener() { actionLabel.addActionListener(new ActionListener() {
@Override @Override
@ -110,9 +99,24 @@ public class WordExportPane extends BasicPane {
exportWaterMark.setSelected(true); exportWaterMark.setSelected(true);
} }
}); });
tips.add(uiLabel); //内容保护
tips.add(actionLabel); JPanel contextProtectPane = column(10,
outSouthPane.add(tips); 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 @Override
@ -120,6 +124,10 @@ public class WordExportPane extends BasicPane {
return "WordExport"; 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) { public void populate(WordExportAttr wordExportAttr) {
if(wordExportAttr == null){ if(wordExportAttr == null){
return; 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.base.mobile.MobileFitAttrState;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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. * Created by 夏翔 on 2016/5/28.
*/ */
@ -29,18 +32,17 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
horizionPane = new MobileRadioGroupPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Horizontal")); 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")); verticalPane = new MobileRadioGroupPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Vertical"));
ActionListener actionListener = getAppPreviewActionListener(); ActionListener actionListener = getAppPreviewActionListener();
horizionPane.addActionListener(actionListener); horizionPane.addActionListener(actionListener);
verticalPane.addActionListener(actionListener); verticalPane.addActionListener(actionListener);
fitOpsPane.add(horizionPane, BorderLayout.NORTH); this.add(
fitOpsPane.add(verticalPane, BorderLayout.SOUTH); wrapComponentWithTitle((column(10,
borderPane.add(fitOpsPane); row(cell(horizionPane)),
this.add(borderPane); row(cell(verticalPane))
).getComponent()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fit")));
} }
public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) { public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) {
@ -59,7 +61,6 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
} }
horizionPane.populateBean(ob.getHorziontalAttr()); horizionPane.populateBean(ob.getHorziontalAttr());
verticalPane.populateBean(ob.getVerticalAttr()); verticalPane.populateBean(ob.getVerticalAttr());
// radioCheckPane.populateBean(ob.isZoom());
appFitPreviewPane.refreshPreview(getCurrentFitOptions()); appFitPreviewPane.refreshPreview(getCurrentFitOptions());
} }
@ -68,8 +69,6 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
public ElementCaseMobileAttr updateBean() { public ElementCaseMobileAttr updateBean() {
MobileFitAttrState horizonState = horizionPane.updateBean(); MobileFitAttrState horizonState = horizionPane.updateBean();
MobileFitAttrState verticalState = verticalPane.updateBean(); MobileFitAttrState verticalState = verticalPane.updateBean();
// boolean isZoom = radioCheckPane.updateBean();
// return new ElementCaseMobileAttr(horizonState, verticalState, isZoom);
return new ElementCaseMobileAttr(horizonState, verticalState); 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; package com.fr.design.report.mobile;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.ImageIcon;
import javax.swing.*; import java.awt.BorderLayout;
import java.util.ArrayList; 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. * Created by 夏翔 on 2016/5/28.
*/ */
@ -44,18 +49,21 @@ public class AppFitPreviewPane extends BasicPane{
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
JPanel outnorthPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
this.add(outnorthPane);
horizontalImageLabel = new UILabel(); horizontalImageLabel = new UILabel();
horizontalImageLabel.setIcon(cachedHorizonPreviewImage.get(1)); horizontalImageLabel.setIcon(cachedHorizonPreviewImage.get(1));
outnorthPane.add(horizontalImageLabel);
verticalImagelabel = new UILabel(); verticalImagelabel = new UILabel();
verticalImagelabel.setIcon(cachedVerticalPreviewImage.get(0)); 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) { 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; package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane; 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.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.BorderFactory; import static com.fine.swing.ui.layout.Layouts.cell;
import javax.swing.JPanel; import static com.fine.swing.ui.layout.Layouts.row;
import java.awt.BorderLayout; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/** /**
* Created by plough on 2018/5/31. * Created by plough on 2018/5/31.
@ -27,15 +27,11 @@ public class MobileOthersPane extends BasicBeanPane<ElementCaseMobileAttr> {
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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")); 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")); allowDoubleClickOrZoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr_Allow_Zoom"));
contentPane.add(allowDoubleClickOrZoomCheckPane, BorderLayout.CENTER); this.add(wrapComponentWithTitle(row(LayoutConstants.HORIZONTAL_GAP, cell(appearRefreshCheckPane), cell(allowDoubleClickOrZoomCheckPane)).getComponent(),
borderPane.add(contentPane); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other")));
this.add(borderPane);
} }
@Override @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.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; 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 com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.ButtonGroup;
import java.awt.*; import java.awt.Component;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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. * Created by Administrator on 2016/5/16/0016.
*/ */
@ -27,10 +29,6 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
} }
private void initComponents(String title) { 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); IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL);
horizonRadio.setSelected(true); horizonRadio.setSelected(true);
IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL); 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); IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE);
addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio);
Component row =
Component[][] components = new Component[][]{ row(
new Component[] { cell(new UILabel(title)),
new UILabel(title), fix(10),
horizonRadio, cell(horizonRadio),
verticalRadio, fix(5),
bidirectionalRadio, cell(verticalRadio),
notFitRadio fix(5),
} cell(bidirectionalRadio),
}; fix(5),
JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); cell(notFitRadio),
fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); flex()
this.add(fitOpsPane); ).getComponent();
this.add(row);
} }
private void addToButtonGroup(IndexRadioButton... radios) { private void addToButtonGroup(IndexRadioButton... radios) {
@ -81,7 +80,6 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
return radioButtons.get(i).getRadioButtonIndex(); return radioButtons.get(i).getRadioButtonIndex();
} }
} }
return 0; 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; package com.fr.design.report.mobile;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.mobile.MobileRadioCheckPane; import com.fr.design.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; 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. * Created by 方磊 on 2016/11/8.
@ -25,20 +29,20 @@ public class MobileToolBarPane extends BasicBeanPane<ElementCaseMobileAttr> {
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel uiLabel = new UILabel("html5"); UILabel uiLabel = new UILabel("html5");
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15));
zoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Zoom")); 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")); refreshCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Refresh"));
toobarsPane.add(uiLabel, BorderLayout.WEST); this.add(
toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); FineUIUtils.wrapComponentWithTitle((column(10,
toobarsPane.add(refreshCheckPane, BorderLayout.EAST); row(cell(uiLabel)),
borderPane.add(toobarsPane); row(cell(zoomCheckPane)),
this.add(borderPane); row(cell(refreshCheckPane)),
flex()
).getComponent()),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_ToolBar")));
} }
@Override @Override

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

@ -1,11 +1,17 @@
package com.fr.design.report.mobile; package com.fr.design.report.mobile;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.report.mobile.ElementCaseMobileAttr; 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. * Created by Administrator on 2016/5/12/0012.
@ -23,23 +29,19 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
} }
private void initComponents() { private void initComponents() {
this.setLayout(new BorderLayout());
AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane(); 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(); reportMobileTemplateSettingsPane = new ReportMobileTemplateSettingsPane();
jPanel.add(reportMobileTemplateSettingsPane);
appFitBrowserPane = new AppFitBrowserPane(); appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
jPanel.add(appFitBrowserPane); JPanel panel = new JPanel(new BorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP,
jPanel.add(mobileOthersPane = new MobileOthersPane()); cell(reportMobileTemplateSettingsPane),
cell(appFitBrowserPane),
jPanel.add(appFitPreviewPane); cell(mobileOthersPane = new MobileOthersPane()),
UIScrollPane scrollPane = new UIScrollPane(jPanel); cell(appFitPreviewPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane); 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; 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.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.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; 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 com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; 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. * Created by plough on 2018/1/8.
@ -25,51 +29,37 @@ public class ReportMobileTemplateSettingsPane extends BasicBeanPane<ElementCaseM
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); this.add(wrapComponentWithTitle(getMobileCanvasSizeCheckPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Settings")));
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);
} }
/**
* 模板设置面板
* @return
*/
private JPanel getMobileCanvasSizeCheckPane() { 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")); mobileCanvasSizeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Mobile_Canvas_Size"));
panel.add(mobileCanvasSizeCheck, BorderLayout.NORTH); panel.add(column(LayoutConstants.VERTICAL_GAP,
panel.add(getCanvasDescPane(), BorderLayout.CENTER); cell(mobileCanvasSizeCheck),
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0)); cell(getCanvasDescPane())
).getComponent());
return panel; return panel;
} }
private JPanel getCanvasDescPane() { private JPanel getCanvasDescPane() {
UILabel desc1 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc")); 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 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")); UILabel desc3 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc"));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
double f = TableLayout.FILL; panel.add(column(LayoutConstants.VERTICAL_GAP, cell(desc1), cell(desc2), cell(desc3)).getComponent());
double p = TableLayout.PREFERRED; panel.setBorder(new ScaledEmptyBorder(0,20,0,0));
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));
return panel; return panel;
} }
private UILabel createDescLabel(String desc) { private UILabel createDescLabel(String desc) {
UILabel label = new UILabel(desc); UILabel label = new UILabel(desc);
label.setForeground(Color.gray); FineUIStyle.setStyle(label, FineUIStyle.LABEL_TIP);
return label; return label;
} }

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

@ -4,53 +4,48 @@
package com.fr.design.webattr; package com.fr.design.webattr;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import javax.swing.BorderFactory; import com.fr.design.constants.LayoutConstants;
import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.gui.itextfield.UITextField; 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.design.editor.editor.LongEditor;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr; 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 { public class CommonPane extends JPanel {
private UITextField titleTextField; private UITextField titleTextField;
private LongEditor cacheValidateTimeEditor; private LongEditor cacheValidateTimeEditor;
public CommonPane() { public CommonPane() {
this.initComponents(); this.initComponents();
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(6, 2, 4, 2)); this.titleTextField = new UITextField();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(northPane,BorderLayout.NORTH);
this.titleTextField = new UITextField(24);
this.cacheValidateTimeEditor = new LongEditor(); this.cacheValidateTimeEditor = new LongEditor();
JPanel workPanel = new JPanel(new BorderLayout());
JComponent[][] comps = { workPanel.add(column(LayoutConstants.VERTICAL_GAP,
{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")} 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)
this.add( ),
TableLayoutHelper.createCommonTableLayoutPane( //报表缓存有效时间
comps, row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cache_Validate_Time"))).weight(0.2),
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED}, row(cell(this.cacheValidateTimeEditor).weight(0.7), fix(5), cell(new UILabel("milliseconds")).weight(0.3)).weight(0.4),
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}, flex(0.4)
4), )
BorderLayout.CENTER); ).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
this.add(workPanel);
} }
public void populate(ReportWebAttr reportWebAttr) { 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; 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.core.WidgetOption;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; 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.Location;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.DropMode; import javax.swing.DropMode;
import javax.swing.Icon; import javax.swing.Icon;
@ -16,18 +18,22 @@ import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import javax.swing.DefaultListCellRenderer;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.TransferHandler; import javax.swing.TransferHandler;
import javax.swing.BorderFactory;
import javax.swing.UIManager;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; 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以实现自定义工具栏.服务器配置那儿的 * richer:拖拽ToolBar button以实现自定义工具栏.服务器配置那儿的
@ -65,29 +71,45 @@ public class DragToolBarPane extends WidgetToolBarPane {
toolbarButtonList.setDropMode(DropMode.ON_OR_INSERT); toolbarButtonList.setDropMode(DropMode.ON_OR_INSERT);
toolbarButtonList.setDragEnabled(true); toolbarButtonList.setDragEnabled(true);
toolbarButtonList.setTransferHandler(new FromTransferHandler()); toolbarButtonList.setTransferHandler(new FromTransferHandler());
northToolBar = new ToolBarPane(); toolbarButtonList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
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);
JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); 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); 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(top, BorderLayout.EAST);
northContentPane.add(northToolBar, BorderLayout.CENTER); 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(); 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); 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(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER); southContentPane.add(southToolBar, BorderLayout.CENTER);
southContentPane.setBackground(Color.lightGray); southContentPane.setBorder(new ScaledEmptyBorder(4,0,4,0));
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); southContentPane.setOpaque(false);
movePane.add(northContentPane, BorderLayout.NORTH); JPanel bottomToolbarPanel = new JPanel(new BorderLayout());
movePane.add(toolbarButtonList, BorderLayout.CENTER); bottomToolbarPanel.add(southContentPane);
movePane.add(southContentPane, BorderLayout.SOUTH); 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); this.add(new JScrollPane(movePane), BorderLayout.CENTER);
JPanel buttonPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); JPanel buttonPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
@ -98,7 +120,6 @@ public class DragToolBarPane extends WidgetToolBarPane {
southToolBar.removeButtonList(); southToolBar.removeButtonList();
southToolBar.repaint(); southToolBar.repaint();
northToolBar.removeButtonList(); northToolBar.removeButtonList();
if (defaultToolBar == null) { if (defaultToolBar == null) {
return; return;
} }
@ -121,6 +142,7 @@ public class DragToolBarPane extends WidgetToolBarPane {
northToolBar.repaint(); northToolBar.repaint();
} }
}); });
buttonPane.add(removeButton);
this.add(buttonPane, BorderLayout.SOUTH); 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.base.print.PrintSettingsAttrMark;
import com.fr.config.PrintConfig; import com.fr.config.PrintConfig;
import com.fr.config.ServerPreferenceConfig; 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.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.webattr.printsettings.GlobalNativePrintSettingPane; import com.fr.design.webattr.printsettings.GlobalNativePrintSettingPane;
@ -28,7 +28,7 @@ import java.awt.BorderLayout;
*/ */
public class EditReportServerParameterPane extends LoadingBasicPane { public class EditReportServerParameterPane extends LoadingBasicPane {
private UITabbedPane tabbedPane; private FineTabbedPane tabbedPane;
private PageToolBarPane pagePane; private PageToolBarPane pagePane;
private ViewToolBarPane viewPane; private ViewToolBarPane viewPane;
@ -54,20 +54,22 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
JPanel defaultPane = container; JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout()); defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());
//Tabbed Pane //服务器-服务器配置
tabbedPane = new UITabbedPane(); FineTabbedPane.TabPaneBuilder tabPaneBuilder = FineTabbedPane.builder()
defaultPane.add(tabbedPane, BorderLayout.CENTER); .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())
tabbedPane.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_M_Data_Analysis_Settings"), viewPane = new ViewToolBarPane())
tabbedPane.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_ReportServerP_Import_Css"), cssPane = new WebCssPane())
tabbedPane.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_JavaScript"), jsPane = new WebJsPane())
tabbedPane.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_Error_Handler_Template"), errorTemplatePane = new ErrorTemplatePane())
tabbedPane.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_Print_Setting"), printSettingPane = new PrintSettingPane(new GlobalNativePrintSettingPane()));
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()));
if (WorkContext.getCurrent().isRoot()) { 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 @Override

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

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

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

@ -1,47 +1,45 @@
package com.fr.design.webattr; package com.fr.design.webattr;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; 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 javax.swing.JPanel;
import java.awt.BorderLayout; 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> { public class ErrorTemplatePane extends BasicBeanPane<String> {
private UITextField templateField = null; private UITextField templateField = null;
public ErrorTemplatePane() { public ErrorTemplatePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.templateField = new UITextField();
JPanel northPane = column(LayoutConstants.VERTICAL_GAP,
this.templateField = new UITextField(36); row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Path"))),
// TableLayout cell(this.templateField).weight(1)
double p = TableLayout.PREFERRED; ),
double[] rowSize = {p, p, p, p, p}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Parameters"))),
double[] columnSize = {p, p}; row(
cell(new UILabel("message" + ":")),
JPanel reportletNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Message")))
reportletNamePane.add(this.templateField); ),
row(
Component[][] components = { cell(new UILabel("charset" + ":")),
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Path") + ":"), reportletNamePane}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Charset")))
),
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Parameters") + ":"), null}, row(
{new UILabel("message" + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Message"))}, cell(new UILabel("exception" + ":")),
{new UILabel("charset" + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Charset"))}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Exception_Stack_Trace")))
{new UILabel("exception" + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Exception_Stack_Trace"))} )
}; ).getComponent();
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); northPane.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(northPane);
this.add(northPane, BorderLayout.NORTH);
} }
@Override @Override
@ -59,6 +57,4 @@ public class ErrorTemplatePane extends BasicBeanPane<String> {
public String updateBean() { public String updateBean() {
return this.templateField.getText(); 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; package com.fr.design.webattr;
import com.fine.theme.icon.LazyIcon; 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.actions.UpdateAction;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
@ -32,6 +36,9 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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_事件名"来进行命名 * richer:调用该类并且对事件名字国际化时需要严格按照"FR-Engine_Event_事件名"来进行命名
*/ */
@ -53,14 +60,8 @@ public class EventPane extends BasicPane {
int len = eventName.length; int len = eventName.length;
this.eventName = Arrays.copyOf(eventName, len); this.eventName = Arrays.copyOf(eventName, len);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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); addAction = new AddMenuDef(this.eventName);
editAction = new EditAction(); editAction = new EditAction();
removeAction = new RemoveAction(); removeAction = new RemoveAction();
ToolBarDef def = new ToolBarDef(); ToolBarDef def = new ToolBarDef();
@ -69,8 +70,16 @@ public class EventPane extends BasicPane {
def.addShortCut(removeAction); def.addShortCut(removeAction);
UIToolbar toolBar = ToolBarDef.createJToolBar(); UIToolbar toolBar = ToolBarDef.createJToolBar();
def.updateToolBar(toolBar); 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 @Override

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

@ -1,7 +1,10 @@
package com.fr.design.webattr; 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.base.ConfigManager;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; 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.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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.form.event.Listener;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -28,7 +29,6 @@ import com.fr.design.i18n.Toolkit;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.InputMethodEvent; import java.awt.event.InputMethodEvent;
@ -44,6 +44,12 @@ import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; 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 { public class PageToolBarPane extends AbstractEditToolBarPane {
private UIRadioButton centerRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Center_Display")); 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 UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField; 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 Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
//固定行数分页,每页最多500行,最少1行数据 //固定行数分页,每页最多500行,最少1行数据
@ -68,14 +73,13 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
public PageToolBarPane() { public PageToolBarPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
leftRadioButton.setSelected(true); leftRadioButton.setSelected(true);
buttonGroup.add(centerRadioButton); buttonGroup.add(centerRadioButton);
buttonGroup.add(leftRadioButton); 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")); 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")); 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); 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); editToolBarButton.addActionListener(editBtnListener);
JPanel editToolBarButtonPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
editToolBarButtonPanel.add(editToolBarButton);
isUseToolBarCheckBox.setSelected(true); isUseToolBarCheckBox.setSelected(true);
isUseToolBarCheckBox.addActionListener(new ActionListener() { isUseToolBarCheckBox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
editToolBarButton.setEnabled(isUseToolBarCheckBox.isSelected()); editToolBarButton.setEnabled(isUseToolBarCheckBox.isSelected());
} }
}); });
double p = TableLayout.PREFERRED; pageFixedRowCountTextField = new UITextField();
pageFixedRowCountTextField = new UITextField(5);
pageFixedRowCountTextField.setText("30"); pageFixedRowCountTextField.setText("30");
pageFixedRowCountTextField.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Count_Tip")); pageFixedRowCountTextField.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Count_Tip"));
pageFixedRowCountTextField.addKeyListener(rowCountKeyListener); pageFixedRowCountTextField.addKeyListener(rowCountKeyListener);
pageFixedRowCountTextField.addInputMethodListener(rowCountInputMethodListener); 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")); UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"));
tipLabel.setForeground(TIPS_FONT_COLOR); FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
double[] columnSize = {p, p, p, p}; JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
double[] rowSize = {p, p, p, p, p}; //报表显示位置:居中展示-左展示
Component[][] components = new Component[][]{ row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15),
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Show_Location") + ":", UILabel.RIGHT), buttonPane, null, null}, cell(centerRadioButton).weight(0.2),
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox, isTDHeavyBox}, cell(leftRadioButton).weight(0.15),
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Paging_Settings") + ":", UILabel.RIGHT), isPageFixedRowBox, linesPerPagePane, null}, flex(0.5)
new Component[]{null, tipLabel, null, null}, ),
new Component[]{isUseToolBarCheckBox, editToolBarButtonPanel, null, null} //页面:以图片方式显示-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(column(LayoutConstants.VERTICAL_GAP,
this.add(northPanel, BorderLayout.NORTH); 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的情况下,就有默认工具栏 //wei : 默认没config.xml的情况下,就有默认工具栏
ToolBarManager toolBarManager = ToolBarManager.createDefaultToolBar(); ToolBarManager toolBarManager = ToolBarManager.createDefaultToolBar();
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
this.toolBarManagers = new ToolBarManager[]{toolBarManager}; this.toolBarManagers = new ToolBarManager[]{toolBarManager};
this.add(center, BorderLayout.CENTER);
} }
@Override @Override

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

@ -1,14 +1,13 @@
package com.fr.design.webattr; package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; 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.general.ComparatorUtils;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebPage; import com.fr.report.web.WebPage;
@ -16,7 +15,6 @@ import com.fr.stable.StringUtils;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import java.awt.Color;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.InputMethodEvent; import java.awt.event.InputMethodEvent;
@ -27,11 +25,15 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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> { public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UIRadioButton centerRadioButton; private UIRadioButton centerRadioButton;
private UIRadioButton leftRadioButton; private UIRadioButton leftRadioButton;
@ -40,7 +42,6 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UICheckBox isTDHeavyBox; private UICheckBox isTDHeavyBox;
private UICheckBox isPageFixedRowBox; private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField; 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 Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
private static final String DEFAULT_ROW_COUNT = "30"; private static final String DEFAULT_ROW_COUNT = "30";
@ -52,6 +53,10 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
super(); super();
} }
/**
* 模板-模板Web属性-分页预览设置中其余设置面板通用部分在父类绘制
* @return
*/
@Override @Override
protected JPanel createOtherSetPane() { protected JPanel createOtherSetPane() {
centerRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Center_Display")); 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); leftRadioButton.setSelected(true);
buttonGroup.add(centerRadioButton); buttonGroup.add(centerRadioButton);
buttonGroup.add(leftRadioButton); 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")); 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")); 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); 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();
pageFixedRowCountTextField = new UITextField(5);
pageFixedRowCountTextField.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Count_Tip")); pageFixedRowCountTextField.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Count_Tip"));
pageFixedRowCountTextField.addKeyListener(new KeyAdapter() { pageFixedRowCountTextField.addKeyListener(new KeyAdapter() {
@Override @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")); UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"));
tipLabel.setForeground(TIPS_FONT_COLOR); FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
double[] columnSize = {p, p, p, p}; //其余设置面板布局
double[] rowSize = {p, p, p, p}; return column(LayoutConstants.VERTICAL_GAP,
Component[][] components = new Component[][]{ //报表显示位置
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location") + ":", UILabel.RIGHT), buttonpane, null, null}, row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox, isTDHeavyBox}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15),
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Paging_Settings") + ":", UILabel.RIGHT), isPageFixedRowBox, linesPerPagePane, null}, cell(centerRadioButton).weight(0.2),
new Component[]{null, tipLabel, null, null} cell(leftRadioButton).weight(0.15),
flex(0.5)
}; ),
//页面
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); 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; package com.fr.design.webattr;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.web.Printer; import com.fr.report.web.Printer;
/** /**
@ -23,7 +23,7 @@ public class ReportServerPrinterPane extends JPanel {
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(6, 2, 4, 2)); this.setBorder(new ScaledEmptyBorder(10,10,10,10));
serverPrinterPane = new ServerPrinterPane(); serverPrinterPane = new ServerPrinterPane();
this.add(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; 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.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundPane; import com.fr.design.style.background.BackgroundPane;
import com.fr.design.style.background.BackgroundPane4Browser; import com.fr.design.style.background.BackgroundPane4Browser;
@ -19,19 +19,13 @@ import java.awt.*;
*/ */
public class ReportWebAttrPane extends LoadingBasicPane { public class ReportWebAttrPane extends LoadingBasicPane {
private ReportWebAttr reportWebAttr; private ReportWebAttr reportWebAttr;
private UITabbedPane tabbedPane;
private CommonPane commonPane; private CommonPane commonPane;
private ReportServerPrinterPane serverPrintPane; private ReportServerPrinterPane serverPrintPane;
private PageWebSettingPane pageWeb; private PageWebSettingPane pageWeb;
private WriteWebSettingPane writeWeb; private WriteWebSettingPane writeWeb;
private ViewWebSettingPane viewWeb; private ViewWebSettingPane viewWeb;
private BackgroundPane backgroundPane; private BackgroundPane backgroundPane;
protected WebCssPane cssPane; protected WebCssPane cssPane;
protected WebJsPane jsPane; protected WebJsPane jsPane;
@ -39,20 +33,20 @@ public class ReportWebAttrPane extends LoadingBasicPane {
protected synchronized void initComponents(JPanel container) { protected synchronized void initComponents(JPanel container) {
JPanel defaultPane = container; JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout()); defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());
//模板-模板Web属性
//Tabbed Pane FineTabbedPane tabbedPane = FineTabbedPane.builder()
tabbedPane = new UITabbedPane(); .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); 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 @Override

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

@ -1,5 +1,6 @@
package com.fr.design.webattr; package com.fr.design.webattr;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.core.WidgetOptionFactory; 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.ShowCellValue;
import com.fr.report.web.button.write.StashButton; import com.fr.report.web.button.write.StashButton;
import com.fr.report.web.button.write.Submit; import com.fr.report.web.button.write.Submit;
import com.fr.report.web.button.write.SubmitForcibly;
import com.fr.report.web.button.write.Verify; import com.fr.report.web.button.write.Verify;
public class ReportWebWidgetConstants { 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"), public static final WidgetOption SUBMIT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Submit"),
Submit.class); BaseUtils.readIcon("/com/fr/web/images/save.png"), Submit.class);
// flash打印按钮 // flash打印按钮
public static final WidgetOption FLASHPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Print[Client]"), 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 // appletprint
public static final WidgetOption APPLETPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Applet_Print"), 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导出 // 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"), public static final WidgetOption PDF = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_PDF"),
PDF.class); new LazyIcon("pdfFile"), PDF.class);
// 客户端PDF打印 // 客户端PDF打印
public static final WidgetOption PDFPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Print[Client]"), 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 EMAIL = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Email"),
public static final WidgetOption PRINTPREVIEW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PrintP_Print_Preview"), new LazyIcon("email"), Email.class);
BaseUtils.readIcon("/com/fr/web/images/preview.png"), PrintPreview.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 分页导出 // 导出成Excel 分页导出
public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Excel_Page"), 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 原样导出 // 导出成Excel 原样导出
public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Excel_Simple"), 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导出 // 导出成Excel 分页分Sheet导出
public static final WidgetOption EXCELS = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Excel_Page_To_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 // 导出成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 public static final WidgetOption EXPORT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Export"),
.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Export"), BaseUtils.readIcon("/com/fr/web/images/export.png"), Export.class); 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"), 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"), public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_First"),
First.class); 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"), public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Last"),
Last.class); 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"), 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"), public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ReportServerP_Next"),
Next.class); 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"), BaseUtils.readIcon("/com/fr/web/images/scale.png"), //缩放
Scale.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"), 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 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"), 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); 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"), 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); 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"), 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); 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"), 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 //自定义导入excel
public static final WidgetOption IMPORTEXCELDATA_CUSTOMIZED = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Import_Excel_Data_Customized"), 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 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); .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 public static final WidgetOption WRITESTASHCLEAR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine-Write_Clear"),
.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine-Write_Clear"), BaseUtils.readIcon("/com/fr/web/images/edit/clearstash.png"), ClearStashedButton.class); new LazyIcon("clearStash"), ClearStashedButton.class);
//Excel导入
//Excel导入_多次
public static final WidgetOption IMPORTEXCEL= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Repeat"), 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导入_覆盖 //Excel导入_覆盖
public static final WidgetOption IMPORTEXCEL_COVER= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Cover"), 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导入_清空 //Excel导入_清空
public static final WidgetOption IMPORTEXCEL_CLEAN= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Clean"), 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导入_增量 //Excel导入_增量
public static final WidgetOption IMPORTEXCEL_APPEND= WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Excel_Import_Append"), 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; 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.config.Configuration;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.Worker;
import java.awt.Color; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -78,10 +80,14 @@ public class ServerFitAttrPane extends BaseFitAttrPane {
}; };
} }
/**
* 服务器配置-PC端自适应属性面板中需要添加提示
*/
@Override @Override
protected void initPrompt() { protected void initPrompt() {
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Designer_Fit_Attr_Pane_Hint")); 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); contentJPanel.add(uiLabel);
} }
} }

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

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

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

@ -1,40 +1,49 @@
package com.fr.design.webattr; 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.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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 { public class SettingToolBar extends JPanel {
private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); private Icon setIcon = new LazyIcon("tool_config");
private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); private Icon delIcon = new LazyIcon("clear");
private UIButton setButton; private UIButton setButton;
private UIButton delButton; private UIButton delButton;
private ToolBarPane toolBarPane; private ToolBarPane toolBarPane;
public SettingToolBar(String name,ToolBarPane toolBarPane) { public SettingToolBar(String name,ToolBarPane toolBarPane) {
super(); super(new BorderLayout());
// this.setBackground(Color.lightGray);
this.add(new UILabel(name));
this.toolBarPane = toolBarPane; 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.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit_Button_ToolBar"));
setButton.setAction(new SetAction()); 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.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Button_ToolBar"));
delButton.setAction(new DelAction()); 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) { 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; package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; 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.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.stable.StringUtils;
import javax.swing.*; import java.awt.Insets;
import java.awt.*; import java.awt.Graphics;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import javax.swing.Icon;
public class ToolBarButton extends UIButton implements MouseListener { public class ToolBarButton extends UIButton implements MouseListener {
private Widget widget; private Widget widget;
@ -27,16 +25,8 @@ public class ToolBarButton extends UIButton implements MouseListener {
public ToolBarButton(String text, Icon icon, Widget widget) { public ToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon); super(text, icon);
this.widget = widget; this.widget = widget;
if (widget instanceof com.fr.form.ui.Button) { //直接设置Icon图标
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; setIcon(icon);
String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
setIcon(new ImageIcon(iimage));
}
}
}
this.addMouseListener(this); this.addMouseListener(this);
setMargin(new Insets(0, 0, 0, 0)); setMargin(new Insets(0, 0, 0, 0));
} }
@ -79,7 +69,6 @@ public class ToolBarButton extends UIButton implements MouseListener {
this.no = no; this.no = no;
} }
protected void paintBorder(Graphics g) { protected void paintBorder(Graphics g) {
this.setBorderType(UIButton.NORMAL_BORDER); this.setBorderType(UIButton.NORMAL_BORDER);
super.paintBorder(g); super.paintBorder(g);

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

@ -1,11 +1,15 @@
package com.fr.design.webattr; 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.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; 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.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -23,19 +27,23 @@ import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.BorderFactory;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel; import javax.swing.table.TableColumnModel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Color;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.util.List; 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功能 * 新的拖拽ToolBar button以实现自定义工具栏 报表web设置那儿的.应该不叫ToolBarDragPane因为实际没有提供drag功能
* *
@ -48,9 +56,12 @@ public class ToolBarDragPane extends WidgetToolBarPane {
private int row = 7; private int row = 7;
private DefaultTableModel toolbarButtonTableModel; private DefaultTableModel toolbarButtonTableModel;
private JTable layoutTable; 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; private boolean isEnabled;
/**
* 工具栏Pane
*/
public ToolBarDragPane() { public ToolBarDragPane() {
WidgetOption[] options = ExtraDesignClassManager.getInstance().getWebWidgetOptions(); WidgetOption[] options = ExtraDesignClassManager.getInstance().getWebWidgetOptions();
if(options != null){ if(options != null){
@ -59,9 +70,13 @@ public class ToolBarDragPane extends WidgetToolBarPane {
} }
toolbarButtonTableModel = new TableModel(row ,COLUMN); toolbarButtonTableModel = new TableModel(row ,COLUMN);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
UIButton defaultButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Restore_Default")); //工具栏上方面板
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() { defaultButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
northToolBar.removeButtonList(); northToolBar.removeButtonList();
@ -78,26 +93,30 @@ public class ToolBarDragPane extends WidgetToolBarPane {
ToolBarDragPane.this.repaint(); ToolBarDragPane.this.repaint();
} }
}); });
northPanel.add(defaultButton, BorderLayout.EAST);
north.add(isUseToolBarCheckBox, BorderLayout.WEST); //顶部工具栏
JPanel aa = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel northContentPane = new JPanel(new BorderLayout());
aa.add(defaultButton);
north.add(aa, BorderLayout.CENTER);
this.add(north, BorderLayout.NORTH);
northToolBar = new ToolBarPane(); northToolBar = new ToolBarPane();
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); northToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
// northToolBar.setBackground(Color.lightGray); northToolBar.setOpaque(false);
SettingToolBar top = new SettingToolBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ToolBar_Top"), northToolBar);
UIButton topButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); top.setOpaque(false);
topButton.setBorder(null); northContentPane.add(northToolBar, BorderLayout.CENTER);
// topButton.setMargin(null); 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.setOpaque(false);
topButton.setContentAreaFilled(false); topButton.setContentAreaFilled(false);
topButton.setFocusPainted(false); topButton.setFocusPainted(false);
topButton.setRequestFocusEnabled(false); topButton.setRequestFocusEnabled(false);
topButton.addActionListener(new ActionListener() { topButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (isSelectedtable()) { 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.setMargin(null);
downButton.setOpaque(false); downButton.setOpaque(false);
downButton.setContentAreaFilled(false); downButton.setContentAreaFilled(false);
downButton.setFocusPainted(false); downButton.setFocusPainted(false);
downButton.setRequestFocusEnabled(false); downButton.setRequestFocusEnabled(false);
downButton.addActionListener(new ActionListener() { downButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (isSelectedtable()) { 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(); 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); 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(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER); 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); //工具栏面板center布局:顶部工具栏-上移动按钮-图标面板-下移动按钮-底部工具栏
movePane.add(center, BorderLayout.CENTER); JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
movePane.add(southContentPane, BorderLayout.SOUTH); movePane.add(column(1,
cell(topToolbarPanel),
this.add(new JScrollPane(movePane), BorderLayout.CENTER); cell(topButton),
isUseToolBarCheckBox.setSelected(true); cell(buttonTablePanel),
cell(downButton),
cell(bottomToolbarPanel)
).getComponent());
//工具栏整体面板
this.add(column(LayoutConstants.VERTICAL_GAP, cell(northPanel), cell(new JScrollPane(movePane))).getComponent());
} }
/**
* 图标列表
*/
private void initLayoutTable() { private void initLayoutTable() {
layoutTable = new JTable(toolbarButtonTableModel); layoutTable = new JTable(toolbarButtonTableModel);
layoutTable.setDefaultRenderer(Object.class, tableRenderer); layoutTable.setDefaultRenderer(Object.class, tableRenderer);
layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
layoutTable.setColumnSelectionAllowed(false); layoutTable.setColumnSelectionAllowed(false);
layoutTable.setRowSelectionAllowed(false); layoutTable.setRowSelectionAllowed(false);
// layoutTable.setBackground(Color.WHITE); layoutTable.setOpaque(false);
layoutTable.addMouseListener(new MouseAdapter() { layoutTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) { if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) {
@ -280,6 +306,7 @@ public class ToolBarDragPane extends WidgetToolBarPane {
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
this.setOpaque(false);
if (value instanceof WidgetOption) { if (value instanceof WidgetOption) {
WidgetOption nameOption = (WidgetOption)value; 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.BorderFactory;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.TransferHandler; import javax.swing.TransferHandler;
import java.awt.Component; import java.awt.*;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -55,6 +55,7 @@ public class ToolBarPane extends BasicBeanPane<ToolBar> {
public void initComponent() { public void initComponent() {
this.addMouseListener(listener); this.addMouseListener(listener);
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2));
this.setTransferHandler(new ToolBarHandler(TransferHandler.COPY)); this.setTransferHandler(new ToolBarHandler(TransferHandler.COPY));
this.setBorder(BorderFactory.createTitledBorder("")); 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; package com.fr.design.webattr;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.ConfigManager; import com.fr.base.ConfigManager;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; 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.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.report.web.Location; import com.fr.report.web.Location;
@ -27,23 +28,24 @@ import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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 { public class ViewToolBarPane extends AbstractEditToolBarPane {
private EventPane eventPane; private EventPane eventPane;
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 UIButton editToolBarButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); 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 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 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")); private UICheckBox listFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_List_Filter"));
public ViewToolBarPane() { public ViewToolBarPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(allPanel, BorderLayout.CENTER);
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
allPanel.add(northPane, BorderLayout.NORTH);
editToolBarButton.addActionListener(editBtnListener); editToolBarButton.addActionListener(editBtnListener);
isUseToolBarCheckBox.setSelected(true); isUseToolBarCheckBox.setSelected(true);
isUseToolBarCheckBox.addActionListener(new ActionListener() { isUseToolBarCheckBox.addActionListener(new ActionListener() {
@ -56,13 +58,23 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
sortCheckBox.setSelected(false); sortCheckBox.setSelected(false);
conditonFilterBox.setSelected(false); conditonFilterBox.setSelected(false);
listFilterBox.setSelected(false); listFilterBox.setSelected(false);
northPane.add(GUICoreUtils.createFlowPane(new Component[]{sortCheckBox, conditonFilterBox, listFilterBox}, FlowLayout.LEFT, 6)); JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
northPane.add(GUICoreUtils.createFlowPane(new Component[] {isUseToolBarCheckBox, editToolBarButton}, FlowLayout.LEFT)); row(LayoutConstants.HORIZONTAL_GAP, cell(sortCheckBox), cell(conditonFilterBox), cell(listFilterBox)),
northPane.add(GUICoreUtils.createFlowPane(showListenersLabel, FlowLayout.LEFT)); row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton))
).getComponent();
//事件编辑
JPanel eventPanel = new JPanel(new BorderLayout());
eventPane = new EventPane(new WebView().supportedEvents()); eventPane = new EventPane(new WebView().supportedEvents());
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane(); wrapBoldLabelWithUnderline(showListenersLabel);
center.add(eventPane, BorderLayout.CENTER); eventPanel.add(column(LayoutConstants.VGAP_SMALL, cell(showListenersLabel), cell(eventPane).weight(1)).getComponent());
allPanel.add(center, BorderLayout.CENTER);
//整体布局
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(northPanel),
cell(eventPanel).weight(1)
).getComponent());
//wei : 默认没config.xml的情况下,就有默认工具栏 //wei : 默认没config.xml的情况下,就有默认工具栏
ToolBarManager toolBarManager = ToolBarManager.createDefaultViewToolBar(); ToolBarManager toolBarManager = ToolBarManager.createDefaultViewToolBar();
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); 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.core.WidgetOption;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; 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.ToolBarManager;
import com.fr.report.web.WebView; import com.fr.report.web.WebView;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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> { public class ViewWebSettingPane extends WebSettingPane<WebView> {
private UICheckBox sortCheckBox; private UICheckBox sortCheckBox;
private UICheckBox conditionFilterBox; private UICheckBox conditionFilterBox;
@ -25,17 +27,24 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
super(); super();
} }
/**
* 模板-模板Web属性-数据分析设置中其余设置面板通用部分在父类绘制
* @return
*/
@Override @Override
protected JPanel createOtherSetPane() { protected JPanel createOtherSetPane() {
sortCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Sort_Sort")); 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")); 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")); listFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_List_Filter"));
sortCheckBox.setSelected(true); sortCheckBox.setSelected(true);
conditionFilterBox.setSelected(true); conditionFilterBox.setSelected(true);
listFilterBox.setSelected(true); listFilterBox.setSelected(true);
return GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview") + ":"), return row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15),
sortCheckBox, conditionFilterBox, listFilterBox}, FlowLayout.LEFT, 6); cell(sortCheckBox).weight(0.15),
cell(conditionFilterBox).weight(0.15),
cell(listFilterBox).weight(0.15),
flex(0.4)
).getComponent();
} }
@Override @Override

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

@ -1,5 +1,8 @@
package com.fr.design.webattr; 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.BasicPane;
import com.fr.design.gui.frpane.EditingStringListPane; import com.fr.design.gui.frpane.EditingStringListPane;
import com.fr.design.gui.ibutton.UIButton; 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.stable.project.ProjectConstants;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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 { public class WebCssPane extends BasicPane {
private UITextField localText; private UITextField localText;
UIButton chooseFile; UIButton chooseFile;
private EditingStringListPane centerPane; private EditingStringListPane centerPane;
public WebCssPane() { public WebCssPane() {
this.setLayout(new BorderLayout(0, 20)); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); 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 = new UITextField();
localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field")); localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field"));
localText.setEditable(false); localText.setEditable(false);
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection")); chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection"));
chooseFile.setPreferredSize(new Dimension(75, 23));
chooseFile.addActionListener(chooseFileListener); 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); UILabel info = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning",
outnorth.add(northPane,BorderLayout.NORTH);
UILabel infor = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning",
ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME)); ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME));
infor.setForeground(new Color(207, 42, 39)); FineUIStyle.setStyle(info, FineUIStyle.LABEL_WARNING_TIP);
outnorth.add(infor,BorderLayout.CENTER);
this.add(outnorth, BorderLayout.NORTH);
centerPane = new EditingStringListPane() { centerPane = new EditingStringListPane() {
@Override @Override
protected void selectedChanged(String selected) { protected void selectedChanged(String selected) {
localText.setText(selected); localText.setText(selected);
checkEnableState(); checkEnableState();
} }
@Override @Override
protected String getAddOrEditString() { protected String getAddOrEditString() {
return localText.getText(); 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() { private ActionListener chooseFileListener = new ActionListener() {
@ -122,6 +128,5 @@ public class WebCssPane extends BasicPane {
String a = valueList.get(i); String a = valueList.get(i);
reportWebAttr.addCSSImport(a); reportWebAttr.addCSSImport(a);
} }
} }
} }

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

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

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

@ -1,13 +1,14 @@
package com.fr.design.webattr; 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.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.core.WidgetOption;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; 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.form.event.Listener;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
@ -22,6 +23,11 @@ import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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> { public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane<ReportWebAttr> {
private static final String[] CHOOSEITEM = new String[] { private static final String[] CHOOSEITEM = new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single"), 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 int ZERO = 0;
private static final long LONGZERO = 0L; private static final long LONGZERO = 0L;
/**
* 模板-模板Web属性-分页预览设置/填报页面设置/数据分析设置通用面板
*/
public WebSettingPane() { public WebSettingPane() {
JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 6)); //以下设置
choseComboBox = new UIComboBox(CHOOSEITEM); choseComboBox = new UIComboBox(CHOOSEITEM);
choseComboBox.addItemListener(itemListener); choseComboBox.addItemListener(itemListener);
buttonPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set") + ":")); JPanel buttonPane = row(
buttonPane.add(choseComboBox); 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 = new ToolBarDragPane();
dragToolBarPane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance()); 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 { } else {
Component[][] components = new Component[][]{ panel.add(column(LayoutConstants.VERTICAL_GAP,
new Component[]{buttonPane}, cell(buttonPane),
new Component[]{dragToolBarPane}, cell(separatorLine),
new Component[]{eventpanel} cell(dragToolBarPane),
}; cell(eventPanel)
double[] rowSize2 = { p,p,f }; ).getComponent());
panel = TableLayoutHelper.createTableLayoutPane(components,rowSize2,columnSize);
} }
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(new UIScrollPane(panel));
UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane, BorderLayout.CENTER);
} }
ItemListener itemListener = new ItemListener() { 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; 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.base.ConfigManager;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; 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.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.report.web.Location; import com.fr.report.web.Location;
@ -35,6 +36,12 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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 { public class WriteToolBarPane extends AbstractEditToolBarPane {
private EventPane eventPane; private EventPane eventPane;
private UICheckBox colorBox; 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 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 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 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 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 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 unloadCheck;
private UICheckBox showWidgets; private UICheckBox showWidgets;
private UICheckBox isAutoStash;//自动暂存 private UICheckBox isAutoStash;//自动暂存
public WriteToolBarPane() { public WriteToolBarPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(allPanel, BorderLayout.CENTER);
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
allPanel.add(northPane, BorderLayout.NORTH);
//sheet标签页显示位置 //sheet标签页显示位置
ButtonGroup sheetButtonGroup = new ButtonGroup(); ButtonGroup sheetButtonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true); bottomRadioButton.setSelected(true);
sheetButtonGroup.add(topRadioButton); sheetButtonGroup.add(topRadioButton);
sheetButtonGroup.add(bottomRadioButton); 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:报表显示位置 //Sean:报表显示位置
ButtonGroup rptButtonGroup = new ButtonGroup(); ButtonGroup rptButtonGroup = new ButtonGroup();
leftRadioButton.setSelected(true); leftRadioButton.setSelected(true);
rptButtonGroup.add(leftRadioButton); rptButtonGroup.add(leftRadioButton);
rptButtonGroup.add(centerRadioButton); rptButtonGroup.add(centerRadioButton);
northPane.add(GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT)); JPanel showLocPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(rptShowLocationLabel),
colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Face_Write_Current_Edit_Row_Background") + ":"); 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.setSelected(false);
colorBox.addActionListener(colorListener); colorBox.addActionListener(colorListener);
colorButton = new UINoThemeColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); colorButton = new UINoThemeColorButton(new LazyIcon("background"));
northPane.add(GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT)); 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 = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unload_Check"));
unloadCheck.setSelected(true); unloadCheck.setSelected(true);
showWidgets = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Show_Widgets")); showWidgets = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Show_Widgets"));
showWidgets.setSelected(false); showWidgets.setSelected(false);
isAutoStash = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Auto_Stash")); isAutoStash = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Auto_Stash"));
isAutoStash.setSelected(false); 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); editToolBarButton.addActionListener(editBtnListener);
isUseToolBarCheckBox.setSelected(true); isUseToolBarCheckBox.setSelected(true);
isUseToolBarCheckBox.addActionListener(new ActionListener() { isUseToolBarCheckBox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
editToolBarButton.setEnabled(isUseToolBarCheckBox.isSelected()); editToolBarButton.setEnabled(isUseToolBarCheckBox.isSelected());
} }
}); });
northPane.add(GUICoreUtils.createFlowPane(new Component[]{isUseToolBarCheckBox, editToolBarButton}, FlowLayout.LEFT));
northPane.add(new UILabel()); JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
northPane.add(GUICoreUtils.createFlowPane(showListenersLabel, FlowLayout.LEFT)); cell(northPane),
row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton))
).getComponent();
//事件编辑
JPanel eventPanel = new JPanel(new BorderLayout());
eventPane = new EventPane(new WebWrite().supportedEvents()); eventPane = new EventPane(new WebWrite().supportedEvents());
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane(); wrapBoldLabelWithUnderline(showListenersLabel);
center.add(eventPane, BorderLayout.CENTER); eventPanel.add(column(LayoutConstants.VGAP_SMALL, cell(showListenersLabel), cell(eventPane).weight(1)).getComponent());
allPanel.add(center, BorderLayout.CENTER);
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(northPanel),
cell(eventPanel).weight(1)
).getComponent());
//wei : 默认没config.xml的情况下,就有默认工具栏 //wei : 默认没config.xml的情况下,就有默认工具栏
ToolBarManager toolBarManager = ToolBarManager.createDefaultWriteToolBar(); ToolBarManager toolBarManager = ToolBarManager.createDefaultWriteToolBar();
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
@ -112,7 +143,6 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
} }
private ActionListener editBtnListener = new ActionListener() { private ActionListener editBtnListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final DragToolBarPane dragToolbarPane = new DragToolBarPane(); final DragToolBarPane dragToolbarPane = new DragToolBarPane();
dragToolbarPane.setDefaultToolBar(ToolBarManager.createDefaultWriteToolBar(), getToolBarInstance()); 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; 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.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebWrite; import com.fr.report.web.WebWrite;
@ -16,13 +16,15 @@ import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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> { public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
private UICheckBox colorBox; private UICheckBox colorBox;
private UIColorButton colorButton; private UIColorButton colorButton;
@ -40,47 +42,63 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
super(); super();
} }
/**
* 模板-模板Web属性-填报页面设置中其余设置面板通用部分在父类绘制
* @return
*/
@Override @Override
protected JPanel createOtherSetPane() { 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标签页显示位置 //sheet标签页显示位置
topRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top")); 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")); 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(); ButtonGroup buttonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true); bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton); buttonGroup.add(topRadioButton);
buttonGroup.add(bottomRadioButton); 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 //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")); 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")); leftRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Left_Display"));
ButtonGroup rptShowButtonGroup = new ButtonGroup(); ButtonGroup rptShowButtonGroup = new ButtonGroup();
leftRadioButton.setSelected(true); leftRadioButton.setSelected(true);
rptShowButtonGroup.add(centerRadioButton); rptShowButtonGroup.add(centerRadioButton);
rptShowButtonGroup.add(leftRadioButton); 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 = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unload_Check"));
unloadCheck.setSelected(true); unloadCheck.setSelected(true);
showWidgets = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Show_Widgets")); showWidgets = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Show_Widgets"));
showWidgets.setSelected(false); showWidgets.setSelected(false);
isAutoStash = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Auto_Stash")); isAutoStash = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Auto_Stash"));
isAutoStash.setSelected(false); 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); JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
northPane.add(sheetPane); northPane.add(sheetPane);
northPane.add(showLocPane); 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; 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.PaperSize;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.print.NativePrintAttr; import com.fr.base.print.NativePrintAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; 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.UINumberField;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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.report.UnitFieldPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -24,15 +25,12 @@ import com.fr.stable.StringUtils;
import javax.print.DocFlavor; import javax.print.DocFlavor;
import javax.print.PrintService; import javax.print.PrintService;
import javax.print.PrintServiceLookup; import javax.print.PrintServiceLookup;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.FocusAdapter; import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -42,6 +40,12 @@ import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; 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. * Created by plough on 2018/3/5.
*/ */
@ -82,37 +86,40 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
} }
private void initComponents() { private void initComponents() {
JPanel printPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //默认配置
initCenterPane();
JPanel northPane = getHeaderPane(); JPanel printPane = column(LayoutConstants.VERTICAL_GAP,
printPane.add(northPane, BorderLayout.NORTH); cell(getHeaderPane()),
cell(wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Settings")))
centerPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default_Settings")); ).getComponent();
centerPane.add(getNativePrintMainSettingPane());
printPane.add(centerPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(printPane, BorderLayout.CENTER); this.add(printPane, BorderLayout.CENTER);
} }
/**
* 打印设置-本地软件打印-headerPane
* @return
*/
private JPanel getHeaderPane() { 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 = 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 showDialogTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Settings"));
UILabel showDialogCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Settings")); FineUIStyle.setStyle(showDialogTip, FineUIStyle.LABEL_TIP);
JPanel showDialogCheckPane = GUICoreUtils.createFlowPane(new Component[]{ JPanel showDialogCheckPane = row(LayoutConstants.VERTICAL_GAP,
showDialogCheck, showDialogCheckTip}, FlowLayout.LEFT); cell(showDialogCheck),
cell(showDialogTip)
).getComponent();
// 打印需要指定 sheet // 打印需要指定 sheet
needSelectSheetCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Need_Select_Sheet_When_Printing")); 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 needSelectSheetTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Invalid_In_Page_View"));
UILabel needSelectSheetCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Invalid_In_Page_View")); FineUIStyle.setStyle(needSelectSheetTip, FineUIStyle.LABEL_TIP);
JPanel needSelectSheetCheckPane = GUICoreUtils.createFlowPane(new Component[]{ JPanel needSelectSheetCheckPane = row(LayoutConstants.VERTICAL_GAP,
needSelectSheetCheck, needSelectSheetCheckTip}, FlowLayout.LEFT); cell(needSelectSheetCheck),
cell(needSelectSheetTip)
).getComponent();
return createHeaderPane(tipDownload, showDialogCheckPane, needSelectSheetCheckPane); 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(getAllPrinterNames());
printerComboBox = new UIComboBox(printerArray);
printerComboBox.setPreferredSize(new Dimension(200, printerComboBox.getPreferredSize().height));
JPanel printerPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
printerPane.add(printerComboBox);
// 份数 // 份数
copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(copySpinner, 5); // 页码标签
JPanel copyPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel printAreaLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
copyPane.add(copySpinner); 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 paperSettingPane = getPaperSettingPane();
JPanel paperSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPagePaperSettingCheck, paperSettingPane, true); JPanel paperSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPagePaperSettingCheck, paperSettingPane, true);
// 继承页面布局设置 // 继承页面布局设置
inheritPageLayoutSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Layout_Setting")); inheritPageLayoutSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Layout_Setting"));
JPanel layoutSettingPane = getLayoutSettingPane(); JPanel layoutSettingPane = getLayoutSettingPane();
JPanel layoutSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPageLayoutSettingCheck, layoutSettingPane, true); 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")); inheritPageMarginSettingCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Margin_Setting"));
pageMarginSettingPane = new PageMarginSettingPane(); pageMarginSettingPane = new PageMarginSettingPane();
pageMarginSettingPane.setBorder(BorderFactory.createEmptyBorder(10, -10, 0, 0));
JPanel pageMarginCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPageMarginSettingCheck, pageMarginSettingPane, true); JPanel pageMarginCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(inheritPageMarginSettingCheck, pageMarginSettingPane, true);
// 缩放 // 缩放
fitPaperSizeCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_To_Fit_Paper_Size")); fitPaperSizeCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_To_Fit_Paper_Size"));
JPanel scalePane = getScalePane(); JPanel scalePane = getScalePane();
scalePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
JPanel scaleCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(fitPaperSizeCheck, scalePane, true); JPanel scaleCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(fitPaperSizeCheck, scalePane, true);
// 整体布局
// TableLayout centerPane = column(LayoutConstants.VERTICAL_GAP,
double p = TableLayout.PREFERRED; row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.1),
double[] rowSize = {p, p, p, p, p, p, p}; cell(printerComboBox).weight(0.35),
double[] columnSize = {60, p}; flex(0.55)),
Component[][] components = { row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1),
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer") + ":"), printerPane}, cell(copySpinner).weight(0.15),
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number") + ":"), copyPane}, flex(0.75)),
{printAreaLabelPane, getPrintAreaPane()}, row(cell(printAreaLabelPane).weight(0.1),
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper") + ":"), paperSettingCheckPane}, cell(getPrintAreaPane()).weight(0.7),
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout") + ":"), layoutSettingCheckPane}, flex(0.2)),
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin") + ":"), pageMarginCheckPane}, row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper"))).weight(0.1),
{getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce") + ":"), scaleCheckPane}, cell(paperSettingCheckPane).weight(0.5),
}; flex(0.4)),
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 15); 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() { 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 = new UnitFieldPane(Constants.UNIT_MM);
customWidthFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getWidth()); 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 = new UnitFieldPane(Constants.UNIT_MM);
customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight()); customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight());
customHeightPane.add(customHeightFieldPane); customPaperSizePane = row(LayoutConstants.HORIZONTAL_GAP,
row(
customPaperSizePane.add(customWidthPane); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":")),
customPaperSizePane.add(customHeightPane); cell(customWidthFieldPane)
customPaperSizePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); ),
row(
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":")),
panel.add(comboPanel, BorderLayout.NORTH); cell(customHeightFieldPane)
panel.add(customPaperSizePane, BorderLayout.CENTER); )
).getComponent();
return panel; return column(10, cell(predefinedPaperSizeComboBox), cell(customPaperSizePane)).getComponent();
} }
private void updateCustomPaperSizeArea() { private void updateCustomPaperSizeArea() {
@ -309,23 +302,19 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
} }
private JPanel getLayoutSettingPane() { 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 = 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")); landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape"));
layoutSettingPane.add(portraitRadioButton);
layoutSettingPane.add(landscapeRadioButton);
ButtonGroup layoutButtonGroup = new ButtonGroup(); ButtonGroup layoutButtonGroup = new ButtonGroup();
layoutButtonGroup.add(portraitRadioButton); layoutButtonGroup.add(portraitRadioButton);
layoutButtonGroup.add(landscapeRadioButton); layoutButtonGroup.add(landscapeRadioButton);
portraitRadioButton.setSelected(true); portraitRadioButton.setSelected(true);
return layoutSettingPane; return row(10, cell(portraitRadioButton), cell(landscapeRadioButton)).getComponent();
} }
// 页码范围 /**
* 页码范围
* @return
*/
private JPanel getPrintAreaPane() { private JPanel getPrintAreaPane() {
allPageRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_All_Pages")); 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")); 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_Odd_Page"));
doublePrintComboBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Even_Page")); doublePrintComboBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Even_Page"));
// TableLayout return column(LayoutConstants.VERTICAL_GAP,
double p = TableLayout.PREFERRED; cell(allPageRadioButton),
double[] rowSize = {p, p, p, p}; cell(currentPageRadioButton),
double[] columnSize = {p, p, p}; row(cell(customPageRadioButton).weight(0.1), cell(specifiedAreaField).weight(0.3), cell(areaFieldTip).weight(0.1)),
Component[][] components = { row(cell(doublePrintRadioButton).weight(0.1),cell(doublePrintComboBox).weight(0.3), flex(0.1))
{allPageRadioButton, null, null}, ).getComponent();
{currentPageRadioButton, null, null},
{customPageRadioButton, specifiedAreaField, areaFieldTip},
{doublePrintRadioButton, doublePrintComboBox, new JPanel()}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 8);
} }
private JPanel getScalePane() { private JPanel getScalePane() {
@ -381,25 +365,12 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
scalePercentField.setMaxIntegerLength(3); scalePercentField.setMaxIntegerLength(3);
scalePercentField.setMaxDecimalLength(0); scalePercentField.setMaxDecimalLength(0);
scalePercentField.setMaxValue(200); scalePercentField.setMaxValue(200);
return row(cell(scalePercentField), cell(new UILabel("%"))).getComponent();
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);
} }
// 返回包含一个标签的 panel,标签始终位于 panel 顶部 // 返回包含一个标签的 panel,标签始终位于 panel 顶部
JPanel getTopAlignLabelPane(String labelText) { JPanel getTopAlignLabelPane(String labelText) {
JPanel labelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).getComponent();
labelPane.add(new UILabel(labelText), BorderLayout.NORTH);
labelPane.add(new JPanel(), BorderLayout.CENTER);
return labelPane;
} }
public void populate(NativePrintAttr nativePrintAttr) { 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; package com.fr.design.webattr.printsettings;
import com.fr.base.print.NativePrintAttr; import com.fr.base.print.NativePrintAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIIntNumberField; import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField; 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 com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Component; 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. * Created by plough on 2018/10/31.
*/ */
public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane { public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane {
private static final int PRINT_PORT_FIELD_COLUMNS = 8;
// 服务器配置面板特有的组件 // 服务器配置面板特有的组件
private UICheckBox defaultDownloadUrlCheck; // 采用默认的软件下载地址 private UICheckBox defaultDownloadUrlCheck; // 采用默认的软件下载地址
private UITextField customUrlFieldWin; private UITextField customUrlFieldWin;
private UITextField customUrlFieldMac; private UITextField customUrlFieldMac;
private UINumberField printPortField; // 打印软件端口号 private UINumberField printPortField; // 打印软件端口号
@Override @Override
JPanel createHeaderPane(Component... comps) { JPanel createHeaderPane(Component... comps) {
Component[] allComps = new Component[comps.length + 1]; Component[] allComps = new Component[comps.length + 1];
System.arraycopy(comps, 0, allComps, 0, comps.length); System.arraycopy(comps, 0, allComps, 0, comps.length);
allComps[comps.length] = getExtraSettingPane(); allComps[comps.length] = getExtraSettingPane();
return GUICoreUtils.createHeaderLayoutPane(allComps);
JPanel headerPane = GUICoreUtils.createHeaderLayoutPane(allComps);
headerPane.setBorder(BorderFactory.createEmptyBorder(2, 12, 5, 0));
return headerPane;
} }
@Override @Override
protected void extraUpdate(NativePrintAttr nativePrintAttr) { protected void extraUpdate(NativePrintAttr nativePrintAttr) {
if (defaultDownloadUrlCheck.isSelected()) { if (defaultDownloadUrlCheck.isSelected()) {
@ -61,56 +56,35 @@ public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane
printPortField.setValue(nativePrintAttr.getPrintPort()); printPortField.setValue(nativePrintAttr.getPrintPort());
} }
// 服务器配置中,特有的设置面板 /**
* 服务器配置中特有的设置面板
* @return
*/
private JPanel getExtraSettingPane() { private JPanel getExtraSettingPane() {
// 软件下载地址 // 软件下载地址
defaultDownloadUrlCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); defaultDownloadUrlCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"));
JPanel downloadUrlSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(defaultDownloadUrlCheck, getCustomUrlSettingPane(), true); JPanel downloadUrlSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(defaultDownloadUrlCheck, getCustomUrlSettingPane(), true);
downloadUrlSettingCheckPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); JPanel downloadUrlTitle = getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Software_Download_Url"));
JPanel downloadTipPane = getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Software_Download_Url") + ": ");
downloadTipPane.setBorder(BorderFactory.createEmptyBorder(0, 0, -6, 0));
// 打印软件端口号 // 打印软件端口号
UILabel printPortTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Native_Print_Port") + ": "); 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() {
printPortField = new UIIntNumberField(); printPortField = new UIIntNumberField();
printPortField.setMaxValue(NativePrintAttr.MAX_PRINT_PORT_VALUE); printPortField.setMaxValue(NativePrintAttr.MAX_PRINT_PORT_VALUE);
printPortField.setColumns(PRINT_PORT_FIELD_COLUMNS); return column(LayoutConstants.VERTICAL_GAP,
JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); row(cell(downloadUrlTitle).weight(0.25), cell(downloadUrlSettingCheckPane).weight(0.75)),
panel.add(printPortField); row(cell(printPortTip).weight(0.25), cell(printPortField).weight(0.25), flex(0.5))
return panel; ).getComponent();
} }
/**
* 自定义软件下载地址Pane
* @return
*/
private JPanel getCustomUrlSettingPane() { private JPanel getCustomUrlSettingPane() {
customUrlFieldWin = new UITextField(20); customUrlFieldWin = new UITextField(20);
customUrlFieldMac = new UITextField(20); customUrlFieldMac = new UITextField(20);
return column(LayoutConstants.VERTICAL_GAP,
// TableLayout row(cell(new UILabel("windows")).weight(0.2), cell(customUrlFieldWin).weight(0.6), flex(0.2)).weight(1),
double p = TableLayout.PREFERRED; row(cell(new UILabel("macOS")).weight(0.2), cell(customUrlFieldMac).weight(0.6), flex(0.2)).weight(1)
double[] rowSize = {p, p}; ).getComponent();
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;
} }
} }

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

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

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

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

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

Loading…
Cancel
Save