From ceeef6aed275bb73c397675571adf26aebff9021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Wed, 11 Sep 2024 14:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=20=E5=9B=BE=E8=A1=A8=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartBeautyPaneWithGradientBar.java | 14 ++++---------- .../designer/component/VanChartHtmlLabelPane.java | 5 +++-- .../style/label/VanChartGaugeLabelDetailPane.java | 5 ++--- .../label/VanChartPieCategoryLabelDetailPane.java | 12 ++---------- .../van/chart/gauge/VanChartGaugeBeautyPane.java | 15 ++++----------- .../van/chart/gauge/VanChartGaugeSeriesPane.java | 5 ++--- 6 files changed, 17 insertions(+), 39 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java index 9c811d04c0..cdfd92aea5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java @@ -1,11 +1,11 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.chart.base.GradientStyle; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.plugin.chart.type.GradientType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -29,18 +29,12 @@ public class VanChartBeautyPaneWithGradientBar extends VanChartBeautyPane { private JPanel initGradientBarPane() { colorGradient = new FixedGradientBar(4, 140); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{null, colorGradient}, }; - gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - + gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components); + gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); return gradientBarPane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java index 0c916ef4dd..90213ea924 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.base.VanChartHtmlLabel; @@ -69,7 +70,7 @@ public class VanChartHtmlLabelPane extends JPanel { JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); - this.setLayout(new BorderLayout()); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); this.add(contentPane, BorderLayout.NORTH); if (widthAndHeightPane != null) { this.add(widthAndHeightPane, BorderLayout.CENTER); @@ -150,7 +151,7 @@ public class VanChartHtmlLabelPane extends JPanel { new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomHeight, customHeight}, }; - return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 1}); } private void checkWidth() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index cdaa4ec1a9..a50e25d351 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -22,7 +22,6 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -62,7 +61,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { initStyleListener(); - return FineLayoutBuilder.compatibleTableLayout(10, getLabelStyleComponents(plot),new double[]{1.2, 3}); + return FineLayoutBuilder.commonLeftRightLayout(getLabelStyleComponents(plot)); } protected void initStyleListener() { @@ -118,7 +117,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { - return TableLayout4VanChartHelper.createGapTableLayoutPane(title, panel); + return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), panel); } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java index 4c28c78b08..f6fc9b8b06 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java @@ -1,13 +1,11 @@ package com.fr.van.chart.designer.style.label; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.stable.Constants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.pie.style.VanChartPieCategoryLabelContentPane; @@ -40,18 +38,12 @@ public class VanChartPieCategoryLabelDetailPane extends VanChartPlotLabelDetailP UIButtonGroup position = new UIButtonGroup<>(positionName, positionValue); setPosition(position); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p, p}; - double[] col = {f, e}; Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), position}, }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.commonLeftRightLayout(components); } protected void checkPositionPane(String title) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java index 61a1fc5e31..7fa6b47e51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java @@ -1,15 +1,14 @@ package com.fr.van.chart.gauge; +import com.fine.theme.utils.FineLayoutBuilder; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.chart.base.ChartConstants; import com.fr.chart.base.GradientStyle; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.plugin.chart.type.GradientType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -29,24 +28,18 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane { public VanChartGaugeBeautyPane() { super(); this.add(initGradientBarPane(), BorderLayout.SOUTH); - this.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); initListener(); } private JPanel initGradientBarPane() { colorGradient = new FixedGradientBar(4, 140); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{null, colorGradient}, }; - gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components); + gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); colorGradient.updateColor(ChartConstants.GRADIENT_END, ChartConstants.GRADIENT_START); return gradientBarPane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index 60c8bc5c4b..2b3976647a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -27,7 +27,6 @@ import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GradientType; import com.fr.stable.Constants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartFillStylePane; import com.fr.van.chart.designer.style.series.VanChartMultiColorSeriesPane; @@ -172,7 +171,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { } } - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, gaugeLayout); + JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), gaugeLayout); gaugeLayout.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -211,7 +210,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { private JPanel createGaugeStylePane() { JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); - JPanel centerPanel = FineLayoutBuilder.compatibleTableLayout(10, getDiffComponentsWithGaugeStyle(), new double[]{1.2, 3}); + JPanel centerPanel = FineLayoutBuilder.commonLeftRightLayout(getDiffComponentsWithGaugeStyle()); panel.add(centerPanel, BorderLayout.CENTER); if (rotate != null) { JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},