Browse Source

REPORT-127436【NewUI】fix:视觉验收问题修复&REPORT-130699插入数据列可选列为空修复&REPORT-130323设计器tab页列表UI问题修复

newui
Richard.Fang 3 months ago
parent
commit
4cd866d10f
  1. 10
      designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java
  2. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  3. 82
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  4. 44
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  5. 22
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  6. 8
      designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java
  7. 11
      designer-base/src/main/java/com/fr/design/file/TemplateListMenuItem.java
  8. 10
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  9. 6
      designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java
  10. 7
      designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java
  11. 13
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java
  12. 12
      designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java
  13. 6
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  14. 20
      designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java
  15. 18
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  16. 7
      designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java
  17. 9
      designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java
  18. 7
      designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java
  19. 25
      designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java
  20. 11
      designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java
  21. 5
      designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java
  22. 20
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java
  23. 12
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java
  24. 3
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java

10
designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java

@ -33,9 +33,15 @@ public abstract class FineLaf extends FlatLaf {
public void initialize() { public void initialize() {
super.initialize(); super.initialize();
resetWindowDecorations(); resetWindowDecorations();
// flat默认使用系统弹窗,3.3 版本之前无法实现圆角弹窗。 // flat默认使用系统弹窗,3.4版本mac及win11上支持圆角边框和阴影效果
// popup弹窗不使用flat提供的工具,使用swing原生自带的 // popup弹窗不使用flat提供的工具,使用swing原生自带的
PopupFactory.setSharedInstance(new PopupFactory()); if (shouldUseNativePopupFactory()) {
PopupFactory.setSharedInstance(new PopupFactory());
}
}
private static boolean shouldUseNativePopupFactory() {
return !SystemInfo.isMacOS && !SystemInfo.isWindows_11_orLater;
} }
/** /**

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

@ -28,6 +28,7 @@ public interface FineUIStyle {
String BRAND_COLOR_LABEL = "brandColorLabel"; String BRAND_COLOR_LABEL = "brandColorLabel";
String BUTTON_TAB_ACTION = "tabAction"; String BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel"; String LABEL_BOLD = "boldLabel";
String LABEL_SECONDARY = "secondaryLabel";
String LABEL_TIP = "tipLabel"; String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel"; String LABEL_WARNING_TIP = "warningTipLabel";
String LABEL_UILIST = "uiListLabel"; String LABEL_UILIST = "uiListLabel";

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

@ -1,6 +1,7 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
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.constants.LayoutConstants;
@ -13,16 +14,13 @@ 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.general.IOUtils;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
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.Dialog; import java.awt.Dialog;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -32,6 +30,7 @@ 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.column;
import static com.fine.swing.ui.layout.Layouts.flex; 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.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> { public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private UITextField classNameTextField; private UITextField classNameTextField;
@ -39,7 +38,20 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
public ClassTableDataPane() { public ClassTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// 数据集默认参数
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() {
@Override
public UITableEditAction[] createAction() {
return new UITableEditAction[]{
new AddParaAction(),
new RemoveParaAction()
};
}
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para"));
this.add(column(cell(initNorthPanel()), fix(LayoutConstants.VERTICAL_GAP), cell(editorPane).weight(1)).getComponent());
}
private JPanel initNorthPanel() {
//类名 //类名
classNameTextField = new UITextField(); 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"));
@ -51,60 +63,42 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
BasicDialog dlg= bPane.showWindow( BasicDialog dlg= bPane.showWindow(
(Dialog) SwingUtilities.getWindowAncestor(ClassTableDataPane.this), (Dialog) SwingUtilities.getWindowAncestor(ClassTableDataPane.this),
new DialogActionAdapter() { new DialogActionAdapter() {
public void doOk() { public void doOk() {
String classPath = bPane.getClassPath(); String classPath = bPane.getClassPath();
ClassTableData tableData = new ClassTableData(classPath); ClassTableData tableData = new ClassTableData(classPath);
populateBean(tableData); populateBean(tableData);
} }
}); });
dlg.setVisible(true); dlg.setVisible(true);
} }
}); });
JPanel tipPanel = column(LayoutConstants.VERTICAL_GAP, return column(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME))))
).getComponent();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HGAP_LARGE, row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12),
row(LayoutConstants.HGAP_LARGE, row(LayoutConstants.HGAP_LARGE, cell(classNameTextField).weight(0.85), cell(browserButton).weight(0.15)).weight(0.58),
cell(classNameTextField).weight(0.85),
cell(browserButton).weight(0.15)
).weight(0.58),
flex(0.3) flex(0.3)
), ),
row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(tipPanel).weight(0.88)) row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(getTipPanel()).weight(0.88))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0,10, 0))).getComponent()); ).getComponent();
this.add(northPane, BorderLayout.NORTH);
this.add(initSouthPanel(), BorderLayout.CENTER);
} }
private JPanel initSouthPanel() {
JPanel jpanel = new JPanel();
jpanel.setPreferredSize(new Dimension(-1, 150));
jpanel.setLayout(new BorderLayout());
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() { private JPanel getTipPanel() {
@Override return column(
public UITableEditAction[] createAction() { cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") +
return new UITableEditAction[]{ "\"com.fr.data.Tabledata\"", FineUIStyle.LABEL_TIP)),
new AddParaAction(), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description",
new RemoveParaAction() StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME)), FineUIStyle.LABEL_TIP)),
}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") +
} ":\"com.fr.data.impl.ArrayTableData\"", FineUIStyle.LABEL_TIP))
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para")); ).getComponent();
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
} }
public class AddParaAction extends UITableEditAction { public class AddParaAction extends UITableEditAction {
public AddParaAction() { public AddParaAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); this.setSmallIcon(new LazyIcon("add"));
} }
@Override @Override
@ -122,7 +116,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private class RemoveParaAction extends UITableEditAction { private class RemoveParaAction extends UITableEditAction {
public RemoveParaAction() { public RemoveParaAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/remove.png")); this.setSmallIcon(new LazyIcon("remove"));
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

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

@ -2,13 +2,13 @@ package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.EmbeddedTableData;
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.date.UIDatePicker; import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UITableScrollPane; import com.fr.design.gui.icontainer.UITableScrollPane;
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.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -34,6 +34,10 @@ import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
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.column;
import static com.fine.swing.ui.layout.Layouts.flex;
public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableData> { public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableData> {
private static final int MIN_CELL_WIDTH = 30; private static final int MIN_CELL_WIDTH = 30;
@ -44,9 +48,8 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
private UILabel coordinatelabel; private UILabel coordinatelabel;
private UIButton insertRowButton; private UIButton insertRowButton;
private UIButton removeRowButton; private UIButton removeRowButton;
private UIButton columnSetButton;
/** /**
* Constructor * Constructor
* *
*/ */
@ -61,8 +64,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// 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
EmbeddedTableModel tableModel = new EmbeddedTableModel(new EmbeddedTableData()); EmbeddedTableModel tableModel = new EmbeddedTableModel(new EmbeddedTableData());
dataJTable = new JTable(tableModel); dataJTable = new JTable(tableModel);
scrollPane = new UITableScrollPane(dataJTable); scrollPane = new UITableScrollPane(dataJTable);;
this.add(scrollPane, BorderLayout.CENTER);
// 显示double,date类;渲染date类 // 显示double,date类;渲染date类
dataJTable.setDefaultRenderer(Double.class, new DoubleRenderer()); dataJTable.setDefaultRenderer(Double.class, new DoubleRenderer());
@ -80,21 +82,10 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
editbysingleclick(dataJTable, Integer.class); editbysingleclick(dataJTable, Integer.class);
// AUTO RESIZE // AUTO RESIZE
// dataJTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
dataJTable.setAutoResizeMode(tableModel.getColumnCount() * PREVIEW_TABLE_MIN_COLUMN_WIDTH <= PREVIEW_TABLE_WIDTH ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF); dataJTable.setAutoResizeMode(tableModel.getColumnCount() * PREVIEW_TABLE_MIN_COLUMN_WIDTH <= PREVIEW_TABLE_WIDTH ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF);
dataJTable.setRowSelectionAllowed(true); dataJTable.setRowSelectionAllowed(true);
dataJTable.setColumnSelectionAllowed(true); dataJTable.setColumnSelectionAllowed(true);
// peter:控制Panel
JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.add(northPane, BorderLayout.NORTH);
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0");
coordinatelabel.setHorizontalAlignment(UILabel.CENTER);
northPane.add(coordinatelabel);
dataJTable.addMouseListener(new MouseAdapter() { dataJTable.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
// kel:加上一个鼠标点击的监控,鼠标点击时,返回选中的行坐标和列坐标。 // kel:加上一个鼠标点击的监控,鼠标点击时,返回选中的行坐标和列坐标。
@ -114,14 +105,17 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
checkButtonEnabled(); checkButtonEnabled();
} }
}); });
initOtherNorthPaneComponents(northPane); this.add(column(LayoutConstants.VERTICAL_GAP, cell(getNorthPaneComponents()), cell(scrollPane).weight(1)).getComponent());
} }
private void initOtherNorthPaneComponents(JPanel northPane) { private JPanel getNorthPaneComponents() {
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0");
coordinatelabel.setHorizontalAlignment(UILabel.CENTER);
// 表结构设置 // 表结构设置
columnSetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Embedded_Table_Design")); UIButton columnSetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Embedded_Table_Design"));
columnSetButton.setMnemonic('C'); columnSetButton.setMnemonic('C');
northPane.add(columnSetButton);
columnSetButton.addActionListener(new ActionListener() { columnSetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -140,7 +134,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
dataJTable.repaint(); dataJTable.repaint();
} }
}; };
BasicDialog dlg = columnSetPane.showWindow(DesignerContext.getDesignerFrame(), l); BasicDialog dlg = columnSetPane.showWindow(DesignerContext.getDesignerFrame(), l);
dlg.setAlwaysOnTop(true); dlg.setAlwaysOnTop(true);
dlg.setVisible(true); dlg.setVisible(true);
@ -150,7 +143,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// DataSourceEditor-Insert_Row // DataSourceEditor-Insert_Row
insertRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row")); insertRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row"));
insertRowButton.setMnemonic('I'); insertRowButton.setMnemonic('I');
northPane.add(insertRowButton);
insertRowButton.addActionListener(new ActionListener() { insertRowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
insertRow(); insertRow();
@ -160,7 +152,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// DataSourceEditor-Remove_Row // DataSourceEditor-Remove_Row
removeRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row")); removeRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row"));
removeRowButton.setMnemonic('R'); removeRowButton.setMnemonic('R');
northPane.add(removeRowButton);
removeRowButton.addActionListener(new ActionListener() { removeRowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
removeRow(); removeRow();
@ -169,6 +160,13 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// 初始化时更新按钮状态 // 初始化时更新按钮状态
checkButtonEnabled(); checkButtonEnabled();
// peter:控制Panel
return row(LayoutConstants.VGAP_SMALL,
cell(coordinatelabel),
cell(columnSetButton), cell(insertRowButton), cell(removeRowButton),
flex()
).getComponent();
} }
/** /**

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

@ -1,7 +1,7 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter; import com.fr.base.Parameter;
@ -103,7 +103,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIRadioButton localFileRadioButton; private UIRadioButton localFileRadioButton;
private UIRadioButton urlFileRadioButton; private UIRadioButton urlFileRadioButton;
private UITableEditorPane<ParameterProvider> editorPane; private UITableEditorPane<ParameterProvider> editorPane;
private UILabel tips; private JPanel tipPanel;
private UIComboBox xmlKyePoint;// xml关键节点 private UIComboBox xmlKyePoint;// xml关键节点
private UIComboBox encodingComboBox;// xml编码 private UIComboBox encodingComboBox;// xml编码
private FileTableData fileTableData; private FileTableData fileTableData;
@ -200,9 +200,11 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
testConnection.setEnabled(false); testConnection.setEnabled(false);
testConnection.addActionListener(testConnectionListener); testConnection.addActionListener(testConnectionListener);
// 提示信息 // 提示信息
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>" tipPanel = column(
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> "; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)),
tips = new UILabel(tipContent); cell(new UILabel("reportlets/excel/FineReport${abc}." + "txt", FineUIStyle.LABEL_TIP)),
cell(new UILabel("http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp", FineUIStyle.LABEL_TIP))
).getComponent();
return column( return column(
LayoutConstants.VERTICAL_GAP, LayoutConstants.VERTICAL_GAP,
row( row(
@ -217,7 +219,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
cell(urlText).weight(urlWidthRatio), cell(urlText).weight(urlWidthRatio),
cell(testConnection).weight(0.75 - urlWidthRatio) cell(testConnection).weight(0.75 - urlWidthRatio)
), ),
cell(tips) cell(tipPanel)
).getComponent(); ).getComponent();
} }
@ -497,9 +499,11 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} else { } else {
rightPanel.add(getTextSetPanel()); rightPanel.add(getTextSetPanel());
} }
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>" tipPanel = column(
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> "; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)),
tips.setText(tipContent); cell(new UILabel("reportlets/excel/FineReport${abc}." + getFileSuffixToString(), FineUIStyle.LABEL_TIP)),
cell(new UILabel("http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp", FineUIStyle.LABEL_TIP))
).getComponent();
rightPanel.revalidate(); rightPanel.revalidate();
} }
}; };

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

@ -44,14 +44,10 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
chooseComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); chooseComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
//以下设置,部分面板通用 //以下设置,部分面板通用
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"));
buttonPane = row(32, buttonPane = row(32, cell(belowSetLabel), cell(chooseComboBox), flex()).getComponent();
cell(belowSetLabel),
cell(chooseComboBox),
flex()
).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.contentPane = getContentPane(); this.contentPane = getContentPane();
this.add(column(cell(buttonPane), cell(contentPane)).getComponent()); this.add(column(cell(buttonPane), cell(contentPane).weight(1)).getComponent());
} }
/** /**

11
designer-base/src/main/java/com/fr/design/file/TemplateListMenuItem.java

@ -4,6 +4,7 @@ import com.fine.swing.ui.layout.Row;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.TemplateUtils;
@ -26,6 +27,7 @@ import static com.fine.swing.ui.layout.Layouts.cell;
*/ */
public class TemplateListMenuItem extends Row { public class TemplateListMenuItem extends Row {
private static final String UI_CLASS_ID = "TemplateListMenuItemUI"; private static final String UI_CLASS_ID = "TemplateListMenuItemUI";
private static final String UNSAVED_SUFFIX = " *";
private static final int WIDTH = 200; private static final int WIDTH = 200;
@ -55,10 +57,17 @@ public class TemplateListMenuItem extends Row {
* item[1] 切换模板按钮初始化 * item[1] 切换模板按钮初始化
*/ */
private UIButton createTemplateButton(JTemplate<?, ?> template) { private UIButton createTemplateButton(JTemplate<?, ?> template) {
String templateName = template.getTemplateName();
if (!template.isSaved() && !templateName.endsWith(UNSAVED_SUFFIX)) {
templateName += UNSAVED_SUFFIX;
}
UIButton button = new UIButton( UIButton button = new UIButton(
TemplateUtils.createLockeTemplatedName(template, template.getTemplateName()), template.getIcon()); TemplateUtils.createLockeTemplatedName(template, templateName), template.getIcon());
button.setContentAreaFilled(false); button.setContentAreaFilled(false);
button.setHorizontalAlignment(SwingConstants.LEFT); button.setHorizontalAlignment(SwingConstants.LEFT);
if (template == HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()) {
button.setForeground(UIConstants.FLESH_BLUE);
}
return button; return button;
} }

10
designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java

@ -9,6 +9,7 @@ import com.fr.design.utils.ColorUtils;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -164,11 +165,20 @@ public class FineTabbedPane extends Box {
private void initListeners() { private void initListeners() {
tabGroup.addChangeListener((e) -> { tabGroup.addChangeListener((e) -> {
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
// tab切换时触发事件
fireStateChanged();
}); });
tabGroup.setSelectedIndex(0); tabGroup.setSelectedIndex(0);
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
} }
private void fireStateChanged() {
ChangeEvent evt = new ChangeEvent(this);
for (ChangeListener listener : listenerList.getListeners(ChangeListener.class)) {
listener.stateChanged(evt);
}
}
/** /**
* 添加事件监听 * 添加事件监听
* *

6
designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java

@ -1,5 +1,6 @@
package com.fr.design.gui.ilable; package com.fr.design.gui.ilable;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.core.UITextComponent; import com.fr.design.gui.core.UITextComponent;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -37,6 +38,11 @@ public class UILabel extends JLabel implements UITextComponent {
super(text); super(text);
} }
public UILabel(String text, String style) {
super(text);
FineUIStyle.setStyle(this, style);
}
public UILabel(String text, boolean enable) { public UILabel(String text, boolean enable) {
super(text); super(text);
this.setEnabled(enable); this.setEnabled(enable);

7
designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java

@ -184,7 +184,7 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
Insets insets = parent.getInsets(); Insets insets = parent.getInsets();
int width = parent.getPreferredSize().width - insets.left - insets.right; int width = parent.getWidth() - insets.left - insets.right;
int height = parent.getHeight() - insets.top - insets.bottom; int height = parent.getHeight() - insets.top - insets.bottom;
int x = insets.left; int x = insets.left;
@ -195,13 +195,13 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
if ((comp instanceof UIScrollBar) && comp.isVisible()) { if ((comp instanceof UIScrollBar) && comp.isVisible()) {
UIScrollBar scrollBar = (UIScrollBar) comp; UIScrollBar scrollBar = (UIScrollBar) comp;
Dimension dim = scrollBar.getPreferredSize(); Dimension dim = scrollBar.getPreferredSize();
scrollBar.setBounds(x + width - 1, y, dim.width, height); scrollBar.setBounds(x + width - dim.width, y, dim.width, height);
width -= dim.width; width -= dim.width;
position = scrollBar.getValue(); position = scrollBar.getValue();
} }
} }
y -= position; y = insets.top - position;
for (Component comp : parent.getComponents()) { for (Component comp : parent.getComponents()) {
if (!(comp instanceof UIScrollBar) && comp.isVisible()) { if (!(comp instanceof UIScrollBar) && comp.isVisible()) {
Dimension pref = comp.getPreferredSize(); Dimension pref = comp.getPreferredSize();
@ -209,7 +209,6 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
y += pref.height; y += pref.height;
} }
} }
} }
} }
} }

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

@ -15,7 +15,6 @@ 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.style.color.NewColorSelectPane; import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -80,16 +79,15 @@ public class WatermarkPane extends BasicPane {
private void initComponents() { private void initComponents() {
message = new UILabel(); message = new UILabel();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
//左侧预览面板 //左侧预览面板
JPanel previewPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel previewPaneWrapper = new JPanel(new BorderLayout());
//预览外边框,宽度跟随全局权重 //预览外边框,宽度跟随全局权重
previewPaneWrapper.setBorder(new FineRoundBorder()); previewPaneWrapper.setBorder(new FineRoundBorder());
previewPaneWrapper.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); previewPaneWrapper.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
watermarkPreviewPane = new WatermarkPreviewPane(); watermarkPreviewPane = new WatermarkPreviewPane();
watermarkPreviewPane.setOpaque(false); watermarkPreviewPane.setOpaque(false);
previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER); previewPaneWrapper.add(watermarkPreviewPane);
leftPane = column( leftPane = column(
LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))),
@ -102,10 +100,9 @@ public class WatermarkPane extends BasicPane {
row(LayoutConstants.HORIZONTAL_GAP, row(LayoutConstants.HORIZONTAL_GAP,
cell(leftPane).weight(0.55), cell(leftPane).weight(0.55),
cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45) cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45)
) ).weight(1)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10))
).getComponent(); ).getComponent();
this.add(centerPanel, BorderLayout.CENTER); this.add(centerPanel);
} }
public void populate(WatermarkAttr watermark) { public void populate(WatermarkAttr watermark) {

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

@ -45,7 +45,7 @@ public class FormFitConfigPane extends ReportFitConfigPane {
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(column(10, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent()); jPanel.add(column(LayoutConstants.VERTICAL_GAP, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent());
} }
return jPanel; return jPanel;
} }
@ -139,13 +139,9 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} }
private JPanel createTipPane() { private JPanel createTipPane() {
JPanel jPanel = new JPanel(new BorderLayout()); return column(cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"), FineUIStyle.LABEL_TIP)),
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1")); cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"), FineUIStyle.LABEL_TIP))
FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP); ).getComponent();
UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"));
FineUIStyle.setStyle(label2, FineUIStyle.LABEL_TIP);
jPanel.add(column(LayoutConstants.HORIZONTAL_GAP, cell(label1), cell(label2)).getComponent());
return jPanel;
} }
protected void refreshPreviewJPanel() { protected void refreshPreviewJPanel() {

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

@ -52,7 +52,7 @@ Component.defaultVGap=10
@BrandHoverColor = #5493F2 @BrandHoverColor = #5493F2
@BrandPressedColor = #105DD1 @BrandPressedColor = #105DD1
@BrandHoverColorSP = #2576EF 12% @BrandHoverColorSP = #2576EF 12%
@BrandTipColor = #0a1c3877 @BrandTipColor = #0A1C3877
@marginSmall = 4 @marginSmall = 4
@marginLarge = 10 @marginLarge = 10
@ -404,6 +404,7 @@ Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000 Label.strongHintColor = #FF0000
Label.warningColor = #F1393C Label.warningColor = #F1393C
Label.secondaryColor = #0A1C38A8
#---- HelpButton ---- #---- HelpButton ----
@ -1338,6 +1339,9 @@ chart.selectedBorderColor = #2576EF
[style]Label.warningTipLabel = \ [style]Label.warningTipLabel = \
foreground: $Label.warningColor foreground: $Label.warningColor
[style]Label.secondaryLabel = \
foreground: $Label.secondaryColor
[style]Label.uiListLabel = \ [style]Label.uiListLabel = \
foreground: $List.wrapper.text.fontColor; \ foreground: $List.wrapper.text.fontColor; \
background: $background.normal background: $background.normal

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

@ -53,28 +53,28 @@ public class ImageExportPane extends AbstractExportPane {
public ImageExportPane() { public ImageExportPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"));
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
initGlobalSettings(); initGlobalSettings();
Component centerPane = column(LayoutConstants.VERTICAL_GAP, Component centerPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":")).weight(0.4), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.globalResolutionBtnS).weight(0.4), cell(this.globalResolutionBtnS).weight(0.4),
cell(this.globalResolutionBtnM).weight(0.4), cell(this.globalResolutionBtnM).weight(0.4),
cell(this.globalResolutionBtnL).weight(0.4), cell(this.globalResolutionBtnL).weight(0.4),
flex()), flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":")).weight(0.4), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Format"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.globalFormatJpg).weight(0.8), cell(this.globalFormatJpg).weight(0.8),
cell(this.globalFormatPng).weight(0.4), cell(this.globalFormatPng).weight(0.4),
flex()), flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":")).weight(0.4), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.globalRenderQuality).weight(0.8), cell(this.globalRenderQuality).weight(0.8),
cell(this.globalRenderSpeed).weight(0.4), cell(this.globalRenderSpeed).weight(0.4),
flex()), flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":")).weight(0.4), column(LayoutConstants.VGAP_SMALL,
cell(this.templateThumbnail).weight(0.8), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.templatePaging).weight(0.4), cell(this.templateThumbnail).weight(0.8),
flex()), cell(this.templatePaging).weight(0.4),
cell(tipLabel) flex()),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"), FineUIStyle.LABEL_TIP))
)
).getComponent(); ).getComponent();
this.add(wrapComponentWithTitle( this.add(wrapComponentWithTitle(

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

@ -262,16 +262,16 @@ public class PageSetupPane extends BasicPane {
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate"))), cell(marginTopUnitFieldPane)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"))), cell(marginBottomUnitFieldPane))
).getComponent(); ).getComponent();
// peter:这个一个垂直的上下的字符panel. // peter:这个一个垂直的上下的字符panel.
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")), cell(marginLeftUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, 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)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right"))), cell(marginRightUnitFieldPane))
).getComponent(); ).getComponent();
marginTopUnitFieldPane.getTextField().addFocusListener(fa); marginTopUnitFieldPane.getTextField().addFocusListener(fa);
@ -281,18 +281,18 @@ public class PageSetupPane extends BasicPane {
JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane), cell(zeroMarginWarn)).getComponent(); JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane), cell(zeroMarginWarn)).getComponent();
//方向-页边距 //方向-页边距
JPanel twoPane = row(10, JPanel twoPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(wrapComponentWithTitle(orientationPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25), cell(wrapComponentWithTitle(orientationPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25),
cell(wrapComponentWithTitle(marginPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8) cell(wrapComponentWithTitle(marginPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8)
).getComponent(); ).getComponent();
//高度 //高度
headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel hfHeightPane = row( JPanel hfHeightPane = row(
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header"))), cell(headerUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header"))), cell(headerUnitFieldPane)),
fix(24), fix(24),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer"))), cell(footerUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer"))), cell(footerUnitFieldPane))
).getComponent(); ).getComponent();
Component heightPane = wrapComponentWithTitle(hfHeightPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height")); Component heightPane = wrapComponentWithTitle(hfHeightPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height"));

7
designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java

@ -21,6 +21,10 @@ import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import java.awt.Dimension; import java.awt.Dimension;
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;
/** /**
* UnitFieldPane * UnitFieldPane
*/ */
@ -72,9 +76,8 @@ public class UnitFieldPane extends JPanel {
textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField(); textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField();
textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS); textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS);
InputEventBaseOnOS.addBasicEditInputMap(textField); InputEventBaseOnOS.addBasicEditInputMap(textField);
this.add(valueSpinner);
unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height); unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height);
this.add(unitLable); this.add(row(cell(valueSpinner), fix(4), cell(unitLable)).getComponent());
} }
public JFormattedTextField getTextField() { public JFormattedTextField getTextField() {

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

@ -36,12 +36,9 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(row(LayoutConstants.HORIZONTAL_GAP, this.add(row(20,
cell(new UILabel(title)), cell(new UILabel(title)),
cell(horizonRadio), row(LayoutConstants.HORIZONTAL_GAP, cell(horizonRadio), cell(verticalRadio), cell(bidirectionalRadio), cell(notFitRadio))
cell(verticalRadio),
cell(bidirectionalRadio),
cell(notFitRadio)
).getComponent()); ).getComponent());
} }

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

