From ee22ad6e657db2b3c1d8482c129262de53623cd0 Mon Sep 17 00:00:00 2001 From: renekton Date: Mon, 5 Aug 2024 13:11:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=BC=95=E6=93=8E=E7=86=9F?= =?UTF-8?q?=E6=82=89ui=E7=BF=BB=E6=96=B0/=E4=BB=A3=E7=A0=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/frpane/ObjectProperiesPane.java | 3 +- .../java/com/fr/design/gui/imenu/UIMenu.java | 1 - .../design/gui/style/FollowingThemePane.java | 3 +- .../hyperlink/popup/CustomFontPane.java | 10 ++- .../com/fr/design/menu/NameSeparator.java | 5 +- .../fr/design/report/ReportEnginePane.java | 66 +++++++++++-------- 6 files changed, 49 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java index f1d6b9bd66..611a5fef9b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.frpane; import com.fine.theme.icon.LazyIcon; import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; @@ -32,7 +33,7 @@ public class ObjectProperiesPane extends BasicBeanPane { public ObjectProperiesPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"), new LazyIcon("add")); diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java index eb2de5b79e..ec78046709 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java @@ -7,7 +7,6 @@ import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.MenuElement; import java.awt.Component; -import java.awt.Dimension; /** * @author null diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java index 9334cc926d..e464110b47 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java @@ -1,6 +1,7 @@ package com.fr.design.gui.style; import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.TemplateTheme; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; @@ -46,7 +47,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver { public FollowingThemePane(String name) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); + this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10)); followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS); followingThemeButtonGroup.setAutoFireStateChanged(false); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/CustomFontPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/CustomFontPane.java index 523bd5006a..34618e6ce3 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/CustomFontPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/CustomFontPane.java @@ -1,12 +1,10 @@ package com.fr.design.hyperlink.popup; -import com.fr.base.BaseUtils; -import com.fr.design.constants.LayoutConstants; +import com.fine.theme.icon.LazyIcon; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.i18n.Toolkit; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.stable.Constants; @@ -46,9 +44,9 @@ public class CustomFontPane extends JPanel { fontSizeComboBox.setEditable(true); colorSelectPane = new UIColorButton(); - bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_bold.png")); - italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_italic.png")); - underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_underline.png")); + bold = new UIToggleButton(new LazyIcon("bold")); + italic = new UIToggleButton(new LazyIcon("italic")); + underline = new UIToggleButton(new LazyIcon("underline")); colorSelectPane.setOpaque(true); bold.setOpaque(true); diff --git a/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java b/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java index b64f133267..5ad5581181 100644 --- a/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java +++ b/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java @@ -1,5 +1,6 @@ package com.fr.design.menu; +import com.fine.theme.utils.FineUIScale; import com.fr.base.GraphHelper; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.ilable.UILabel; @@ -52,11 +53,11 @@ public class NameSeparator extends UpdateAction { } public Dimension getSize() { - return new Dimension(super.getSize().width, 30); + return new Dimension(super.getSize().width, FineUIScale.scale(30)); } public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, 30); + return new Dimension(super.getPreferredSize().width, FineUIScale.scale(30)); } } diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index 09ecfa90d3..5c5f2e51b2 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -1,6 +1,7 @@ package com.fr.design.report; import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.editor.editor.IntegerEditor; @@ -48,6 +49,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.row; import static com.fine.swing.ui.layout.Layouts.box; +import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; import static com.fine.theme.utils.FineUIScale.scale; @@ -92,7 +94,7 @@ public class ReportEnginePane extends BasicBeanPane { outAdvicePane.setPreferredSize(new Dimension(FineUIScale.scale(600), FineUIScale.scale(160))); outAdvicePane.add(createAdvicePane()); - this.add(column(10, + this.add(column(20, cell(wrapComponentWithTitle(outReportEnginePane, Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"))), cell(wrapComponentWithTitle(outPagingEngineSelectPane, Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"))).weight(1.0), cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice")))) @@ -135,7 +137,8 @@ public class ReportEnginePane extends BasicBeanPane { * 目前先屏蔽,后面新引擎显示页码再加上相关代码 */ private void createEngineXSettingPane() { - outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); + outEngineXSettingPane = new JPanel(new BorderLayout()); + UILabel title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); engineXPageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); @@ -151,17 +154,26 @@ public class ReportEnginePane extends BasicBeanPane { rowCountBox.setSelected(false); rowCountPanel.add(rowCountBox); JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip")); - engineXSettingPane.add(column(10, - cell(pageQueryBoxPanel), - cell(engineXPageQueryPane), - cell(rowCountPanel), - cell(tip)) + engineXSettingPane.add(row(20, + column(10, + column(fix(6), cell(title)), + cell(new UILabel()), + cell(new UILabel()), + cell(new UILabel()) + ), + + column(10, + cell(pageQueryBoxPanel), + cell(engineXPageQueryPane), + cell(rowCountPanel), + cell(tip))) .getComponent()); outEngineXSettingPane.add(engineXSettingPane); } private void createLineEngineSettingPane() { - outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); + outLineEngineSettingPane = new JPanel(new BorderLayout()); + UILabel title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); lineEnginePageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); @@ -174,10 +186,15 @@ public class ReportEnginePane extends BasicBeanPane { lineEngineSettingPane.add(lineEnginePageQueryPane); lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane)); JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); - lineEngineSettingPane.add(column(10, - cell(pageQueryBoxPanel), - cell(lineEnginePageQueryPane), - cell(tipPane)) + lineEngineSettingPane.add(row(20, + column(10, + column(fix(6), cell(title)), + cell(new UILabel()), + cell(new UILabel())), + column(10, + cell(pageQueryBoxPanel), + cell(lineEnginePageQueryPane), + cell(tipPane))) .getComponent()); outLineEngineSettingPane.add(lineEngineSettingPane); } @@ -191,12 +208,12 @@ public class ReportEnginePane extends BasicBeanPane { } private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) { - double p = TableLayout.PREFERRED; - double rowSize[] = {p, p}; - double columnSize[] = {p, p}; - Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage")), countPerPageEditor}}; - JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0)); + JPanel pageQueryPane = new JPanel(new BorderLayout()); + pageQueryPane.setBorder(new ScaledEmptyBorder(0, 8, 0, 0)); + pageQueryPane.add(row(4, + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage"))), + cell(countPerPageEditor) + ).getComponent()); return pageQueryPane; } @@ -242,16 +259,9 @@ public class ReportEnginePane extends BasicBeanPane { buttonGroup.add(lineEngine); radioButtons.add(newEngine); radioButtons.add(lineEngine); - double p = TableLayout.FILL; - double[] rowSize = {p}; - double[] columnSize = {p, p, p, p, p}; - Component[][] components = new Component[][]{ - new Component[]{ - newEngine, - lineEngine - } - }; - JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + + JPanel pagingEngineRadioPanel = new JPanel(new BorderLayout()); + pagingEngineRadioPanel.add(row(20, cell(newEngine), cell(lineEngine)).getComponent()); newEngine.addActionListener(new EngineSelectActionListener(newEngine, engineSettingPane, outEngineXSettingPane, outLineEngineSettingPane)); lineEngine.addActionListener(new EngineSelectActionListener(lineEngine, engineSettingPane, outLineEngineSettingPane, outEngineXSettingPane)); return pagingEngineRadioPanel;