From 63550c49a7e4f1357391bdd197380858fb4e5ad3 Mon Sep 17 00:00:00 2001 From: renekton Date: Fri, 6 Sep 2024 19:58:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=A9=E6=94=BE=E4=BB=A5=E5=8F=8A=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/date/UIDayLabel.java | 2 +- .../GradientBackgroundQuickPane.java | 1 - .../theme/edit/CellStyleListEditPane.java | 7 ++++--- .../theme/edit/cell/CellStyleEditPane.java | 8 +++++--- .../edit/chart/AbstractChartStylePane.java | 8 +++----- .../theme/edit/chart/ChartFontPane.java | 18 ++++++++++-------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java b/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java index c4c8afc1d1..f7accce9e9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java @@ -29,7 +29,7 @@ public class UIDayLabel extends UILabel { public UIDayLabel(Date date, boolean isSmallLabel) { setHorizontalAlignment(UILabel.CENTER); - setFont(DesignUtils.getDefaultGUIFont()); + setFont(DesignUtils.getDefaultGUIFont().applySize(scale(12))); this.date = date; setPreferredSize(scale(new Dimension(30, 18))); if (isSmallLabel) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java index 176cd9b8c5..9751200c05 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java @@ -91,7 +91,6 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane { */ @Override public void registerChangeListener(final UIObserverListener listener) { - gradientBar.addChangeListener(new ChangeListenerImpl(listener)); directionPane.addChangeListener(new ChangeListenerImpl(listener)); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java index 5e569afbf5..c50e15d29c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java @@ -46,6 +46,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import static com.fine.theme.utils.FineUIScale.scale; import static com.fr.design.i18n.Toolkit.i18nText; /** @@ -127,8 +128,8 @@ public class CellStyleListEditPane extends JListControlPane { this.setCreators(this.createNameableCreators()); initCardPane(); JPanel leftPane = getLeftPane(); - leftPane.setPreferredSize(new Dimension(90, 0)); - cardPane.setPreferredSize(new Dimension(270, 0)); + leftPane.setPreferredSize(new Dimension(scale(90), super.getPreferredSize().height)); + cardPane.setPreferredSize(new Dimension(scale(270), super.getPreferredSize().height)); JPanel mainSplitPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); mainSplitPane.add(leftPane, BorderLayout.WEST); mainSplitPane.add(cardPane, BorderLayout.CENTER); @@ -292,7 +293,7 @@ public class CellStyleListEditPane extends JListControlPane { Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (component instanceof NameableListCellRenderer) { ((NameableListCellRenderer) component).setIcon(null); - ((NameableListCellRenderer) component).setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); + ((NameableListCellRenderer) component).setBorder(new ScaledEmptyBorder(0, 4, 0, 0)); } return component; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java index 9865321987..84213f6c32 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.edit.cell; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.base.theme.settings.ThemedCellStyle; @@ -24,6 +25,7 @@ import java.awt.Dimension; import java.util.ArrayList; import java.util.List; +import static com.fine.theme.utils.FineUIScale.scale; import static com.fr.design.i18n.Toolkit.i18nText; @@ -129,14 +131,14 @@ public class CellStyleEditPane extends MultiTabPane { @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 10)); - this.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4)); + this.setBorder(new ScaledEmptyBorder(0, 4, 0, 4)); JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); previewArea = new CellRectangleStylePreviewPane(true); - previewArea.setPreferredSize(new Dimension(207, 48)); + previewArea.setPreferredSize(scale(new Dimension(207, 48))); previewPane.setBorder(BorderFactory.createCompoundBorder( BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")), - BorderFactory.createEmptyBorder(4, 4, 4, 4))); + new ScaledEmptyBorder(4, 4, 4, 4))); previewPane.add(previewArea, BorderLayout.NORTH); this.add(previewPane, BorderLayout.NORTH); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java index 547b5c1d25..9625edb642 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.edit.chart; +import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.settings.ThemedChartStyle; @@ -31,11 +32,8 @@ public abstract class AbstractChartStylePane extends BasicPane { protected void initPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - double labelWidth = 90; - double totalWidth = 190; - double p = TableLayout.PREFERRED; - double[] columnSize = {labelWidth, totalWidth}; - JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 5, LayoutConstants.VGAP_LARGE); + + JPanel gapTableLayoutPane = FineLayoutBuilder.compatibleTableLayout(10, getComponent(), new double[]{1.2, 3}); gapTableLayoutPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane); rightTopPane.setBorder(BorderFactory.createEmptyBorder()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java index 150bbe24e0..f6124fd4ba 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java @@ -1,6 +1,8 @@ package com.fr.design.mainframe.theme.edit.chart; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.FRContext; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; @@ -9,6 +11,7 @@ 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.gui.ilable.UILabel; +import com.fr.design.gui.itable.FineUITable; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -24,6 +27,9 @@ import java.awt.Component; import java.awt.FlowLayout; import java.awt.Font; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + /** * @author Bjorn * @version 10.0 @@ -67,8 +73,8 @@ public class ChartFontPane extends BasicPane { Component[] components = new Component[]{ fontSizeComboBox, fontColor, italic, bold }; - JPanel buttonPane = new JPanel(); - buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE)); + JPanel buttonPane = new JPanel(new BorderLayout()); + buttonPane.add(row(4, cell(fontSizeComboBox), cell(fontColor), cell(italic), cell(bold)).getComponent()); this.setLayout(new BorderLayout()); this.add(getContentPane(buttonPane), BorderLayout.CENTER); @@ -77,11 +83,7 @@ public class ChartFontPane extends BasicPane { } protected JPanel getContentPane(JPanel buttonPane) { - double labelWidth = 90; - double totalWidth = 190; - double p = TableLayout.PREFERRED; - double[] rows = {p, p, p}; - double[] columnSize = {labelWidth, totalWidth}; + UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT); text.setToolTipText(getUILabelText()); Component[][] components = { @@ -90,7 +92,7 @@ public class ChartFontPane extends BasicPane { new Component[]{null, buttonPane} }; - return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 5, 10); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } public String getUILabelText() {