@ -1,6 +1,5 @@
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.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -37,14 +36,14 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
appFitBrowserPane = new AppFitBrowserPane(); appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
//移动端属性整体面板 //移动端属性整体面板,不同分组间距20px
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP, panel.add(column(LayoutConstants.VGAP_HUGER,
cell(reportMobileTemplateSettingsPane), cell(reportMobileTemplateSettingsPane),
cell(appFitBrowserPane), cell(appFitBrowserPane),
cell(mobileOthersPane = new MobileOthersPane()), cell(mobileOthersPane = new MobileOthersPane()),
cell(appFitPreviewPane) cell(appFitPreviewPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); ).getComponent());
UIScrollPane scrollPane = new UIScrollPane(panel); UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane); this.add(scrollPane);
} }

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

@ -6,7 +6,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants; 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.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
@ -40,29 +39,17 @@ public class ReportMobileTemplateSettingsPane extends BasicBeanPane<ElementCaseM
private JPanel getMobileCanvasSizeCheckPane() { private JPanel getMobileCanvasSizeCheckPane() {
JPanel panel = new JPanel(new BorderLayout()); 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(column(LayoutConstants.VERTICAL_GAP, panel.add(column(LayoutConstants.VGAP_SMALL,
cell(mobileCanvasSizeCheck), cell(mobileCanvasSizeCheck),
cell(getCanvasDescPane()) column(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc"), FineUIStyle.LABEL_TIP)),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_In_Desc"), FineUIStyle.LABEL_TIP)),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc"), FineUIStyle.LABEL_TIP))
).with(it -> it.setBorder(new ScaledEmptyBorder(0,20,0,0)))
).getComponent()); ).getComponent());
return panel; return panel;
} }
private JPanel getCanvasDescPane() {
UILabel desc1 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc"));
UILabel desc2 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_In_Desc"));
UILabel desc3 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc"));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP, cell(desc1), cell(desc2), cell(desc3)).getComponent());
panel.setBorder(new ScaledEmptyBorder(0,20,0,0));
return panel;
}
private UILabel createDescLabel(String desc) {
UILabel label = new UILabel(desc);
FineUIStyle.setStyle(label, FineUIStyle.LABEL_TIP);
return label;
}
@Override @Override
public void populateBean(ElementCaseMobileAttr ob) { public void populateBean(ElementCaseMobileAttr ob) {
if (ob == null) { if (ob == null) {

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

@ -9,7 +9,7 @@ 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.JPanel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -17,6 +17,7 @@ import java.util.List;
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.flex; 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.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class ViewWebSettingPane extends WebSettingPane<WebView> { public class ViewWebSettingPane extends WebSettingPane<WebView> {
private UICheckBox sortCheckBox; private UICheckBox sortCheckBox;
@ -39,11 +40,9 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
sortCheckBox.setSelected(true); sortCheckBox.setSelected(true);
conditionFilterBox.setSelected(true); conditionFilterBox.setSelected(true);
listFilterBox.setSelected(true); listFilterBox.setSelected(true);
return row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15), return row(
cell(sortCheckBox).weight(0.15), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15),
cell(conditionFilterBox).weight(0.15), row(cell(sortCheckBox), fix(12), cell(conditionFilterBox), fix(12), cell(listFilterBox), flex()).weight(0.85)
cell(listFilterBox).weight(0.15),
flex(0.4)
).getComponent(); ).getComponent();
} }

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

@ -15,7 +15,8 @@ import com.fr.report.web.WebWrite;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.ButtonGroup;
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;
@ -84,7 +85,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
colorButton.setEnabled(colorBox.isSelected()); colorButton.setEnabled(colorBox.isSelected());
} }
}); });
JPanel backgroundPane = row(cell(colorBox), cell(colorButton)).getComponent(); JPanel backgroundPane = row(LayoutConstants.HGAP_LARGE, 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"));

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

@ -181,10 +181,6 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
printerComboBox = new UIComboBox(getAllPrinterNames()); printerComboBox = new UIComboBox(getAllPrinterNames());
// 份数 // 份数
copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
// 页码标签
JPanel printAreaLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
printAreaLabelPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number")), BorderLayout.NORTH);
printAreaLabelPane.setBorder(new ScaledEmptyBorder(2,0,0,0));
// 继承页面纸张设置 // 继承页面纸张设置
inheritPagePaperSettingCheck = new UICheckBox(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();
@ -209,10 +205,12 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1), row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1),
cell(copySpinner).weight(0.15), cell(copySpinner).weight(0.15),
flex(0.75)), flex(0.75)),
row(cell(printAreaLabelPane).weight(0.1), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number")))
.weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))),
cell(getPrintAreaPane()).weight(0.7), cell(getPrintAreaPane()).weight(0.7),
flex(0.2)), flex(0.2)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper"))).weight(0.1), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper")))
.weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))),
cell(paperSettingCheckPane).weight(0.5), cell(paperSettingCheckPane).weight(0.5),
flex(0.4)), flex(0.4)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1),
@ -283,13 +281,13 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
// 高度设置 // 高度设置
customHeightFieldPane = new UnitFieldPane(Constants.UNIT_MM); customHeightFieldPane = new UnitFieldPane(Constants.UNIT_MM);
customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight()); customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight());
customPaperSizePane = row(LayoutConstants.HORIZONTAL_GAP, customPaperSizePane = row(24,
row( row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width"))),
cell(customWidthFieldPane) cell(customWidthFieldPane)
), ),
row( row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height"))),
cell(customHeightFieldPane) cell(customHeightFieldPane)
) )
).getComponent(); ).getComponent();

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

