From 7881d57f7882560064514ed8221882f93385714d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 14:24:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-132601=20fix:=E5=9B=BE=E8=A1=A8=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E9=9D=A2=E6=9D=BF=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartHtmlLabelPane.java | 18 +++--------------- ...nChartHtmlLabelPaneWithBackGroundLabel.java | 10 ++-------- .../designer/style/VanChartTitlePane.java | 9 +++++++-- .../label/VanChartPlotLabelDetailPane.java | 2 +- 4 files changed, 13 insertions(+), 26 deletions(-) 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 ebff936c1c..0c916ef4dd 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 @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.KeyWords; import com.fr.design.gui.autocomplete.AutoCompletion; @@ -13,11 +14,8 @@ 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.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.base.VanChartHtmlLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JComponent; import javax.swing.JPanel; @@ -63,18 +61,13 @@ public class VanChartHtmlLabelPane extends JPanel { UIComponentUtils.setLineWrap(useHtml); useHtml.addChangeListener(e -> checkWidthAndHeightPane()); widthAndHeightPane = createWidthAndHeightPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f}; - double[] rowSize = {p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{createJSContentPane()}, new Component[]{useHtml}, - new Component[]{null, null}, }; - JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); this.setLayout(new BorderLayout()); this.add(contentPane, BorderLayout.NORTH); @@ -152,17 +145,12 @@ public class VanChartHtmlLabelPane extends JPanel { checkHeight(); } }); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomHeight, customHeight}, - new Component[]{null, null} }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } private void checkWidth() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java index 4e29e3c827..6125ed1ed3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java @@ -1,10 +1,8 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; 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.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.Component; @@ -12,16 +10,12 @@ import java.awt.Component; public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelPane { protected JPanel createWidthAndHeightPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - JPanel panel = super.createWidthAndHeightPane(); Component[][] components = new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel}, }; - return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{d, f}); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } } 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 9b1adec3ec..9761c618ba 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,7 +1,6 @@ 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; @@ -46,6 +45,7 @@ import java.awt.event.MouseEvent; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.fix; +import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.theme.utils.FineUIScale.scale; @@ -139,7 +139,12 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT)).weight(1.2), cell(titleContent).weight(3) - )).getComponent(); + ), + row( + flex(1.2), + cell(useHtml).weight(3) + ) + ).getComponent(); return new UIExpandablePane( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), titleContentPane); } 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 ae862a170b..3f1f248a0b 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 @@ -126,7 +126,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { double[] rowSize = getLabelPaneRowSize(plot, p); Component[][] components = getLabelPaneComponents(plot, p, columnSize); - return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0}); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 0}); } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) {