From 32ac35038d21b5a03ef2b85ce06eae67016af6e3 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 10 Sep 2024 15:26:16 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E9=97=AE=E9=A2=98&=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=9B=BD=E9=99=85=E5=8C=96=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E9=97=AE=E9=A2=98&=E5=8D=95=E5=85=83=E6=A0=BC=E4=B8=8D?= =?UTF-8?q?=E9=9A=8F=E6=B8=90=E5=8F=98=E6=9D=A1=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tractTranslucentBackgroundSpecialPane.java | 17 +++++----- .../fr/design/gui/style/AlignmentPane.java | 15 ++++++--- .../com/fr/design/gui/style/BorderPane.java | 3 +- .../gui/style/ComponentIntegralStylePane.java | 10 ++---- .../gui/style/ComponentTitleStylePane.java | 23 ++++---------- .../TextInsetImageBackgroundSpecialPane.java | 5 +-- .../javascript/Commit2DBJavaScriptPane.java | 5 ++- .../GradientBackgroundQuickPane.java | 5 ++- .../ImageBackgroundQuickPane.java | 1 + .../PatternBackgroundQuickPane.java | 6 ++-- .../mainframe/theme/FormThemeProfilePane.java | 1 + .../theme/ReportThemeProfilePane.java | 1 + .../theme/TemplateThemeEditorPane.java | 19 +++++++----- .../ChartTitleAndBackgroundStylePane.java | 4 ++- .../component/ComponentMarginStylePane.java | 12 ++----- .../background/gradient/GradientBar.java | 31 +++++++++++++++++++ .../write/submit/DBManipulationPane.java | 19 ++++++------ .../java/com/fr/design/webattr/EventPane.java | 10 +++--- 18 files changed, 108 insertions(+), 79 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java index f1bc865c9f..bd6d633f33 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; @@ -46,27 +47,25 @@ public abstract class AbstractTranslucentBackgroundSpecialPane 0 ? this.uiSettingWidth : f}; - // 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐 JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); backgroundLabelPane.setBorder(new ScaledEmptyBorder(7, 0, 0, 0)); - backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(backgroundName), BorderLayout.NORTH); + UILabel backgroundLabel = new UILabel(backgroundName); + backgroundLabel.setToolTipText(backgroundName); + backgroundLabelPane.add(backgroundLabel, BorderLayout.NORTH); - JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane( + JPanel backgroundComposedPane = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {backgroundLabelPane, backgroundPane} }, - new double[]{p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); - JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane( + JPanel opacityComposedPane = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {new UILabel(""), FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, {new UILabel(""), opacityPane} }, - new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); opacityComposedPane.setBorder(new ScaledEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); opacityComposedPane.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java index 4cbbe01590..4ba5c9aa5b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java @@ -212,11 +212,12 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel seniorUpPane() { return Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Image_Layout")), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Image_Layout"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Image_Layout"))).weight(1.2), cell(imageLayoutComboBox).weight(3.0) ), row( - cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Text_Style")), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Text_Style"), SwingConstants.LEFT)).weight(1.2), cell(textComboBox).weight(3.0) ) ).getComponent(); @@ -225,12 +226,14 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel seniorMiddlePane() { rotationBarPane = ReactiveCardPane.create() .addSupplier("hide", () -> Layouts.row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"))).weight(1.2), cell(textRotationComboBox).weight(3) ).getComponent()) .addSupplier("show", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"))).weight(1.2), cell(textRotationComboBox).weight(3) ), row( @@ -249,9 +252,11 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel seniorDownPane() { UILabel indentationLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Indentation")), SwingConstants.LEFT); + indentationLabel.setToolTipText(indentationLabel.getText()); UILabel partSpacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Part_Spacing")), SwingConstants.LEFT); + partSpacingLabel.setToolTipText(partSpacingLabel.getText()); UILabel spacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Line_Spacing")), SwingConstants.LEFT); - + spacingLabel.setToolTipText(spacingLabel.getText()); return Layouts.column( row( cell(indentationLabel).weight(1.2), diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 81759d5f04..ca73c9b59e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -104,7 +104,8 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"), SwingConstants.LEFT)).weight(1.2), cell(currentLineColorPane).weight(3)), row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"))).weight(1.2), cell(outerToggleButton = new UIToggleButton(new Icon[]{new LazyIcon("out"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/out_white.png")}, false)). with(it -> it.setPreferredSize(new Dimension(-1, FineUIScale.scale(24)))).weight(3)), diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java index 0fe9c14891..476fb2529e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; @@ -66,17 +67,12 @@ public class ComponentIntegralStylePane extends AbstractBorderPackerPane { setLayout(FRGUIPaneFactory.createBorderLayout()); this.initializeComponents(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = supportCornerRadius ? new double[] {p, p, p} : new double[]{p, p}; - double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; - - JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ + JPanel content = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(borderStyleCombo)}, {this.borderPane, null}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, }, - rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); this.add(content, BorderLayout.NORTH); } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java index 1f2fb91b82..e391cde959 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.Utils; import com.fr.base.svg.IconUtils; import com.fr.design.designer.IntervalConstants; @@ -187,21 +188,13 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { } private JPanel createTitleContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = {p}; - double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; - return TableLayoutHelper.createCommonTableLayoutPane( + return FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), textContentPane}}, - rowSize, columnSize, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); } private JPanel createTitleOtherSettingPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = {p, p, p, p, p}; - double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; JComponent[][] components = new JComponent[][]{ {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(fontFamilyComboBox)}, @@ -211,18 +204,14 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { {backgroundPane, null} }; - return TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, IntervalConstants.INTERVAL_L1); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected JPanel createTitleFontButtonPane(){ - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = {p}; - double[] columnSize = {f, p, p, p, p}; - JPanel buttonPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][] { + JPanel buttonPane = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][] { {fontSizeComboBox, fontColorSelectPane, fontItalicButton, fontBoldButton, fontUnderlineButton}, - }, rowSize, columnSize, IntervalConstants.INTERVAL_W0); + }, new double[]{1.2, 3}); JPanel containerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); containerPane.add(buttonPane, BorderLayout.NORTH); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java index b3556dc6f8..59f0d8c1bd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.Style; import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageFileBackground; @@ -154,7 +155,7 @@ public class TextInsetImageBackgroundSpecialPane extends JPanel implements UIObs } }); - return TableLayoutHelper.createCommonTableLayoutPane( + return FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {null, deletableImagePreviewPane}, {null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Inset_Relative_Location"))}, @@ -162,7 +163,7 @@ public class TextInsetImageBackgroundSpecialPane extends JPanel implements UIObs {null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Inset_Padding"))}, {null, this.imagePaddingPane} }, - rowSize, columnSize, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); } private void initImageFileChooserIfNotExist() { diff --git a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java index a475fa1cdb..35c40b8645 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java @@ -17,6 +17,7 @@ import java.awt.Dimension; import java.util.ArrayList; import java.util.List; +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.cell; @@ -53,14 +54,12 @@ public class Commit2DBJavaScriptPane extends FurtherBasicBeanPane(textArray, valueArray); + directionPane.setAllToolTips(textArray); directionPane.setSelectedIndex(0); gradientBar = new GradientBar(4, this.gradientBarWidth); this.setLayout(new BorderLayout()); @@ -91,7 +92,9 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane { */ @Override public void registerChangeListener(final UIObserverListener listener) { - directionPane.addChangeListener(new ChangeListenerImpl(listener)); + gradientBar.addChangeListener(new ChangeListenerImpl(listener)); + + directionPane.addChangeListener(new ChangeListenerImpl(listener)); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java index 6bdc8bb008..70ee8625d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java @@ -50,6 +50,7 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane { String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Default"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Titled"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Extend"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Adjust")}; Byte[] valueArray = {Constants.IMAGE_CENTER, Constants.IMAGE_TILED, Constants.IMAGE_EXTEND, Constants.IMAGE_ADJUST}; imageLayoutPane = new UIButtonGroup(nameArray, valueArray); + imageLayoutPane.setAllToolTips(nameArray); imageLayoutPane.setSelectedIndex(0); previewPane = new ImagePreviewPane(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 789bcd16cf..d0be0875fe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -61,10 +61,12 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { foregroundColorPane.setSelectObject(DEFAULT_BACKGROUND); this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)).weight(1), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"))).weight(1), cell(foregroundColorPane).weight(4)), row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)).weight(1), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"))).weight(1), cell(backgroundColorPane).weight(4)) ).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER); foregroundColorPane.addSelectChangeListener(colorChangeListener); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index 922230b158..b0d470ffed 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -71,6 +71,7 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { componentStyleSettingPane = new ComponentStyleEditPane(); addCustomEditorPane(i18nText("Fine-Design_Predefined_Component_Style"), componentStyleSettingPane); + initializePane(); refreshExtraAdvancedPane(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index 3f654cae5c..44253b983b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -51,6 +51,7 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane extends J protected final List> extraPaneList = new ArrayList<>(); protected boolean isPopulating = false; - protected UITabbedPane uiTabbedPane; + protected FineTabbedPane.TabPaneBuilder tabPaneBuilder; + protected FineTabbedPane uiTabbedPane; private final TemplateThemeConfig config; @@ -81,10 +83,10 @@ public abstract class TemplateThemeEditorPane extends J super(); this.config = config; theme = config.createNewTheme(); - initializePane(); + tabPaneBuilder = FineTabbedPane.builder(); } - private void initializePane() { + protected void initializePane() { setLayout(new BorderLayout(0, 0)); setPreferredSize(FineUIScale.scale(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT))); JPanel nameEditPane = createNameEditPane(); @@ -180,9 +182,7 @@ public abstract class TemplateThemeEditorPane extends J protected JPanel createCustomEditorsPane() { JPanel container = new JPanel(new BorderLayout()); container.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Custom_Settings_Title"))); - - uiTabbedPane = new UITabbedPane(); - uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); + buildTabPane(); container.add(uiTabbedPane, BorderLayout.CENTER); initPluginListener(); return container; @@ -203,7 +203,7 @@ public abstract class TemplateThemeEditorPane extends J fireAttributeChange(); } }); - uiTabbedPane.addTab(title, settingPane); + tabPaneBuilder.addTab(title, settingPane); } protected void refreshExtraAdvancedPane() { @@ -359,4 +359,9 @@ public abstract class TemplateThemeEditorPane extends J } return ThemePreviewTerminal.PC; } + + private void buildTabPane() { + uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); + uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java index 2dc0659d00..f2d928479c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java @@ -86,12 +86,14 @@ public class ChartTitleAndBackgroundStylePane extends AbstractChartStylePane { String chartAreaBgLabelName = Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color"); UILabel chartAreaBgLabel = new UILabel(chartAreaBgLabelName); chartAreaBgLabel.setToolTipText(chartAreaBgLabelName); + UILabel gridLineLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Grid_Line_Color")); + gridLineLabel.setToolTipText(gridLineLabel.getText()); return new Component[][]{ new Component[]{chartFontPane, null}, new Component[]{null, null}, new Component[]{chartAreaBgLabel, typeComboBox}, new Component[]{null, centerPane}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Grid_Line_Color")), mainGridColor} + new Component[]{gridLineLabel, mainGridColor} }; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java index 643c1e9601..5e5d43a6b1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.edit.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ilable.UILabel; @@ -50,16 +51,9 @@ public class ComponentMarginStylePane extends JPanel { uiLabel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); uiLabel.setVerticalAlignment(SwingConstants.TOP); - - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = { p }; - double[] columnSize = { this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f }; - - JPanel panel = TableLayoutHelper.createGapTableLayoutPane( + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, new Component[][]{new Component[]{uiLabel, createPaddingPane()}}, - rowSize, columnSize, - IntervalConstants.INTERVAL_L1, 0 + new double[]{1.2, 3} ); this.add(panel); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 7954387448..25467b02ba 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -9,6 +9,7 @@ import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorSelectable; import com.fr.design.style.color.NewColorSelectPane; import com.fr.stable.AssistUtils; +import com.fr.stable.os.OperatingSystem; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -84,6 +85,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, p1.setStartPosition(0); p2.setStartPosition(1); addMouseClickListener(); + addMouseDragListener(); iniListener(); } @@ -129,6 +131,35 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, }); } + protected void addMouseDragListener() { + this.addMouseMotionListener(new MouseAdapter() { + public void mouseDragged(MouseEvent e) { + int oldIndex = index; + for (int i = 0; i < list.size(); i++) { + if (list.get(i).contains(e.getX(), e.getY())) { + index = i; + break; + } + } + if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) { + if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) { + index = 1; + } else { + index = 0; + } + } + boolean x = e.getX() <= max && e.getX() >= min; + if (x && e.getY() < MAX_VERTICAL) { + list.get(index).setX(e.getX()); + } + + GradientBar.this.repaint(); + startLabel.setText(Double.toString(p1.getX())); + endLabel.setText(Double.toString(p2.getX())); + } + }); + } + protected void clickButton(int select) { setIndex(select); showPopupMenu(); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 3d366eb9a5..96dac6fd08 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -103,6 +103,7 @@ import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.theme.utils.FineUIScale.scale; //august:这个东西应该分成两类,一类是有单元格的情况,一类是没有单元格的情况 public class DBManipulationPane extends BasicBeanPane { @@ -165,16 +166,16 @@ public class DBManipulationPane extends BasicBeanPane { cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(dmlConfigComboBox)).getComponent()); chooseTable = new ChoosePaneSupportFormula(); - chooseTable.setTableNameComboBoxPopSize(FineUIScale.scale(160), FineUIScale.scale(320)); + chooseTable.setTableNameComboBoxPopSize(scale(160), scale(320)); // peter:编辑的TablePane - JPanel editTablePane = new JPanel(new BorderLayout(FineUIScale.scale(10), 0)); + JPanel editTablePane = new JPanel(new BorderLayout(scale(10), 0)); Dimension editTableDimension = createEditTablePreferredSize(); editTablePane.setBounds(0, 0, editTableDimension.width, editTableDimension.height); keyColumnValuesTable = new KeyColumnNameValueTable(); editTablePane.add(new UIVerticalScrollPane(keyColumnValuesTable), BorderLayout.CENTER); keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - keyColumnValuesTable.setPreferredScrollableViewportSize(FineUIScale.scale(new Dimension(280, 150))); + keyColumnValuesTable.setPreferredScrollableViewportSize(scale(new Dimension(280, 150))); keyColumnValuesTable.setShowHorizontalLines(true); northPane.add(column(10, @@ -190,7 +191,7 @@ public class DBManipulationPane extends BasicBeanPane { cell(bottomPane)) .getComponent(), BorderLayout.CENTER); - this.add(new UIScrollPane(contentPane)); + this.add(contentPane); initJTableColumn(); @@ -216,7 +217,7 @@ public class DBManipulationPane extends BasicBeanPane { List buttonGroup = Arrays.stream(actions).map(action -> cell(new UIButton(action))).collect(Collectors.toList()); checkBoxUpdatePane = new JPanel(new BorderLayout(0, 0)); - checkBoxUpdatePane.setPreferredSize(new Dimension(120, 20)); + checkBoxUpdatePane.setPreferredSize(scale(new Dimension(120, 20))); UpdateCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_NotChange_Unmodified")); UIButton helpButton = new UIButton(HEIP_ICON); @@ -372,11 +373,11 @@ public class DBManipulationPane extends BasicBeanPane { } protected Dimension createEditTablePreferredSize() { - return FineUIScale.scale(new Dimension(280, 180)); + return scale(new Dimension(280, 180)); } protected Dimension createConditionPanePreferredSize() { - return FineUIScale.scale(new Dimension(454, 60)); + return scale(new Dimension(454, 60)); } protected boolean setJpVisible() { @@ -384,12 +385,12 @@ public class DBManipulationPane extends BasicBeanPane { } protected Dimension createJpPreferredSize() { - return FineUIScale.scale(new Dimension(280, 60)); + return scale(new Dimension(280, 60)); } protected Dimension createControlBtnPanePreferredSize() { - return FineUIScale.scale(new Dimension(110, 20)); + return scale(new Dimension(110, 20)); } protected String setControlBtnPanePosition() { diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java b/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java index 5f3d43cf5c..812b7352f3 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java @@ -218,14 +218,13 @@ public class EventPane extends BasicPane { jsPane.populateBean(lis); // BasicDialog dialog = jsPane.showWindow(DesignerContext.getDesignerFrame()); // 不能直接建立在DesignerFrame 不然里面事件里有提交入库进行智能添加单元格就麻烦了 - BasicDialog dialog = jsPane.showWindow(SwingUtilities.getWindowAncestor(EventPane.this)); - dialog.addDialogActionListener(new DialogActionAdapter() { + BasicDialog dialog = jsPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(EventPane.this), new DialogActionAdapter() { @Override public void doOk() { listModel.setElementAt(jsPane.updateBean(), i); eventList.validate(); } - }); + }, new Dimension(660, 660)); dialog.setVisible(true); } @@ -272,14 +271,13 @@ public class EventPane extends BasicPane { Listener lis = new Listener(menuName[j], new JavaScriptImpl()); listenerPane.populateBean(lis); - BasicDialog dialog = listenerPane.showWindow(SwingUtilities.getWindowAncestor(EventPane.this)); - dialog.addDialogActionListener(new DialogActionAdapter() { + BasicDialog dialog = listenerPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(EventPane.this), new DialogActionAdapter() { @Override public void doOk() { listModel.addElement(listenerPane.updateBean()); eventList.validate(); } - }); + }, new Dimension(660, 660)); dialog.setVisible(true); } From 665df85d08f685603e31411740e922220ad9a666 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 10 Sep 2024 16:13:05 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=BB=E9=A2=98tab?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/theme/FormThemeProfilePane.java | 7 +++++++ .../fr/design/mainframe/theme/TemplateThemeEditorPane.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index b0d470ffed..94067cd59b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemedComponentStyle; @@ -99,5 +100,11 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { ThemedComponentStyle componentStyle = componentStyleSettingPane.updateBean(); theme.setComponentStyle(componentStyle); } + + @Override + protected void buildTabPane() { + uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); + uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); + } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java index 91a7a28d75..8acebe91cd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java @@ -360,7 +360,7 @@ public abstract class TemplateThemeEditorPane extends J return ThemePreviewTerminal.PC; } - private void buildTabPane() { + protected void buildTabPane() { uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); } From 2ed62939b9191e350937d0c1a46cd949e491ff9b Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 10 Sep 2024 20:12:22 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=94=A8=E5=AE=9A=E5=A5=BD=E7=9A=84?= =?UTF-8?q?=E5=B8=B8=E9=87=8F=E6=9B=BF=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/AbstractTranslucentBackgroundSpecialPane.java | 5 +++-- .../com/fr/design/gui/style/ComponentIntegralStylePane.java | 3 ++- .../com/fr/design/gui/style/ComponentTitleStylePane.java | 5 +++-- .../gui/style/TextInsetImageBackgroundSpecialPane.java | 3 ++- .../theme/edit/component/ComponentMarginStylePane.java | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java index bd6d633f33..8d0c572da5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.style; import com.fine.theme.utils.FineLayoutBuilder; import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UIPercentDragPane; @@ -58,14 +59,14 @@ public abstract class AbstractTranslucentBackgroundSpecialPane Date: Tue, 10 Sep 2024 20:20:52 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=8F=90=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/gradient/GradientBar.java | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 25467b02ba..74afec7efd 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -134,28 +134,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, protected void addMouseDragListener() { this.addMouseMotionListener(new MouseAdapter() { public void mouseDragged(MouseEvent e) { - int oldIndex = index; - for (int i = 0; i < list.size(); i++) { - if (list.get(i).contains(e.getX(), e.getY())) { - index = i; - break; - } - } - if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) { - if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) { - index = 1; - } else { - index = 0; - } - } - boolean x = e.getX() <= max && e.getX() >= min; - if (x && e.getY() < MAX_VERTICAL) { - list.get(index).setX(e.getX()); - } - - GradientBar.this.repaint(); - startLabel.setText(Double.toString(p1.getX())); - endLabel.setText(Double.toString(p2.getX())); + dragAction(e); } }); } @@ -336,4 +315,29 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, public void setDraggable(boolean draggable) { this.draggable = draggable; } + + private void dragAction(MouseEvent e) { + int oldIndex = index; + for (int i = 0; i < list.size(); i++) { + if (list.get(i).contains(e.getX(), e.getY())) { + index = i; + break; + } + } + if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) { + if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) { + index = 1; + } else { + index = 0; + } + } + boolean x = e.getX() <= max && e.getX() >= min; + if (x && e.getY() < MAX_VERTICAL) { + list.get(index).setX(e.getX()); + } + + GradientBar.this.repaint(); + startLabel.setText(Double.toString(p1.getX())); + endLabel.setText(Double.toString(p2.getX())); + } } \ No newline at end of file From 3ec63c50584783013bf2ab3fcf051c07bf119032 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 10 Sep 2024 20:32:54 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=8F=90=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/gradient/GradientBar.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 74afec7efd..923c8ec39e 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -318,13 +318,25 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, private void dragAction(MouseEvent e) { int oldIndex = index; - for (int i = 0; i < list.size(); i++) { + int size = list.size(); + for (int i = 0; i < size; i++) { if (list.get(i).contains(e.getX(), e.getY())) { index = i; break; } } - if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) { + updateX(oldIndex, index, e); + + GradientBar.this.repaint(); + if (index == 1) { + endLabel.setText(Double.toString(p2.getX())); + } else { + startLabel.setText(Double.toString(p1.getX())); + } + } + + private void updateX(int oldIndex, int newIndex, MouseEvent e) { + if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, newIndex)) { if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) { index = 1; } else { @@ -335,9 +347,5 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, if (x && e.getY() < MAX_VERTICAL) { list.get(index).setX(e.getX()); } - - GradientBar.this.repaint(); - startLabel.setText(Double.toString(p1.getX())); - endLabel.setText(Double.toString(p2.getX())); } } \ No newline at end of file From b340ec2ef92e9def18bd67e41741ec3d3baf1357 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 10 Sep 2024 20:38:14 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/background/gradient/GradientBar.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 923c8ec39e..bd243f2c35 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -343,8 +343,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, index = 0; } } - boolean x = e.getX() <= max && e.getX() >= min; - if (x && e.getY() < MAX_VERTICAL) { + if (e.getX() <= max && e.getX() >= min && e.getY() < MAX_VERTICAL) { list.get(index).setX(e.getX()); } } From 81d9e7a85b2737c3815e67c8643cb0d850e87210 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 10:06:48 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/backgroundpane/PatternBackgroundQuickPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 55596576b2..48984a4590 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -73,7 +73,7 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)) .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"))).weight(1), cell(backgroundColorPane).weight(4)), - row(cell(foregroundLabel).weight(1), cell(foregroundColorPane).weight(4)), + row(cell(foregroundLabel).weight(1), cell(foregroundColorPane).weight(4)) ).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER); foregroundColorPane.addSelectChangeListener(colorChangeListener); backgroundColorPane.addSelectChangeListener(colorChangeListener); From 59b87bcbe4b523cfefef4733d6c7d1bd6f6eef04 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 15:33:22 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=8C=89=E9=92=AE=E5=A4=A7=E5=B0=8F=E5=BC=B9=E6=80=A7?= =?UTF-8?q?=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/write/submit/CustomJobPane.java | 14 ++++---------- .../design/write/submit/SubmitVisitorListPane.java | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index 9c1a65b723..7b67d5137d 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -2,6 +2,7 @@ package com.fr.design.write.submit; import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; @@ -43,17 +44,10 @@ public abstract class CustomJobPane extends BasicBeanPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(); - classNameTextField.setPreferredSize(FineUIScale.scale(new Dimension(0, 24))); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - browserButton.setPreferredSize(new Dimension( - GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 40, - FineUIScale.scale(24))); UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); - editButton.setPreferredSize(new Dimension( - GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 40, - FineUIScale.scale(24))); UITextArea area = new UITextArea(2, 1); @@ -95,16 +89,16 @@ public abstract class CustomJobPane extends BasicBeanPane { }); reportletNamePane.setLayout(new BorderLayout()); - reportletNamePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + reportletNamePane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); reportletNamePane.add(row(4, - cell(classNameTextField).weight(1.0), + cell(classNameTextField).weight(1), cell(browserButton), cell(editButton) ).getComponent(), BorderLayout.CENTER); objectProperiesPane = new ObjectProperiesPane(); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - dsPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + dsPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); dsPane.add(area); this.add(column(20, cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Name"))), diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java index ff46e08971..4cb4dea409 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -196,7 +196,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), - cell(csjConfigComboBox)).getComponent()); + cell(csjConfigComboBox).weight(0.5)).getComponent()); this.add(column( cell(FineUIUtils.wrapComponentWithTitle(typePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))),