@ -31,21 +31,19 @@ public class PageMarginSettingPane extends JPanel {
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate"))), cell(marginTopUnitFieldPane)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"))), cell(marginBottomUnitFieldPane))
).getComponent(); ).getComponent();
// peter:这个一个垂直的上下的字符panel. // peter:这个一个垂直的上下的字符panel.
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")), cell(marginLeftUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, 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)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right"))), cell(marginRightUnitFieldPane))
).getComponent(); ).getComponent();
JPanel marginPane = row(LayoutConstants.HORIZONTAL_GAP, JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane)).getComponent();
cell(marginLeftPane),
cell(marginRightPane)).getComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(marginPane, BorderLayout.CENTER); this.add(marginPane, BorderLayout.CENTER);
} }

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

@ -59,7 +59,8 @@ public class PrintSettingPane extends BasicPane {
scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400))); scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400)));
printPane.add(nativePrintRadioButton.getText(), scrollPane); printPane.add(nativePrintRadioButton.getText(), scrollPane);
JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane)).getComponent(); JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane))
.with(it -> it.setBorder(new ScaledEmptyBorder(10 , 0, 0, 0))).getComponent();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(allPanel, BorderLayout.CENTER); this.add(allPanel, BorderLayout.CENTER);
} }

Loading…
Cancel
Save