From 9b6a5200e0c57b6168a062fd8cb8b488f5085380 Mon Sep 17 00:00:00 2001 From: renekton Date: Fri, 16 Aug 2024 18:45:16 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=9B=E5=8D=95=E5=85=83=E6=A0=BC=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E7=BC=A9=E6=94=BE=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombobox/ColorSchemeComboBox.java | 6 ++--- .../javascript/ExportJavaScriptPane.java | 6 ++--- .../mainframe/theme/TemplateThemeBlock.java | 3 ++- .../theme/TemplateThemeGridPagesPane.java | 7 +++--- .../theme/TemplateThemeGridPane.java | 7 +++--- .../dialog/TemplateThemeProfileDialog.java | 5 ++-- .../edit/chart/AbstractChartStylePane.java | 6 +++-- .../theme/edit/chart/ChartFontPane.java | 2 +- .../theme/edit/chart/ChartLabelStylePane.java | 6 +++++ .../mainframe/theme/ui/BreadcrumbBar.java | 8 ++++--- .../fine/theme/icon/layout/layout_bottom.svg | 5 ++++ .../fine/theme/icon/layout/layout_left.svg | 6 +++++ .../fine/theme/icon/layout/layout_right.svg | 6 +++++ .../com/fine/theme/icon/layout/layout_top.svg | 5 ++++ .../theme/icon/layout/layout_top_right.svg | 6 +++++ .../fine/theme/light/ui/fine_light.icon.json | 7 +++++- .../style/VanChartPlotLegendPane.java | 11 +++++---- .../designer/style/VanChartTitlePane.java | 7 +++--- .../label/VanChartPlotLabelDetailPane.java | 13 ++++++++--- .../design/condition/WidgetHighlightPane.java | 5 ++-- .../fr/design/widget/CellWidgetCardPane.java | 6 ++++- .../design/widget/EastCellWidgetCardPane.java | 6 ----- .../widget/FloatWidgetManageCardPane.java | 23 +++++++++++++++++++ 23 files changed, 119 insertions(+), 43 deletions(-) create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/layout/layout_bottom.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/layout/layout_left.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/layout/layout_right.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top_right.svg create mode 100644 designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java index 0c7ef3f946..2ace77e344 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java @@ -252,7 +252,7 @@ public class ColorSchemeComboBox extends UIComboBox { } else { FontMetrics fontMetrics = comp.getFontMetrics(comp.getFont()); //宽度是5倍的高加上4倍的留白 - double width = (HEIGHT - 2 * Y) * MAX_COUNT + BLANK * (MAX_COUNT - 1); + double width = FineUIScale.scale((float) ((HEIGHT - 2 * Y) * MAX_COUNT + BLANK * (MAX_COUNT - 1))); String fill = BLANK_SPACE; //图形和文字之间留的宽度大于3倍的X while (fontMetrics.stringWidth(fill) < width + 3 * X) { @@ -285,7 +285,7 @@ public class ColorSchemeComboBox extends UIComboBox { double width = height * MAX_COUNT + BLANK * (MAX_COUNT - 1); LinearGradientPaint linearGradientPaint = new LinearGradientPaint((float) X, (float) Y, (float) (X + width), (float) Y, new float[]{0f, 1f}, colors.toArray(new Color[colors.size()])); g2d.setPaint(linearGradientPaint); - Rectangle2D rec = new Rectangle2D.Double(X, Y, width, height); + Rectangle2D rec = new Rectangle2D.Double(FineUIScale.scale((float) X), FineUIScale.scale((float) Y), FineUIScale.scale((float) width), FineUIScale.scale((float) height)); g2d.fill(rec); } @@ -296,7 +296,7 @@ public class ColorSchemeComboBox extends UIComboBox { double width = ((height + BLANK) * MAX_COUNT - size) / size; for (int i = 0; i < size; i++) { g2d.setPaint(colors.get(i)); - Rectangle2D rec = new Rectangle2D.Double(X + (width + BLANK) * i, Y, width, height); + Rectangle2D rec = new Rectangle2D.Double(FineUIScale.scale((float) (X + (width + BLANK) * i)), FineUIScale.scale((float) Y), FineUIScale.scale((float) width), FineUIScale.scale((float) height)); g2d.fill(rec); } } diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 9018c1fbc1..4768a88aeb 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -301,9 +301,9 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane extends JPanel { JPanel infoPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); infoPane.setPreferredSize(new Dimension(CONTENT_WIDTH, INFO_HEIGHT)); infoPane.setBackground(Color.WHITE); - infoPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L7,0,IntervalConstants.INTERVAL_L7)); + infoPane.setBorder(new ScaledEmptyBorder(0, IntervalConstants.INTERVAL_L7,0,IntervalConstants.INTERVAL_L7)); UILabel titleLabel = new UILabel(name); titleLabel.setToolTipText(name); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java index 704f9c1a35..508eb7e2de 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.ScreenResolution; import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormThemeConfig; @@ -73,16 +74,16 @@ public class TemplateThemeGridPagesPane extends JPanel { private void initializePane(@Nullable Window window) { setLayout(new BorderLayout()); - setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + setBorder(new ScaledEmptyBorder(10, 10, 0, 10)); breadcrumbBar = new BreadcrumbBar(); - breadcrumbBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + breadcrumbBar.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); add(breadcrumbBar, BorderLayout.NORTH); contentPane = new JPanel(); contentPane.setBorder(new CompoundBorder( new TopLineBorder(new Color(0xE0E0E1), 1), - BorderFactory.createEmptyBorder(10, 0, 0, 0))); + new ScaledEmptyBorder(10, 0, 0, 0))); cardLayout = new CardLayout(); contentPane.setLayout(cardLayout); add(contentPane, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java index 169f24b51f..1493eb3b45 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.theme; import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.design.designer.IntervalConstants; @@ -35,9 +36,9 @@ import java.util.Map; public class TemplateThemeGridPane extends BasicPane { public static final int BLOCK_COUNT_ROW_LINE = 3; public static final int BLOCK_GAP = IntervalConstants.INTERVAL_L1; - public static final int CONTENT_WIDTH = FineUIScale.scale(TemplateThemeBlock.CONTENT_WIDTH * BLOCK_COUNT_ROW_LINE + BLOCK_GAP * (BLOCK_COUNT_ROW_LINE - 1) + 10); + public static final int CONTENT_WIDTH = TemplateThemeBlock.CONTENT_WIDTH * BLOCK_COUNT_ROW_LINE + FineUIScale.scale(BLOCK_GAP) * (BLOCK_COUNT_ROW_LINE - 1) + FineUIScale.scale(10); public static final int BLOCK_ROWS_PER_PAGE = 3; - public static final int CONTENT_HEIGHT = FineUIScale.scale(Math.min(527, TemplateThemeBlock.CONTENT_HEIGHT * BLOCK_ROWS_PER_PAGE + BLOCK_GAP * (BLOCK_ROWS_PER_PAGE + 1))); + public static final int CONTENT_HEIGHT = Math.min(FineUIScale.scale(527), TemplateThemeBlock.CONTENT_HEIGHT * BLOCK_ROWS_PER_PAGE + FineUIScale.scale(BLOCK_GAP) * (BLOCK_ROWS_PER_PAGE + 1)); public static final int ASYNC_FETCH_THEME_THREAD_COUNT = 10; private final AsyncThemeFetcher asyncThemeFetcher; @@ -73,7 +74,7 @@ public class TemplateThemeGridPane extends BasicPane { setLayout(FRGUIPaneFactory.createBorderLayout()); setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); - contentListPane.setBorder(BorderFactory.createEmptyBorder(BLOCK_GAP, 0, BLOCK_GAP, 10)); + contentListPane.setBorder(new ScaledEmptyBorder(BLOCK_GAP, 0, BLOCK_GAP, 10)); contentListPane.setLayout(new GridLayout(0, BLOCK_COUNT_ROW_LINE, BLOCK_GAP, BLOCK_GAP)); fillContentListPane(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java index 0a26a6691e..43aedb17e9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.dialog; +import com.fine.theme.utils.FineUIScale; import com.fr.base.theme.TemplateTheme; import com.fr.design.ExtraDesignClassManager; import com.fr.design.gui.ibutton.UIButton; @@ -27,8 +28,8 @@ import java.util.Set; public class TemplateThemeProfileDialog extends TemplateThemeDialog { public static TemplateThemeProfilePane currentVisibleProfilePane; - public static final int CONTENT_WIDTH = 1010; - public static final int CONTENT_HEIGHT = 542; + public static final int CONTENT_WIDTH = FineUIScale.scale(1010); + public static final int CONTENT_HEIGHT = FineUIScale.scale(542); private final TemplateThemeProfilePane profilePane; public TemplateThemeProfileDialog(Window parent, TemplateThemeProfilePane profilePane) { 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 801e7e0ab0..547b5c1d25 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,7 @@ package com.fr.design.mainframe.theme.edit.chart; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; @@ -30,11 +32,11 @@ public abstract class AbstractChartStylePane extends BasicPane { protected void initPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); double labelWidth = 90; - double totalWidth = 155; + double totalWidth = 190; double p = TableLayout.PREFERRED; double[] columnSize = {labelWidth, totalWidth}; JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 5, LayoutConstants.VGAP_LARGE); - gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); + gapTableLayoutPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane); rightTopPane.setBorder(BorderFactory.createEmptyBorder()); this.add(rightTopPane, BorderLayout.CENTER); 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 3ab67f9569..1d1967ad3c 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 @@ -78,7 +78,7 @@ public class ChartFontPane extends BasicPane { protected JPanel getContentPane(JPanel buttonPane) { double labelWidth = 90; - double totalWidth = 155; + double totalWidth = 190; double p = TableLayout.PREFERRED; double[] rows = {p, p, p}; double[] columnSize = {labelWidth, totalWidth}; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java index c94dd6ef22..29c73aedbe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.edit.chart; +import com.fine.theme.utils.FineUIScale; import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIColorButton; @@ -35,6 +36,11 @@ public class ChartLabelStylePane extends AbstractChartStylePane { public String getUILabelText() { return Toolkit.i18nText("Fine-Design_Chart_Label_Character"); } + + @Override + public Dimension getPreferredSize() { + return new Dimension(-1, FineUIScale.scale(100)); + } }; initListener(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java index bc466972ef..dbf13178b8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ui/BreadcrumbBar.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.theme.ui; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.gui.ilable.UILabel; import javax.swing.BorderFactory; @@ -67,15 +69,15 @@ public class BreadcrumbBar extends JPanel { protected Component createSeparator() { UILabel separator = new UILabel("/"); - separator.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); - separator.setPreferredSize(new Dimension(separator.getPreferredSize().width, 17)); + separator.setBorder(new ScaledEmptyBorder(0, 8, 0, 8)); + separator.setPreferredSize(new Dimension(separator.getPreferredSize().width, FineUIScale.scale(17))); return separator; } protected JButton createBreadcrumb(String text) { JButton button = new BreadcrumbButton(text); - button.setPreferredSize(new Dimension(button.getPreferredSize().width, 17)); + button.setPreferredSize(new Dimension(button.getPreferredSize().width, FineUIScale.scale(17))); return button; } diff --git a/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_bottom.svg b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_bottom.svg new file mode 100644 index 0000000000..1e0d3d2418 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_bottom.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_left.svg b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_left.svg new file mode 100644 index 0000000000..b891f37140 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_left.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_right.svg b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_right.svg new file mode 100644 index 0000000000..ae8be3dd5f --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_right.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top.svg b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top.svg new file mode 100644 index 0000000000..7e61c5d786 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top_right.svg b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top_right.svg new file mode 100644 index 0000000000..59bdc90a82 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/layout/layout_top_right.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index 86246c8d82..bef5d2905b 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -406,7 +406,12 @@ "information":"tip/information.svg", "new_information":"tip/new_information.svg", "success":"tip/success.svg", - "warning":"tip/warning.svg" + "warning":"tip/warning.svg", + "layout_top": "layout/layout_top.svg", + "layout_bottom": "layout/layout_bottom.svg", + "layout_left": "layout/layout_left.svg", + "layout_right": "layout/layout_right.svg", + "layout_top_right": "layout/layout_top_right.svg" } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index 6dac8d07dd..635faf5bcb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.style; import com.fine.swing.ui.layout.Column; +import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineUIScale; import com.fr.base.BaseUtils; @@ -186,11 +187,11 @@ public class VanChartPlotLegendPane extends BasicPane { Integer[] valueArray = {Constants.TOP, Constants.BOTTOM, Constants.LEFT, Constants.RIGHT, Constants.RIGHT_TOP}; Icon[] iconArray = { - BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_top.png"), - BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_bottom.png"), - BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_left.png"), - BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_right.png"), - BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_top_right.png") + new LazyIcon("layout_top"), + new LazyIcon("layout_bottom"), + new LazyIcon("layout_left"), + new LazyIcon("layout_right"), + new LazyIcon("layout_top_right") }; location = new UIButtonGroup(iconArray, valueArray); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index cc5199d3c2..f2d9ac838f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.style; import com.fine.theme.utils.FineComponentsFactory; +import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; import com.fr.base.BaseFormula; import com.fr.base.Utils; @@ -51,9 +52,9 @@ import static com.fine.swing.ui.layout.Layouts.row; public class VanChartTitlePane extends AbstractVanChartScrollPane { private static final long serialVersionUID = -2438898431228882682L; - private static final int WIDTH = 165; - private static final int HEIGHT = 100; - private static final int GAP = 20; + private static final int WIDTH = FineUIScale.scale(165); + private static final int HEIGHT = FineUIScale.scale(100); + private static final int GAP = FineUIScale.scale(20); private UICheckBox isTitleVisible; private JPanel titlePane; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index dfc234f61d..deb4779e4b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -9,6 +9,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; @@ -46,7 +47,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIButtonGroup position; private UIButtonGroup autoAdjust; private UIButtonGroup orientation; - private UIToggleButton tractionLine; + private UICheckBox tractionLine; private ColorSelectBox backgroundColor; private VanChartBorderWithShapePane borderPane; @@ -242,8 +243,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } if (plot.isSupportLeadLine()) { - tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); - panel.add(tractionLine, BorderLayout.SOUTH); + tractionLine = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); + Component[][] comps = new Component[1][2]; + comps[0] = new Component[]{new UILabel(), tractionLine}; + + double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; + double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; + getLabelPositionPane(comps, row, col); + panel.add(getLabelPositionPane(comps, row, col), BorderLayout.SOUTH); initPositionListener(); } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { panel.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, diff --git a/designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java b/designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java index 99d6e57b7e..b3839ef004 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java @@ -9,8 +9,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.widget.CellWidgetCardPane; -import com.fr.design.widget.EastCellWidgetCardPane; -import com.fr.design.widget.WidgetManageCardPane; +import com.fr.design.widget.FloatWidgetManageCardPane; import com.fr.design.widget.WidgetPane; import com.fr.form.ui.*; @@ -48,7 +47,7 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane paneList; - private BaseLayoutContainer tabsHeaderIconPane; + protected BaseLayoutContainer tabsHeaderIconPane; private BasicWidgetPropertySettingPane widgetPropertyPane; //通用属性容器 @@ -55,6 +55,10 @@ public class CellWidgetCardPane extends BasicPane { private ElementCasePane pane; + protected JPanel center; + + protected CardLayout tabbedPane; + public CellWidgetCardPane(ElementCasePane pane) { this.pane = pane; } diff --git a/designer-realize/src/main/java/com/fr/design/widget/EastCellWidgetCardPane.java b/designer-realize/src/main/java/com/fr/design/widget/EastCellWidgetCardPane.java index 0ed6faa17c..5a33ec6c63 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/EastCellWidgetCardPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/EastCellWidgetCardPane.java @@ -19,12 +19,6 @@ import java.awt.Component; */ public class EastCellWidgetCardPane extends CellWidgetCardPane { - private CardLayout tabbedPane; - - private JPanel center; - - private UIHeadGroup tabsHeaderIconPane; - public EastCellWidgetCardPane(ElementCasePane pane) { super(pane); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java b/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java new file mode 100644 index 0000000000..be73821840 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java @@ -0,0 +1,23 @@ +package com.fr.design.widget; + +import com.fr.design.mainframe.ElementCasePane; + +/** + * @author Renekton + * @since on 2024/08/16 + * Created on 2024/08/16 + */ +public class FloatWidgetManageCardPane extends EastCellWidgetCardPane { + + /** + * 悬浮窗控件管理 + */ + public FloatWidgetManageCardPane(ElementCasePane pane) { + super(pane); + } + + @Override + protected WidgetEventPane initWidgetEventPane(ElementCasePane pane){ + return new WidgetEventPaneNoPop(pane); + } +} From 0e08cf1fbedaa8e7fcc0b21ff356a3f289fc40c0 Mon Sep 17 00:00:00 2001 From: renekton Date: Fri, 16 Aug 2024 19:07:17 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E5=85=83?= =?UTF-8?q?=E7=B4=A0-=E6=95=B0=E6=8D=AE=E5=88=97-=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E6=9C=AA=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/condition/DSColumnLiteConditionPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/condition/DSColumnLiteConditionPane.java b/designer-base/src/main/java/com/fr/design/condition/DSColumnLiteConditionPane.java index 6ae84c14cb..cee0410a95 100644 --- a/designer-base/src/main/java/com/fr/design/condition/DSColumnLiteConditionPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/DSColumnLiteConditionPane.java @@ -123,12 +123,12 @@ public class DSColumnLiteConditionPane extends LiteConditionPane Date: Fri, 16 Aug 2024 19:33:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/theme/edit/chart/ChartLabelStylePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java index 29c73aedbe..8892b0d0d4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java @@ -39,7 +39,7 @@ public class ChartLabelStylePane extends AbstractChartStylePane { @Override public Dimension getPreferredSize() { - return new Dimension(-1, FineUIScale.scale(100)); + return new Dimension(super.getPreferredSize().width, FineUIScale.scale(100)); } }; initListener(); From da67399d434cc25ec778919cc670d6e59eb50038 Mon Sep 17 00:00:00 2001 From: renekton Date: Sat, 17 Aug 2024 16:01:18 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=BE=B9=E6=A1=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/SaveSomeTemplatePane.java | 8 ++- .../design/gui/controlpane/UIControlPane.java | 9 +-- .../controlpane/UIListGroupControlPane.java | 15 +++-- .../fr/design/gui/date/UICalendarPanel.java | 44 ++++++++------ .../javascript/Commit2DBJavaScriptPane.java | 14 ++++- .../ImageBackgroundQuickPane.java | 4 +- .../DBManipulationInWidgetEventPane.java | 19 ++++-- .../write/submit/DBManipulationPane.java | 59 +++++++++++-------- .../designer/component/LineTypeComboBox.java | 8 ++- .../widget/FloatWidgetManageCardPane.java | 1 + ...InsertDBManipulationInWidgetEventPane.java | 14 +++-- 11 files changed, 122 insertions(+), 73 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index de8ca831d9..8ee5c61fb2 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -1,5 +1,7 @@ package com.fr.design.file; +import com.fine.theme.light.ui.FineRoundBorder; +import com.formdev.flatlaf.util.SystemInfo; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; @@ -8,6 +10,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; +import com.fr.design.gui.iscrollbar.UIScrollBarUI; import com.fr.design.gui.itree.checkboxtree.NullTristateCheckBox; import com.fr.design.gui.itree.checkboxtree.TristateCheckBox; import com.fr.design.layout.FRGUIPaneFactory; @@ -81,13 +84,16 @@ public class SaveSomeTemplatePane extends BasicPane { this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); + scrollPane.setBorder(new FineRoundBorder()); + if (SystemInfo.isWindows) { + scrollPane.getVerticalScrollBar().setUI(new UIScrollBarUI()); + } this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } private void initTemplatesChoosePane(boolean judgeJTemplateMustSave) { - templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index cb305f9cc4..890fc5885d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -49,6 +49,7 @@ import java.awt.event.WindowEvent; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.theme.utils.FineUIScale.scale; /** * Created by plough on 2017/7/21. @@ -199,7 +200,7 @@ public abstract class UIControlPane extends JControlPane { PopupEditDialog(JComponent pane) { super(DesignerContext.getDesignerFrame()); setUndecorated(true); - pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + pane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); this.editPane = pane; JPanel editPaneWrapper = new JPanel(new BorderLayout()); popupToolPane = new PopupToolPane(this); @@ -207,7 +208,7 @@ public abstract class UIControlPane extends JControlPane { editPaneWrapper.add(editPane, BorderLayout.CENTER); editPaneWrapper.setBorder(BorderFactory.createLineBorder(UIConstants.POP_DIALOG_BORDER, 1)); this.getContentPane().add(editPaneWrapper, BorderLayout.CENTER); - setSize(FineUIScale.scale(new Dimension(WIDTH, HEIGHT))); + setSize(scale(new Dimension(WIDTH, HEIGHT))); this.setVisible(false); initListener(); } @@ -375,7 +376,7 @@ public abstract class UIControlPane extends JControlPane { titleLabel = new UILabel(title); FineUIStyle.setStyle(titleLabel, FineUIStyle.LABEL_BOLD); contentPane.add(titleLabel, BorderLayout.WEST); - contentPane.setBorder(new EmptyBorder(5, 14, 6, 0)); + contentPane.setBorder(new ScaledEmptyBorder(5, 14, 6, 0)); setLayout(new BorderLayout()); add(contentPane, BorderLayout.CENTER); @@ -391,7 +392,7 @@ public abstract class UIControlPane extends JControlPane { @Override public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, 28); + return new Dimension(super.getPreferredSize().width, scale(28)); } } } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index e1a507b55c..547900386b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -44,6 +44,10 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.theme.utils.FineUIScale.scale; + /** * Created by kerry on 5/31/21 */ @@ -84,7 +88,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li @Override protected JPanel getLeftTopPane(UIToolbar topToolBar) { UIToolbar toolbar = getTopToolBar(); - toolbar.setPreferredSize(FineUIScale.scale(new Dimension(160, 24))); + toolbar.setPreferredSize(scale(new Dimension(160, 24))); return super.getLeftTopPane(topToolBar); } @@ -555,13 +559,12 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li super.paint(g); } }; - label.setBorder(BorderFactory.createMatteBorder(0, 0, FineUIScale.scale(1), 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); + label.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); - label.setFont(label.getFont().deriveFont(11F)); - label.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(24))); + label.setFont(label.getFont().deriveFont(scale(11F))); + label.setPreferredSize(new Dimension(this.getPreferredSize().width, scale(24))); this.nameEdList = nameEdList; - this.add(label, BorderLayout.NORTH); - this.add(this.nameEdList, BorderLayout.CENTER); + this.add(column(cell(label), cell(this.nameEdList)).getComponent()); } public UINameEdList getNameEdList() { diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java b/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java index 4532dfdeb4..18f44a0e6a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java @@ -58,10 +58,16 @@ import java.util.Set; import static com.fine.theme.utils.FineUIScale.scale; public class UICalendarPanel extends JPanel { - private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12); - private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, 12); + private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(scale(12)); + private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, scale(12)); private static final int WEEKDAY_COUNT = 7; private static final int TOTAL_DAYS_COUNT = 42; + + private static final int WIDTH = scale(31); + private static final int HEIGHT = scale(19); + private static final int START_X = scale(30); + private static final int START_Y = scale(19); + //卡顿日志所在地址 private static final String JOURNAL_FILE_PATH = StableUtils.pathJoin(ProductConstantsBase.getEnvHome(), "journal_log"); protected Color selectedBackground; @@ -432,7 +438,7 @@ public class UICalendarPanel extends JPanel { gp.setBorder(null); UIDayLabel label = new UIDayLabel(setupCalendar.getTime()); label.setHorizontalAlignment(SwingConstants.RIGHT); - label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 9)); + label.setBorder(new ScaledEmptyBorder(0, 0, 0, 9)); if ("1".equals(label.getText())) { isCurrentMonth = !isCurrentMonth; } @@ -655,12 +661,12 @@ public class UICalendarPanel extends JPanel { public void paint(Graphics g) { super.paint(g); - int width = 31; - int height = 19; + int width = UICalendarPanel.WIDTH; + int height = UICalendarPanel.HEIGHT; Color oldColor = g.getColor(); g.setColor(new Color(0xDADADA)); - int start_x = 30; - int start_y = 19; + int start_x = UICalendarPanel.START_X; + int start_y = UICalendarPanel.START_Y; for (int i = 0; i < 6; i++) { g.drawLine(start_x, 0, start_x, getHeight()); start_x += width; @@ -683,19 +689,19 @@ public class UICalendarPanel extends JPanel { private void paintChindPane(Graphics g, int index) { if (index % 7 == 0) { - int y1 = index / 7 * 19; - g.drawLine(0, y1, 30, y1); - g.drawLine(0, y1 + 19, 30, y1 + 19); - g.drawLine(30, y1, 30, y1 + 19); + int y1 = index / 7 * UICalendarPanel.HEIGHT; + g.drawLine(0, y1, UICalendarPanel.START_X, y1); + g.drawLine(0, y1 + UICalendarPanel.HEIGHT, UICalendarPanel.START_X, y1 + UICalendarPanel.HEIGHT); + g.drawLine(UICalendarPanel.START_X, y1, UICalendarPanel.START_X, y1 + UICalendarPanel.HEIGHT); } else if (index % 7 == 6) { - int y1 = index / 7 * 19; - g.drawLine(185, y1, 216, y1); - g.drawLine(185, y1 + 19, 216, y1 + 19); - g.drawLine(185, y1, 185, y1 + 19); + int y1 = index / 7 * UICalendarPanel.HEIGHT; + g.drawLine(scale(185), y1, scale(216), y1); + g.drawLine(scale(185), y1 + UICalendarPanel.HEIGHT, scale(216), y1 + UICalendarPanel.HEIGHT); + g.drawLine(scale(185), y1, scale(185), y1 + UICalendarPanel.HEIGHT); } else { - int x1 = index % 7 * 31 - 1; - int y1 = index / 7 * 19; - g.drawRect(x1, y1, 31, 19); + int x1 = index % 7 * UICalendarPanel.WIDTH - 1; + int y1 = index / 7 * UICalendarPanel.HEIGHT; + g.drawRect(x1, y1, UICalendarPanel.WIDTH, UICalendarPanel.HEIGHT); } } @@ -833,7 +839,7 @@ public class UICalendarPanel extends JPanel { uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setBackground(null); uiLabel.setBorder(null); - uiLabel.setPreferredSize(new Dimension(6, 10)); + uiLabel.setPreferredSize(scale(new Dimension(6, 10))); return uiLabel; } 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 e5100b54b3..a475fa1cdb 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 @@ -1,8 +1,10 @@ package com.fr.design.javascript; +import com.fine.theme.utils.FineUIScale; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.gui.frpane.CommitTabbedPane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.write.submit.DBManipulationPane; import com.fr.js.Commit2DBJavaScript; @@ -15,6 +17,9 @@ import java.awt.Dimension; import java.util.ArrayList; import java.util.List; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.cell; + public class Commit2DBJavaScriptPane extends FurtherBasicBeanPane { private List dbmPaneList = new ArrayList(); private CommitTabbedPane commitTabbedPane; @@ -50,13 +55,18 @@ public class Commit2DBJavaScriptPane extends FurtherBasicBeanPane { // peter:编辑的TablePane JPanel editTablePane = new JPanel(new BorderLayout(FineUIScale.scale(10), 0)); - editTablePane.setBounds(0, 0, FineUIScale.scale(280), FineUIScale.scale(180)); + Dimension editTableDimension = createEditTablePreferredSize(); + editTablePane.setBounds(0, 0, editTableDimension.width, editTableDimension.height); keyColumnValuesTable = new KeyColumnNameValueTable(); editTablePane.add(new UIScrollPane(keyColumnValuesTable), BorderLayout.CENTER); keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); @@ -180,18 +181,15 @@ public class DBManipulationPane extends BasicBeanPane { cell(FineUIUtils.wrapComponentWithTitle(chooseTable, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table")))) .getComponent()); JPanel bottomPane = initBottomPane(); - this.add(new AttrScrollPane() { - @Override - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - contentPane.add(column(10, - cell(northPane), - cell(FineUIUtils.wrapComponentWithTitle(editTablePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))), - cell(bottomPane)) - .getComponent(), BorderLayout.CENTER); - return contentPane; - } - }); + + JPanel contentPane = new JPanel(new BorderLayout()); + contentPane.add(column(10, + cell(northPane), + cell(FineUIUtils.wrapComponentWithTitle(editTablePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))), + cell(bottomPane)) + .getComponent(), BorderLayout.CENTER); + + this.add(new UIScrollPane(contentPane)); initJTableColumn(); @@ -264,17 +262,17 @@ public class DBManipulationPane extends BasicBeanPane { UpdateCheckBox.setEnabled(b); } - private JPanel initBottomPane() { + protected JPanel initBottomPane() { JPanel eventPane = new JPanel(new BorderLayout()); eventPane.setPreferredSize(createControlBtnPanePreferredSize()); - eventPane.add(addEventButton(), BorderLayout.WEST); + eventPane.add(addEventButton()); JPanel conditionPane = this.createConditionPane(); JPanel btPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); btPane.add(column(5, cell(FineUIUtils.wrapComponentWithTitle(conditionPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))), - cell(eventPane) + row(cell(eventPane), cell(new UILabel())) ).getComponent()); return btPane; } @@ -315,8 +313,8 @@ public class DBManipulationPane extends BasicBeanPane { DefaultTreeCellRenderer cr = (DefaultTreeCellRenderer) conditionsTree.getCellRenderer(); cr.setForeground(UIConstants.NORMAL_BACKGROUND); JScrollPane jp = new JScrollPane(conditionsTree); - jp.setPreferredSize(FineUIScale.scale(new Dimension(0, 40))); - addComponent(conditionPane, jp); + jp.setPreferredSize(createJpPreferredSize()); + jp.setVisible(setJpVisible()); String submitCondition = Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition"); UIButton addSubmitConditionButton = new UIButton(submitCondition); addSubmitConditionButton.setToolTipText(submitCondition); @@ -354,12 +352,11 @@ public class DBManipulationPane extends BasicBeanPane { }); JPanel controlBtnPane = new JPanel(new BorderLayout()); - controlBtnPane.setPreferredSize(FineUIScale.scale(new Dimension(122, 20))); + controlBtnPane.setPreferredSize(createControlBtnPanePreferredSize()); controlBtnPane.add(addSubmitConditionButton, BorderLayout.NORTH); - conditionPane.add(row( - cell(jp).weight(1.0), - cell(new Spacer(122).add(controlBtnPane)) - ).getComponent()); + conditionPane.setPreferredSize(createConditionPanePreferredSize()); + conditionPane.add(controlBtnPane, setControlBtnPanePosition()); + conditionPane.add(jp, BorderLayout.CENTER); return conditionPane; } @@ -372,13 +369,25 @@ public class DBManipulationPane extends BasicBeanPane { mainPane.add(addPane, BorderLayout.CENTER); } + protected Dimension createEditTablePreferredSize() { + return FineUIScale.scale(new Dimension(280, 180)); + } protected Dimension createConditionPanePreferredSize() { - return FineUIScale.scale(new Dimension(454, 80)); + return FineUIScale.scale(new Dimension(454, 60)); + } + + protected boolean setJpVisible() { + return true; } + protected Dimension createJpPreferredSize() { + return FineUIScale.scale(new Dimension(280, 60)); + } + + protected Dimension createControlBtnPanePreferredSize() { - return new Dimension(110, 20); + return FineUIScale.scale(new Dimension(110, 20)); } protected String setControlBtnPanePosition() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java index 395d615926..bb9c858760 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java @@ -14,6 +14,8 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; +import static com.fine.theme.utils.FineUIScale.scale; + /** * Created by shine on 2019/08/30. */ @@ -47,10 +49,10 @@ public class LineTypeComboBox extends UIComboBox { switch (this.lineType) { case SOLID: - GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2); + GraphHelper.drawLine(g2d, scale(4), d.height / 2, d.width - scale(8), d.height / 2); break; case DASHED: - GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2, Constants.LINE_DASH); + GraphHelper.drawLine(g2d, scale(4), d.height / 2, d.width - scale(8), d.height / 2, Constants.LINE_DASH); break; default: break; @@ -59,7 +61,7 @@ public class LineTypeComboBox extends UIComboBox { } public Dimension getPreferredSize() { - return new Dimension(60, 16); + return scale(new Dimension(60, 16)); } public Dimension getMinimumSize() { diff --git a/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java b/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java index be73821840..4a060a9a89 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java @@ -11,6 +11,7 @@ public class FloatWidgetManageCardPane extends EastCellWidgetCardPane { /** * 悬浮窗控件管理 + * @param pane 面板 */ public FloatWidgetManageCardPane(ElementCasePane pane) { super(pane); diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationInWidgetEventPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationInWidgetEventPane.java index 28a35ef2fd..476c664fe0 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationInWidgetEventPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationInWidgetEventPane.java @@ -1,5 +1,7 @@ package com.fr.design.write.submit; +import com.fine.theme.utils.FineUIScale; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import javax.swing.*; @@ -17,19 +19,19 @@ public class SmartInsertDBManipulationInWidgetEventPane extends SmartInsertDBMan super(ePane); } - protected void setBorderAndLayout(JPanel jPanel){ - jPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); - } - protected void addComponent(JPanel mainPane,JScrollPane addPane){ } protected Dimension createConditionPanePreferredSize(){ - return new Dimension(454, 30); + return FineUIScale.scale(new Dimension(454, 20)); + } + + protected boolean setJpVisible() { + return false; } protected Dimension createControlBtnPanePreferredSize(){ - return new Dimension(92, 20); + return FineUIScale.scale(new Dimension(110, 20)); } protected String setControlBtnPanePosition(){ From b40ffe183acaf81343321c8289b7661770a886b2 Mon Sep 17 00:00:00 2001 From: renekton Date: Sat, 17 Aug 2024 16:13:15 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=BE=B9=E6=A1=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/widget/FloatWidgetManageCardPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java b/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java index 4a060a9a89..a687dd1d1d 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/FloatWidgetManageCardPane.java @@ -3,6 +3,7 @@ package com.fr.design.widget; import com.fr.design.mainframe.ElementCasePane; /** + * 悬浮窗内嵌控件面板 * @author Renekton * @since on 2024/08/16 * Created on 2024/08/16 From fa14e20e37b0cea1d8fedd3bbbf87ab17754f444 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Sat, 17 Aug 2024 16:33:44 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-130919=20&=20REPORT-130916=20&=20REP?= =?UTF-8?q?ORT-130911=20&REPORT-130847=20&=20REPORT-130831=20&=20REPORT-13?= =?UTF-8?q?0830=20&=20REPORT-130756=20&=20REPORT-130707=20&=20REPORT-13026?= =?UTF-8?q?3=20fix:=E3=80=90NewUI=E3=80=91=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/CloseCurrentTemplateAction.java | 2 + .../fr/design/actions/file/EditEnvAction.java | 2 + .../actions/file/ExitDesignerAction.java | 2 + .../design/actions/file/PreferenceAction.java | 2 + .../fr/design/actions/help/AboutAction.java | 4 +- .../fr/design/border/FineBorderFactory.java | 8 +++ .../data/datapane/TableDataComboBox.java | 14 +++-- .../java/com/fr/design/dialog/BasicPane.java | 19 +++--- .../controlpane/UIListGroupControlPane.java | 13 ++-- .../design/gui/frpane/JTreeControlPane.java | 22 +++++-- .../fr/design/gui/frpane/TreeSettingPane.java | 24 ++++---- .../layer/config/LayerDataControlPane.java | 5 +- .../com/fr/design/gui/ilist/JNameEdList.java | 3 +- .../com/fr/design/gui/style/FormatPane.java | 1 + .../theme/ThemedCellStyleListPane.java | 3 +- .../design/present/dict/FormulaDictPane.java | 61 +++++++------------ .../com/fr/design/scrollruler/BaseRuler.java | 3 +- .../java/com/fr/design/style/FRFontPane.java | 49 ++++++--------- .../fr/design/style/FontSizeStylePane.java | 35 +++++------ .../fine/theme/light/ui/fine_light.icon.json | 42 ++++++++++--- .../design/mainframe/ChartPropertyPane.java | 2 +- .../component/GanttTableDataProjectPane.java | 2 +- .../component/TinyFormulaWithButtonPane.java | 2 +- .../model/DesensitizationCellPane.java | 4 +- .../cell/settingpane/style/StylePane.java | 7 ++- 25 files changed, 187 insertions(+), 144 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java index 22263a871e..041852857b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java @@ -7,6 +7,7 @@ import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; /** @@ -21,6 +22,7 @@ public class CloseCurrentTemplateAction extends UpdateAction { this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setAccelerator(getMenuKeySet().getKeyStroke()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java b/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java index d007e315fe..0d920a5230 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java @@ -5,6 +5,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.JTemplate; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; @@ -13,6 +14,7 @@ public class EditEnvAction extends UpdateAction { public EditEnvAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Others") + "..."); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java b/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java index 5925e250f4..0e395da9fe 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java @@ -5,6 +5,7 @@ package com.fr.design.actions.file; import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.mainframe.TemplateSavingChecker; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; import com.fr.design.actions.UpdateAction; @@ -22,6 +23,7 @@ public class ExitDesignerAction extends UpdateAction { this.setMenuKeySet(KeySetUtils.EXIT_DESIGNER); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java index dd48e26841..d571d60f34 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java @@ -11,6 +11,7 @@ import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; @@ -20,6 +21,7 @@ public class PreferenceAction extends UpdateAction { this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.generateAndSetSearchText(PreferencePane.class.getName()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java index 4dcc53a13c..8bf83e78c1 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java @@ -8,7 +8,8 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.MenuKeySet; -import javax.swing.*; +import com.fr.general.IOUtils; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; /** @@ -19,6 +20,7 @@ public class AboutAction extends UpdateAction { this.setMenuKeySet(ABOUT); this.setName(getMenuKeySet().getMenuKeySetName()+"..."); this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java b/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java index ea6d12c7ba..422e002f33 100644 --- a/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java +++ b/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java @@ -68,4 +68,12 @@ public class FineBorderFactory { ); } + /** + * 创建具有padding的边框 + * @return 边框 + */ + public static Border createBorderWithPadding(Border border) { + return BorderFactory.createCompoundBorder(border, new ScaledEmptyBorder(0, 6, 0, 0) + ); + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java index ebbdbf0f35..3db9c3aff1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java @@ -11,7 +11,6 @@ import javax.swing.JList; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.data.TableDataSource; import com.fr.design.data.tabledata.Prepare4DataSourceChange; @@ -48,14 +47,15 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel renderer = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value instanceof TableDataWrapper) { + if (index == -1 && value == null) { + // 显示空白 + renderer.setIcon(null); + renderer.setText(StringUtils.EMPTY); + }else if (value instanceof TableDataWrapper) { TableDataWrapper tabledatawrappe = (TableDataWrapper)value; renderer.setIcon(tabledatawrappe.getIcon()); renderer.setText(tabledatawrappe.getTableDataName()); renderer.setToolTipText(tabledatawrappe.getTableDataName()); - } else { - renderer.setIcon(null); - renderer.setText(StringUtils.EMPTY); } return renderer; } @@ -75,7 +75,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC setDsMap(); DefaultComboBoxModel model = new DefaultComboBoxModel(); this.setModel(model); - model.addElement(UIConstants.PENDING); + // 遍历添加所有数据项到模型 Iterator> entryIt = dsMap.entrySet().iterator(); while (entryIt.hasNext()) { TableDataWrapper tableDataWrapper = entryIt.next().getValue(); @@ -83,6 +83,8 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC model.addElement(tableDataWrapper); } } + // 设置默认选项为空白 + this.setSelectedItem(null); if (dataWrapper != null) { if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) { this.setSelectedTableDataByName(DesignTableDataManager.getChangedDsNameByOldDsName(dataWrapper.getTableDataName())); diff --git a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java index 1da3e34e0c..ec36eb65e1 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java @@ -14,9 +14,9 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import javax.swing.event.DocumentEvent; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Dialog; import java.awt.Dimension; import java.awt.Frame; @@ -164,12 +164,17 @@ public abstract class BasicPane extends JPanel { dg = new DIALOG((Dialog) window); } - if (l != null) { - dg.addDialogActionListener(l); - } - dg.setBasicDialogSize(dimension); - GUICoreUtils.centerWindow(dg); - dg.setResizable(false); + SwingUtilities.invokeLater(() -> { + if (l != null) { + dg.addDialogActionListener(l); + } + dg.setBasicDialogSize(dimension); + GUICoreUtils.centerWindow(dg); + dg.setResizable(false); + dg.setVisible(true); + dg.toFront(); + dg.requestFocus(); + }); return dg; } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index 547900386b..0e06bcd344 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -33,7 +33,13 @@ import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.BorderLayout; +import java.awt.AlphaComposite; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.lang.reflect.Constructor; @@ -559,7 +565,8 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li super.paint(g); } }; - label.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); + + label.setBorder(BorderFactory.createMatteBorder(scale(1), 0, scale(1), 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); label.setFont(label.getFont().deriveFont(scale(11F))); label.setPreferredSize(new Dimension(this.getPreferredSize().width, scale(24))); @@ -572,6 +579,4 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li } } - - } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java index 342221fd20..e5e765510b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane; +import com.fine.theme.icon.LazyIcon; import com.fr.base.BaseUtils; import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeWrapper; @@ -16,17 +17,26 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.ToolBarDef; -import com.fr.form.ui.TreeEditor; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; -import javax.swing.*; +import javax.swing.JPanel; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; -import javax.swing.tree.*; -import java.awt.*; +import javax.swing.JTree; +import javax.swing.BorderFactory; +import javax.swing.JOptionPane; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.DefaultTreeCellRenderer; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Component; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; @@ -178,7 +188,7 @@ public class JTreeControlPane extends ControlPane { this.creator = creators[0]; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); this.setMnemonic('A'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + this.setSmallIcon(new LazyIcon("add")); } public void actionPerformed(ActionEvent e) { @@ -209,7 +219,7 @@ public class JTreeControlPane extends ControlPane { public RemoveTreeNodeAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setMnemonic('R'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(new LazyIcon("remove")); } public void actionPerformed(ActionEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java index b187a8bfa0..25e0f44b37 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java @@ -1,7 +1,7 @@ package com.fr.design.gui.frpane; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.data.impl.TableDataDictionary; -import com.fr.data.impl.TreeAttr; import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeWrapper; import com.fr.design.data.DataCreatorUI; @@ -13,17 +13,18 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.TreeDataCardPane; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.form.ui.TreeComboBoxEditor; -import com.fr.form.ui.TreeEditor; import com.fr.form.ui.tree.LayerConfig; import com.fr.general.NameObject; -import javax.swing.*; -import java.awt.*; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.Arrays; +import javax.swing.JPanel; +import javax.swing.JComponent; +import java.awt.BorderLayout; + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; +import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; public class TreeSettingPane extends BasicPane implements DataCreatorUI { /** @@ -58,19 +59,18 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel buildWayPanel = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); - buildWayPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - UILabel buildWayLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Way") + " :"); - buildWayPanel.add(buildWayLabel); + UILabel buildWayLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Way")); buildBox = new UIComboBox(buildWay); buildBox.addItemListener(e -> { cardChanged(buildBox.getSelectedIndex()); }); - buildWayPanel.add(buildBox); + buildWayPanel.add(row(20, cell(buildWayLabel), cell(buildBox).with(it -> it.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX))).getComponent()); controlPane = new JTreeControlPane(new NameableCreator[]{treeNode}, new TreeDataCardPane()); autoBuildPane = new JTreeAutoBuildPane(); layerDataControlPane = new LayerDataControlPane(); + buildWayPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); this.add(buildWayPanel, BorderLayout.NORTH); cardChanged(0); } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java index 1bf9d604fc..b24964f1cc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane.tree.layer.config; +import com.fine.theme.icon.LazyIcon; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.FineJOptionPane; @@ -146,7 +147,7 @@ public class LayerDataControlPane extends ControlPane { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); this.setMnemonic('A'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + this.setSmallIcon(new LazyIcon("add")); } public void actionPerformed(ActionEvent e) { @@ -173,7 +174,7 @@ public class LayerDataControlPane extends ControlPane { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setMnemonic('R'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(new LazyIcon("remove")); } public void actionPerformed(ActionEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java index f4c3cfe920..4c9135e151 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ilist; +import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.NameInspector; import com.fr.design.gui.itextfield.UITextField; import com.fr.general.GeneralUtils; @@ -256,7 +257,7 @@ public class JNameEdList extends UIList implements CellEditorListener { } public int getIconWidth() { - return ICON_WIDTH; + return FineUIScale.scale(ICON_WIDTH); } public Rectangle createRect(Rectangle rect, int iconWidth) { diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index d26cf47e61..8ab812e9dc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -129,6 +129,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse Component[][] components = getComponent(fontPane, centerPane, typePane); this.add(createContentPane(components), BorderLayout.CENTER); + centerPane.setVisible(!isTextOrNull()); } protected JPanel createContentPane (Component[][] components) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java index 760e53f3bf..f89e4104b0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.theme; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyle; @@ -145,7 +146,7 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane { - private static final int EDITOR_COLUMN = 15; - private static final int LEFT_BORDER = 5; - private static final int MAX_WIDTH = 30; private FormulaEditor keyFormulaEditor; private FormulaEditor valueFormulaEditor; @@ -32,45 +31,27 @@ public class FormulaDictPane extends FurtherBasicBeanPane { private void initComponents() { keyFormulaEditor = new FormulaEditor(); - keyFormulaEditor.setColumns(EDITOR_COLUMN); - JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0)); - keyFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER)); - Icon icon = new LazyIcon("formula"); - keyFormulaContainer.add(new JLabel(icon)); - keyFormulaContainer.add(keyFormulaEditor); - valueFormulaEditor = new FormulaEditor(); - valueFormulaEditor.setColumns(EDITOR_COLUMN); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + // html多行提示待优化 UILabel tag = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_Dictionary_Display_Examples_Html")); tag.setForeground(new Color(143, 143, 146)); - JPanel t = new JPanel(new BorderLayout()); - t.add(tag, BorderLayout.CENTER); BaseFormula vf = BaseFormula.createFormulaBuilder().build("$$$"); valueFormulaEditor = new FormulaEditor(StringUtils.EMPTY, vf); - - JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0)); - valueFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER)); - valueFormulaContainer.add(new JLabel(icon)); - valueFormulaContainer.add(valueFormulaEditor); - - Component[][] components = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), MAX_WIDTH, UILabel.LEFT), keyFormulaContainer}, - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), MAX_WIDTH, UILabel.LEFT), valueFormulaContainer}, - new Component[]{tag, null} - }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); - + JPanel panel = column(LayoutConstants.VERTICAL_GAP, + row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"))).weight(1), + row(cell(new JLabel(new LazyIcon("formula"))), fix(4), cell(keyFormulaEditor).weight(1)).weight(2) + ), + row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"))).weight(1), + row(cell(new JLabel(new LazyIcon("formula"))), fix(4), cell(valueFormulaEditor).weight(1)).weight(2) + ), + cell(tag) + ).getComponent(); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); - } public void addChangeListener(DocumentListener l) { diff --git a/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java b/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java index 770c7b2372..cfdfdd488d 100644 --- a/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java +++ b/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java @@ -1,5 +1,6 @@ package com.fr.design.scrollruler; +import com.fine.theme.utils.FineUIScale; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; @@ -100,7 +101,7 @@ public abstract class BaseRuler extends JComponent { protected abstract RulerUI getRulerUI(); public Dimension getPreferredSize() { - return new Dimension(_WIDTH, _HEIGHT); + return FineUIScale.scale(new Dimension(_WIDTH, _HEIGHT)); } // class RulerUnitItem extends UICheckBoxMenuItem { diff --git a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java index 23a6364f3b..091cedaeeb 100644 --- a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java @@ -209,35 +209,7 @@ public class FRFontPane extends BasicPane { */ public void populate(FRFont frFont) { - this.fontNameComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updatePreviewLabel(); - } - }); - - this.fontSizeStylePane.fontComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updatePreviewLabel(); - } - }); - - this.fontSizeStylePane.fontSizeComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updatePreviewLabel(); - } - }); - - //foreground. - this.foregroundColorPane.setSelectObject(frFont.getForeground()); - //update frFont. - this.underlineCombo.setSelectedLineStyle(frFont.getUnderline()); - - //effects - this.isStrikethroughCheckBox.setSelected(frFont.isStrikethrough()); - this.isShadowCheckBox.setSelected(frFont.isShadow()); - this.isSuperscriptCheckBox.setSelected(frFont.isSuperscript()); - this.isSubscriptCheckBox.setSelected(frFont.isSubscript()); - + populateFont(frFont); //actionlistner ActionListener updatePreviewActionListener = new ActionListener() { @@ -250,7 +222,7 @@ public class FRFontPane extends BasicPane { this.isSuperscriptCheckBox.addActionListener(updatePreviewActionListener); this.isSubscriptCheckBox.addActionListener(updatePreviewActionListener); -//underline + //underline this.underlineCombo.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { updatePreviewLabel(); @@ -267,6 +239,23 @@ public class FRFontPane extends BasicPane { updatePreviewLabel(); } + private void populateFont(FRFont frFont) { + this.fontNameComboBox.setSelectedItem(frFont.getName()); + // 字体 + this.fontSizeStylePane.populate(frFont); + //foreground. + this.foregroundColorPane.setSelectObject(frFont.getForeground()); + //update frFont. + this.underlineCombo.setSelectedLineStyle(frFont.getUnderline()); + + //effects + this.isStrikethroughCheckBox.setSelected(frFont.isStrikethrough()); + this.isShadowCheckBox.setSelected(frFont.isShadow()); + this.isSuperscriptCheckBox.setSelected(frFont.isSuperscript()); + this.isSubscriptCheckBox.setSelected(frFont.isSubscript()); + } + + /** * Update pane to get new font. */ diff --git a/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java b/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java index 924c1129a1..255d9e2301 100644 --- a/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java +++ b/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java @@ -1,45 +1,33 @@ package com.fr.design.style; - -import javax.swing.Box; -import javax.swing.JList; import javax.swing.JPanel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.FRFont; -import com.fr.design.utils.gui.GUICoreUtils; - 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; public class FontSizeStylePane extends JPanel { - - public UIComboBox fontComboBox; public UIComboBox fontSizeComboBox; + private static final String[] STYLES = { + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Plain"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Italic"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold_Italic")}; + public FontSizeStylePane() { this.init(); } private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - - String[] styles = { - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Plain"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Italic"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold_Italic")}; - - fontComboBox = new UIComboBox(styles); + fontComboBox = new UIComboBox(STYLES); fontSizeComboBox = new UIComboBox(FRFontPane.Font_Sizes); this.add(row( @@ -50,4 +38,13 @@ public class FontSizeStylePane extends JPanel { flex(0.2) ).getComponent()); } + + /** + * Populate + * @param frFont + */ + public void populate(FRFont frFont) { + fontComboBox.setSelectedItem(STYLES[frFont.getStyle()]); + fontSizeComboBox.setSelectedItem(frFont.getSize()); + } } diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index bef5d2905b..8ceab59960 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -76,8 +76,16 @@ "chtFile": "filetree/filetype/chtFile.svg", "classFile": "filetree/filetype/classFile.svg", "cpt_locked": "filetree/filetype/cpt_locked.svg", - "excel_import": "filetree/filetype/excel_import.svg", - "excelFile": "filetree/filetype/excelFile.svg", + "excel_import": { + "normal": "filetree/filetype/excel_import.svg", + "disable": "filetree/filetype/excel_import_disable.svg", + "white": "filetree/filetype/excel_import_white.svg" + }, + "excelFile": { + "normal": "filetree/filetype/excelFile.svg", + "disable": "filetree/filetype/excelFile_disable.svg", + "white": "filetree/filetype/excelFile_white.svg" + }, "flashFile": "filetree/filetype/flashFile.svg", "frm_locked": "filetree/filetype/frm_locked.svg", "fvs_locked": "filetree/filetype/fvs_locked.svg", @@ -88,15 +96,35 @@ "jpgFile": "filetree/filetype/jpgFile.svg", "jsFile": "filetree/filetype/jsFile.svg", "jspFile": "filetree/filetype/jspFile.svg", - "pdfFile": "filetree/filetype/pdfFile.svg", + "pdfFile": { + "normal": "filetree/filetype/pdfFile.svg", + "disable": "filetree/filetype/pdfFile_disable.svg", + "white": "filetree/filetype/pdfFile_white.svg" + }, "pngFile": "filetree/filetype/pngFile.svg", "sqlFile": "filetree/filetype/sqlFile.svg", - "wordFile": "filetree/filetype/wordFile.svg", + "wordFile": { + "normal": "filetree/filetype/wordFile.svg", + "disable": "filetree/filetype/wordFile_disable.svg", + "white": "filetree/filetype/wordFile_white.svg" + }, "xlsFile": "filetree/filetype/xlsFile.svg", "xmlFile": "filetree/filetype/xmlFile.svg", - "csvFile": "filetree/filetype/csvFile.svg", - "svgFile": "filetree/filetype/svgFile.svg", - "txtFile": "filetree/filetype/txtFile.svg", + "csvFile": { + "normal": "filetree/filetype/csvFile.svg", + "disable": "filetree/filetype/csvFile_disable.svg", + "white": "filetree/filetype/csvFile_white.svg" + }, + "svgFile": { + "normal": "filetree/filetype/svgFile.svg", + "disable": "filetree/filetype/svgFile_disable.svg", + "white": "filetree/filetype/svgFile_white.svg" + }, + "txtFile": { + "normal": "filetree/filetype/txtFile.svg", + "disable": "filetree/filetype/txtFile_disable.svg", + "white": "filetree/filetype/txtFile_white.svg" + }, "cellattr": "propertiestab/cellattr.svg", "cellattr_disabled": "propertiestab/cellattr_disabled.svg", "cellattr_selected": "propertiestab/cellattr_selected.svg", diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java index 48ba6f2d5e..1b1eeffded 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java @@ -46,7 +46,7 @@ public class ChartPropertyPane extends BaseChartPropertyPane { this.setLayout(new BorderLayout()); this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); // 外部轮廓大小固定,适配滚动面板 - this.setPreferredSize(new Dimension(getWidth(), FineUIScale.scale(900))); + this.setPreferredSize(new Dimension(getWidth(), FineUIScale.scale(800))); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java index abe44f4461..9dce2aa9a1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java @@ -94,7 +94,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl @Override protected Icon getButtonIcon() { - return new LazyIcon("delete"); + return new LazyIcon("remove"); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java index 9a7911fb17..e424b1f636 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java @@ -31,7 +31,7 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse protected UIObserverListener listener; public TinyFormulaWithButtonPane(String text) { - this(text, new LazyIcon("delete")); + this(text, new LazyIcon("remove")); } public TinyFormulaWithButtonPane(String text, Icon icon) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java index 86852ffd45..cecf40a981 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java @@ -119,8 +119,8 @@ public class DesensitizationCellPane extends BasicBeanPane { private void setInsideBorder(Color borderColor) { ruleButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, borderColor)); - emptyTextField.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, borderColor)); - ruleTextField.setBorder(FineBorderFactory.createDefaultUnderlineBorder()); + emptyTextField.setBorder(FineBorderFactory.createBorderWithPadding(BorderFactory.createMatteBorder(0, 0, 0, 1, borderColor))); + ruleTextField.setBorder(FineBorderFactory.createBorderWithPadding(FineBorderFactory.createDefaultUnderlineBorder())); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java index a287c2ef29..6dd020e555 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java @@ -4,6 +4,7 @@ import com.fine.theme.utils.FineUIScale; import com.fr.base.CellBorderStyle; import com.fr.base.NameStyle; import com.fr.base.Style; +import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; @@ -33,6 +34,9 @@ import java.text.Format; import java.util.ArrayList; import java.util.List; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + public class StylePane extends BasicPane implements UIObserver { public static final String[] FOLLOWING_THEME_STRING_ARRAYS = new String[]{ Toolkit.i18nText("Fine-Design_Style_Follow_Theme"), @@ -158,9 +162,8 @@ public class StylePane extends BasicPane implements UIObserver { JPanel container = new JPanel(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Style_Applying")); uiLabel.setPreferredSize(new Dimension(uiLabel.getPreferredSize().width, FineUIScale.scale(20))); - container.add(uiLabel, BorderLayout.NORTH); nameStyleListPane.setBorder(BorderFactory.createEmptyBorder()); - container.add(nameStyleListPane, BorderLayout.CENTER); + container.add(column(LayoutConstants.VERTICAL_GAP, cell(uiLabel), cell(nameStyleListPane)).getComponent()); return container; }