From 45c0952541b39feff0a996011aefdc05cc824019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Mon, 9 Sep 2024 17:07:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-133693=20&=20REPORT-133882=20&=20REPORT-?= =?UTF-8?q?133878=20fix:=20NewUI=20=E6=8E=A7=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E9=85=8D&Form=E9=81=97=E6=BC=8F=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=BF=BB=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widgettheme/BaseStyleSettingPane.java | 42 +++++-------------- .../form/FormReportComponentComposite.java | 4 +- .../FormECRepeatAndFreezeSettingPane.java | 1 + .../design/widget/ui/CheckBoxDefinePane.java | 31 +++++--------- 4 files changed, 23 insertions(+), 55 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java index 14183ed2e6..280ebcb9f2 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java @@ -1,10 +1,11 @@ package com.fr.design.widgettheme; import com.fine.swing.ui.layout.Column; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.background.ColorBackground; import com.fr.base.theme.TemplateTheme; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.designer.IntervalConstants; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.FontSizeComboPane; import com.fr.design.gui.frpane.UIPercentDragPane; @@ -18,15 +19,12 @@ import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.style.FRFontPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.DesignUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.Widget; import com.fr.general.FRFont; -import com.fr.general.IOUtils; import com.fr.util.ColorUtils; import com.fr.widgettheme.theme.bean.ButtonBackground; import com.fr.widgettheme.theme.panel.ButtonStyleDefinedPane; @@ -38,7 +36,6 @@ import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; import com.fr.widgettheme.util.WidgetStyleComponentCombiner; import com.fr.widgettheme.util.WidgetThemeDesignerUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; @@ -130,8 +127,9 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa protected void initPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.add(createHeadPane(), BorderLayout.NORTH); - this.add(createCustomPane(), BorderLayout.CENTER); + this.add(column(10, + cell(createHeadPane()), cell(createCustomPane()) + ).getComponent(), BorderLayout.CENTER); } @@ -145,8 +143,8 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa fontNameSelectBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontSizePane = new FontSizeComboPane(); fontColorButton = new UIColorButton(); - bold = new UIToggleButton(IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); - italic = new UIToggleButton(IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); + bold = new UIToggleButton(new LazyIcon("bold")); + italic = new UIToggleButton(new LazyIcon("italic")); widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); widgetBgAlphaDragPane = new UIPercentDragPane(); paneMap.put(StyleSetting.THEME_COLOR, colorSelectBox); @@ -180,34 +178,14 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa switchCard(); } }; - JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{headLabel, styleSettingHead}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); - headPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); - return headPane; + + return FineLayoutBuilder.createHorizontalLayout(0, new double[] {1.2, 3}, headLabel, styleSettingHead); } protected JPanel createCustomPane() { int size = styleSettingList.size(); - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - int columnCount = 2; - double[] rowSize = new double[size]; - for (int i = 0; i < size; i++) { - rowSize[i] = p; - } - - double[] columnSize = {p, f}; - - int[][] rowCount = new int[size][columnCount]; - for (int i = 0; i < size; i++) { - for (int j = 0; j < columnCount; j++) { - rowCount[i][j] = 1; - } - } - - customPane = TableLayoutHelper.createGapTableLayoutPane(createComponents(size), rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); - customPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); + customPane = FineLayoutBuilder.compatibleTableLayout(10, createComponents(size), new double[]{1.2, 3}); return customPane; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java index 5fdc4b011b..27d0a202a4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.form; +import com.formdev.flatlaf.ui.FlatRoundBorder; import com.fr.base.DynamicUnitList; import com.fr.base.ScreenResolution; import com.fr.design.cell.bar.DynamicScrollBar; @@ -11,9 +12,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JDashboard; -import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JFormSliderPane; -import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplateProvider; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.form.FormElementCaseContainerProvider; @@ -59,6 +58,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo this.elementCaseDesigner.elementCasePane.getGrid().addMouseWheelListener(new FormReportComponentCompositeMouseWheelHandler(this)); elementCaseDesigner.addTargetModifiedListener(this); this.jSliderContainer.setShowValue((ScreenResolution.getScreenResolution() * HUND) / Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION); + setBorder(new FlatRoundBorder()); } public FormReportComponentComposite(BaseJForm jform, FormElementCaseDesigner elementCaseDesign, FormElementCaseContainerProvider ecContainer) { diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java index 6e53599492..7ccc8771c6 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java @@ -30,6 +30,7 @@ public class FormECRepeatAndFreezeSettingPane extends RepeatAndFreezeSettingPane protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) { super.initWriteFrozenPane(); + this.add(pagePanel); } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java index 85e5272eb5..51a4c6e117 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java @@ -7,7 +7,6 @@ import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; import com.fr.design.widgettheme.processor.WidgetThemeCreatorPaneAdder; import com.fr.form.ui.CheckBox; import com.fr.general.GeneralContext; @@ -37,8 +36,6 @@ public class CheckBoxDefinePane extends AbstractDataModify { protected final List> extraPaneList = new ArrayList<>(); protected JPanel extraPane; - protected static double F = TableLayout.FILL; - protected static double P = TableLayout.PREFERRED; public CheckBoxDefinePane() { this.iniComponents(); @@ -51,24 +48,16 @@ public class CheckBoxDefinePane extends AbstractDataModify { JPanel content = new JPanel(new BorderLayout()); - if (extraPane == null) { - content.add( - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"))).weight(LEFT_WEIGHT), - cell(text).weight(RIGHT_WEIGHT) - ).getComponent() - ); - } else { - content.add( - column( - 10, - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"))).weight(LEFT_WEIGHT), - cell(text)).weight(RIGHT_WEIGHT), - row(cell(extraPane)) - ).getComponent() - ); - } + content.add( + column( + 10, + row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"))).weight(LEFT_WEIGHT), + cell(text).weight(RIGHT_WEIGHT) + ), + cell(extraPane) + ).getComponent() + ); UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 24, content); this.add(uiExpandablePane); }