From 5b09594f343baa1df02c12dccba07c64f6f0ece1 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Thu, 15 Aug 2024 16:49:33 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-127436=E3=80=90NewUI=E3=80=91fix:?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E9=AA=8C=E6=94=B6=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D&REPORT-130699=E6=8F=92=E5=85=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=97=E5=8F=AF=E9=80=89=E5=88=97=E4=B8=BA=E7=A9=BA=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D&REPORT-130323=E8=AE=BE=E8=AE=A1=E5=99=A8tab=E9=A1=B5?= =?UTF-8?q?=E5=88=97=E8=A1=A8UI=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fine/theme/light/ui/laf/FineLaf.java | 2 +- .../com/fine/theme/utils/FineUIStyle.java | 1 + .../tabledatapane/ClassTableDataPane.java | 78 ++++++++----------- .../tabledatapane/EmbeddedTableDataPane.java | 44 +++++------ .../tabledatapane/FileTableDataPane.java | 22 +++--- .../AbstractTemplateServerSettingPane.java | 8 +- .../fr/design/file/TemplateListMenuItem.java | 11 ++- .../fr/design/gui/frpane/FineTabbedPane.java | 10 +++ .../com/fr/design/gui/ilable/UILabel.java | 6 ++ .../design/gui/imenu/UIScrollPopUpMenu.java | 7 +- .../com/fr/design/report/WatermarkPane.java | 13 ++-- .../design/report/fit/FormFitConfigPane.java | 12 +-- .../light/ui/laf/FineLightLaf.properties | 6 +- .../com/fr/design/report/ImageExportPane.java | 20 ++--- .../com/fr/design/report/PageSetupPane.java | 18 ++--- .../com/fr/design/report/UnitFieldPane.java | 7 +- .../report/mobile/MobileRadioGroupPane.java | 9 +-- .../report/mobile/ReportMobileAttrPane.java | 7 +- .../ReportMobileTemplateSettingsPane.java | 25 ++---- .../fr/design/webattr/ViewWebSettingPane.java | 11 ++- .../design/webattr/WriteWebSettingPane.java | 5 +- .../AbstractNativePrintSettingPane.java | 20 +++-- .../printsettings/PageMarginSettingPane.java | 12 ++- .../printsettings/PrintSettingPane.java | 3 +- 24 files changed, 175 insertions(+), 182 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java b/designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java index fa29de7466..60cc5ad605 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java @@ -35,7 +35,7 @@ public abstract class FineLaf extends FlatLaf { resetWindowDecorations(); // flat默认使用系统弹窗,3.3 版本之前无法实现圆角弹窗。 // popup弹窗不使用flat提供的工具,使用swing原生自带的 - PopupFactory.setSharedInstance(new PopupFactory()); + //PopupFactory.setSharedInstance(new PopupFactory()); } /** diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java b/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java index 3f010a6607..4d957a72cc 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java @@ -28,6 +28,7 @@ public interface FineUIStyle { String BRAND_COLOR_LABEL = "brandColorLabel"; String BUTTON_TAB_ACTION = "tabAction"; String LABEL_BOLD = "boldLabel"; + String LABEL_SECONDARY = "secondaryLabel"; String LABEL_TIP = "tipLabel"; String LABEL_WARNING_TIP = "warningTipLabel"; String LABEL_UILIST = "uiListLabel"; diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java index 96204b1745..9632e6f6a0 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java @@ -1,6 +1,7 @@ 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.data.impl.ClassTableData; 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.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.IOUtils; import com.fr.script.Calculator; import com.fr.stable.ParameterProvider; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import java.awt.BorderLayout; import java.awt.Dialog; import java.awt.Dimension; 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.flex; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.fix; public class ClassTableDataPane extends AbstractTableDataPane { private UITextField classNameTextField; @@ -39,7 +38,20 @@ public class ClassTableDataPane extends AbstractTableDataPane { public ClassTableDataPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + // 数据集默认参数 + editorPane = new UITableEditorPane(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(); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); @@ -51,60 +63,38 @@ public class ClassTableDataPane extends AbstractTableDataPane { BasicDialog dlg= bPane.showWindow( (Dialog) SwingUtilities.getWindowAncestor(ClassTableDataPane.this), new DialogActionAdapter() { - public void doOk() { - String classPath = bPane.getClassPath(); - ClassTableData tableData = new ClassTableData(classPath); - populateBean(tableData); - } - }); + public void doOk() { + String classPath = bPane.getClassPath(); + ClassTableData tableData = new ClassTableData(classPath); + populateBean(tableData); + } + }); dlg.setVisible(true); } }); - JPanel tipPanel = column(LayoutConstants.VERTICAL_GAP, - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")), - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")), - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME)))) + JPanel tipPanel = column( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + + "\"com.fr.data.Tabledata\"", FineUIStyle.LABEL_TIP)), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", + 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)) ).getComponent(); - - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - northPane.add(column(LayoutConstants.VERTICAL_GAP, + return 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), + row(LayoutConstants.HGAP_LARGE, cell(classNameTextField).weight(0.85), cell(browserButton).weight(0.15)).weight(0.58), flex(0.3) ), row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(tipPanel).weight(0.88)) - ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0,10, 0))).getComponent()); - this.add(northPane, BorderLayout.NORTH); - this.add(initSouthPanel(), BorderLayout.CENTER); - } - private JPanel initSouthPanel() { - JPanel jpanel = new JPanel(); - jpanel.setPreferredSize(new Dimension(-1, 150)); - jpanel.setLayout(new BorderLayout()); - - editorPane = new UITableEditorPane(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")); - - jpanel.add(editorPane, BorderLayout.CENTER); - return jpanel; + ).getComponent(); } public class AddParaAction extends UITableEditAction { public AddParaAction() { 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 @@ -122,7 +112,7 @@ public class ClassTableDataPane extends AbstractTableDataPane { private class RemoveParaAction extends UITableEditAction { public RemoveParaAction() { 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) { diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index 7b95cc5c16..8ab58d8603 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/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.fr.data.impl.EmbeddedTableData; +import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.date.UIDatePicker; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UITableScrollPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.general.DateUtils; import com.fr.log.FineLoggerFactory; @@ -34,6 +34,10 @@ import java.awt.event.MouseEvent; import java.text.SimpleDateFormat; 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 { private static final int MIN_CELL_WIDTH = 30; @@ -44,9 +48,8 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane { private UIRadioButton localFileRadioButton; private UIRadioButton urlFileRadioButton; private UITableEditorPane editorPane; - private UILabel tips; + private JPanel tipPanel; private UIComboBox xmlKyePoint;// xml关键节点 private UIComboBox encodingComboBox;// xml编码 private FileTableData fileTableData; @@ -200,9 +200,11 @@ public class FileTableDataPane extends AbstractTableDataPane { testConnection.setEnabled(false); testConnection.addActionListener(testConnectionListener); // 提示信息 - String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "
" - + "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp
" + "  "; - tips = new UILabel(tipContent); + tipPanel = column( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)), + 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( LayoutConstants.VERTICAL_GAP, row( @@ -217,7 +219,7 @@ public class FileTableDataPane extends AbstractTableDataPane { cell(urlText).weight(urlWidthRatio), cell(testConnection).weight(0.75 - urlWidthRatio) ), - cell(tips) + cell(tipPanel) ).getComponent(); } @@ -497,9 +499,11 @@ public class FileTableDataPane extends AbstractTableDataPane { } else { rightPanel.add(getTextSetPanel()); } - String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "
" - + "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp
" + "  "; - tips.setText(tipContent); + tipPanel = column( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)), + 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(); } }; diff --git a/designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java b/designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java index 15a758e64e..bb4ce2ebdf 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java +++ b/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); //以下设置,部分面板通用 UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set")); - buttonPane = row(32, - cell(belowSetLabel), - cell(chooseComboBox), - flex() - ).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent(); + buttonPane = row(32, cell(belowSetLabel), cell(chooseComboBox), flex()).getComponent(); this.setLayout(new BorderLayout()); this.contentPane = getContentPane(); - this.add(column(cell(buttonPane), cell(contentPane)).getComponent()); + this.add(column(cell(buttonPane), cell(contentPane).weight(1)).getComponent()); } /** diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateListMenuItem.java b/designer-base/src/main/java/com/fr/design/file/TemplateListMenuItem.java index b2f24d7487..907bc96ba8 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateListMenuItem.java +++ b/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.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.TemplateUtils; @@ -26,6 +27,7 @@ import static com.fine.swing.ui.layout.Layouts.cell; */ public class TemplateListMenuItem extends Row { private static final String UI_CLASS_ID = "TemplateListMenuItemUI"; + private static final String UNSAVED_SUFFIX = " *"; private static final int WIDTH = 200; @@ -55,10 +57,17 @@ public class TemplateListMenuItem extends Row { * item[1] 切换模板按钮初始化 */ private UIButton createTemplateButton(JTemplate template) { + String templateName = template.getTemplateName(); + if (!template.isSaved() && !templateName.endsWith(UNSAVED_SUFFIX)) { + templateName += UNSAVED_SUFFIX; + } UIButton button = new UIButton( - TemplateUtils.createLockeTemplatedName(template, template.getTemplateName()), template.getIcon()); + TemplateUtils.createLockeTemplatedName(template, templateName), template.getIcon()); button.setContentAreaFilled(false); button.setHorizontalAlignment(SwingConstants.LEFT); + if (template == HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()) { + button.setForeground(UIConstants.FLESH_BLUE); + } return button; } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java index dd1e24be12..5ed4b5bcf3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java +++ b/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.JPanel; +import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -164,11 +165,20 @@ public class FineTabbedPane extends Box { private void initListeners() { tabGroup.addChangeListener((e) -> { cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); + // tab切换时触发事件 + fireStateChanged(); }); tabGroup.setSelectedIndex(0); 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); + } + } + /** * 添加事件监听 * diff --git a/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java b/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java index d6a7952757..c49f040d2f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ilable; +import com.fine.theme.utils.FineUIStyle; import com.fr.design.gui.core.UITextComponent; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -37,6 +38,11 @@ public class UILabel extends JLabel implements UITextComponent { super(text); } + public UILabel(String text, String style) { + super(text); + FineUIStyle.setStyle(this, style); + } + public UILabel(String text, boolean enable) { super(text); this.setEnabled(enable); diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java index d4f1815e99..80c379a7c5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java +++ b/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) { 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 x = insets.left; @@ -195,13 +195,13 @@ public class UIScrollPopUpMenu extends UIPopupMenu { if ((comp instanceof UIScrollBar) && comp.isVisible()) { UIScrollBar scrollBar = (UIScrollBar) comp; 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; position = scrollBar.getValue(); } } - y -= position; + y = insets.top - position; for (Component comp : parent.getComponents()) { if (!(comp instanceof UIScrollBar) && comp.isVisible()) { Dimension pref = comp.getPreferredSize(); @@ -209,7 +209,6 @@ public class UIScrollPopUpMenu extends UIPopupMenu { y += pref.height; } } - } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java index 1a16042124..9e77340884 100644 --- a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java +++ b/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.style.FRFontPane; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.color.NewColorSelectPane; import javax.swing.SwingUtilities; @@ -80,16 +79,15 @@ public class WatermarkPane extends BasicPane { private void initComponents() { 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.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); watermarkPreviewPane = new WatermarkPreviewPane(); watermarkPreviewPane.setOpaque(false); - previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER); + previewPaneWrapper.add(watermarkPreviewPane); leftPane = column( LayoutConstants.VGAP_SMALL, 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, 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(0, 10, 0, 10)) + ).weight(1) ).getComponent(); - this.add(centerPanel, BorderLayout.CENTER); + this.add(centerPanel); } public void populate(WatermarkAttr watermark) { diff --git a/designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java b/designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java index 7ed82cd09a..8bf088b6fd 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java +++ b/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) { Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1]; 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; } @@ -139,13 +139,9 @@ public class FormFitConfigPane extends ReportFitConfigPane { } private JPanel createTipPane() { - JPanel jPanel = new JPanel(new BorderLayout()); - UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1")); - FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP); - 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; + return column(cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"), FineUIStyle.LABEL_TIP)), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"), FineUIStyle.LABEL_TIP)) + ).getComponent(); } protected void refreshPreviewJPanel() { diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index 555f3f8200..e86a1bc900 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties @@ -52,7 +52,7 @@ Component.defaultVGap=10 @BrandHoverColor = #5493F2 @BrandPressedColor = #105DD1 @BrandHoverColorSP = #2576EF 12% -@BrandTipColor = #0a1c3877 +@BrandTipColor = #0A1C3877 @marginSmall = 4 @marginLarge = 10 @@ -404,6 +404,7 @@ Label.borderColor = $defaultBorderColor Label.hyperLinkColor = #2576EF Label.strongHintColor = #FF0000 Label.warningColor = #F1393C +Label.secondaryColor = #0A1C38A8 #---- HelpButton ---- @@ -1338,6 +1339,9 @@ chart.selectedBorderColor = #2576EF [style]Label.warningTipLabel = \ foreground: $Label.warningColor +[style]Label.secondaryLabel = \ + foreground: $Label.secondaryColor + [style]Label.uiListLabel = \ foreground: $List.wrapper.text.fontColor; \ background: $background.normal diff --git a/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java b/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java index 0e1e8fe76a..da1a0c0f70 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java @@ -53,28 +53,28 @@ public class ImageExportPane extends AbstractExportPane { public ImageExportPane() { this.setLayout(new BorderLayout()); - UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips")); - FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP); initGlobalSettings(); 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.globalResolutionBtnM).weight(0.4), cell(this.globalResolutionBtnL).weight(0.4), 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.globalFormatPng).weight(0.4), 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.globalRenderSpeed).weight(0.4), flex()), - row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":")).weight(0.4), - cell(this.templateThumbnail).weight(0.8), - cell(this.templatePaging).weight(0.4), - flex()), - cell(tipLabel) + column(LayoutConstants.VGAP_SMALL, + row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting"), FineUIStyle.LABEL_SECONDARY)).weight(0.4), + cell(this.templateThumbnail).weight(0.8), + cell(this.templatePaging).weight(0.4), + flex()), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"), FineUIStyle.LABEL_TIP)) + ) ).getComponent(); this.add(wrapComponentWithTitle( diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index 13acc023d2..a4eeec5989 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/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); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP, - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)), - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane)) + row(LayoutConstants.HGAP_LARGE, 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_Bottom"))), cell(marginBottomUnitFieldPane)) ).getComponent(); // peter:这个一个垂直的上下的字符panel. marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); 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)) + row(LayoutConstants.HGAP_LARGE, 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_Form_Right"))), cell(marginRightUnitFieldPane)) ).getComponent(); 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 twoPane = row(10, - cell(wrapComponentWithTitle(orientationPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25), - cell(wrapComponentWithTitle(marginPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8) + 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(marginPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8) ).getComponent(); //高度 headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); 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), - 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(); Component heightPane = wrapComponentWithTitle(hfHeightPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height")); diff --git a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java index 6af6852d47..9aa8a2159b 100644 --- a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java @@ -21,6 +21,10 @@ import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; 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 */ @@ -72,9 +76,8 @@ public class UnitFieldPane extends JPanel { textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField(); textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS); InputEventBaseOnOS.addBasicEditInputMap(textField); - this.add(valueSpinner); unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height); - this.add(unitLable); + this.add(row(cell(valueSpinner), fix(4), cell(unitLable)).getComponent()); } public JFormattedTextField getTextField() { diff --git a/designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java b/designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java index b110b85eed..227eaccdd3 100644 --- a/designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java @@ -36,12 +36,9 @@ public class MobileRadioGroupPane extends BasicBeanPane{ addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); this.setLayout(new BorderLayout()); - this.add(row(LayoutConstants.HORIZONTAL_GAP, - cell(new UILabel(title)), - cell(horizonRadio), - cell(verticalRadio), - cell(bidirectionalRadio), - cell(notFitRadio) + this.add(row(20, + cell(new UILabel(title)), + row(LayoutConstants.HORIZONTAL_GAP, cell(horizonRadio), cell(verticalRadio), cell(bidirectionalRadio), cell(notFitRadio)) ).getComponent()); } diff --git a/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java index 8d58b63cb5..60bbe00844 100644 --- a/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -1,6 +1,5 @@ package com.fr.design.report.mobile; -import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.icontainer.UIScrollPane; @@ -37,14 +36,14 @@ public class ReportMobileAttrPane extends BasicBeanPane{ appFitBrowserPane = new AppFitBrowserPane(); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); - //移动端属性整体面板 + //移动端属性整体面板,不同分组间距20px JPanel panel = new JPanel(new BorderLayout()); - panel.add(column(LayoutConstants.VERTICAL_GAP, + panel.add(column(LayoutConstants.VGAP_HUGER, cell(reportMobileTemplateSettingsPane), cell(appFitBrowserPane), cell(mobileOthersPane = new MobileOthersPane()), cell(appFitPreviewPane) - ).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); + ).getComponent()); UIScrollPane scrollPane = new UIScrollPane(panel); this.add(scrollPane); } diff --git a/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java b/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java index 71b61faeed..78872c9169 100644 --- a/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java +++ b/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.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.report.mobile.ElementCaseMobileAttr; @@ -40,29 +39,17 @@ public class ReportMobileTemplateSettingsPane extends BasicBeanPane it.setBorder(new ScaledEmptyBorder(0,20,0,0))) ).getComponent()); return panel; } - private JPanel getCanvasDescPane() { - UILabel desc1 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc")); - UILabel desc2 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_In_Desc")); - UILabel desc3 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc")); - 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 public void populateBean(ElementCaseMobileAttr ob) { if (ob == null) { diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java index 8cc054a80c..d623e3575a 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java +++ b/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.web.attr.ReportWebAttr; -import javax.swing.*; +import javax.swing.JPanel; import java.util.ArrayList; import java.util.Arrays; 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.flex; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.fix; public class ViewWebSettingPane extends WebSettingPane { private UICheckBox sortCheckBox; @@ -39,11 +40,9 @@ public class ViewWebSettingPane extends WebSettingPane { sortCheckBox.setSelected(true); conditionFilterBox.setSelected(true); listFilterBox.setSelected(true); - return row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15), - cell(sortCheckBox).weight(0.15), - cell(conditionFilterBox).weight(0.15), - cell(listFilterBox).weight(0.15), - flex(0.4) + return row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15), + row(cell(sortCheckBox), fix(12), cell(conditionFilterBox), fix(12), cell(listFilterBox), flex()).weight(0.85) ).getComponent(); } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java index 294116e60b..a2f21715ee 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java +++ b/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.web.attr.ReportWebAttr; -import javax.swing.*; +import javax.swing.JPanel; +import javax.swing.ButtonGroup; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -84,7 +85,7 @@ public class WriteWebSettingPane extends WebSettingPane { 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")); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java index 32a62c0a32..8cded20f76 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java +++ b/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()); // 份数 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")); 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), cell(copySpinner).weight(0.15), 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), 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), flex(0.4)), 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.setUnitValue(DEFAULT_PAPERSIZE.getHeight()); - customPaperSizePane = row(LayoutConstants.HORIZONTAL_GAP, - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":")), + customPaperSizePane = row(24, + row(LayoutConstants.HGAP_LARGE, + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width"))), cell(customWidthFieldPane) ), - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":")), + row(LayoutConstants.HGAP_LARGE, + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height"))), cell(customHeightFieldPane) ) ).getComponent(); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java index feef4c9b03..23b79dc2d3 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java +++ b/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); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP, - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)), - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane)) + row(LayoutConstants.HGAP_LARGE, 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_Bottom"))), cell(marginBottomUnitFieldPane)) ).getComponent(); // peter:这个一个垂直的上下的字符panel. marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); 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)) + row(LayoutConstants.HGAP_LARGE, 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_Form_Right"))), cell(marginRightUnitFieldPane)) ).getComponent(); - JPanel marginPane = row(LayoutConstants.HORIZONTAL_GAP, - cell(marginLeftPane), - cell(marginRightPane)).getComponent(); + JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane)).getComponent(); this.setLayout(new BorderLayout()); this.add(marginPane, BorderLayout.CENTER); } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java index aa9dee0e7f..002401178d 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java +++ b/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))); 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.add(allPanel, BorderLayout.CENTER); }