From 408930fa5ad9291c368c8037686f9a43bec16a30 Mon Sep 17 00:00:00 2001 From: renekton Date: Fri, 20 Sep 2024 19:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=83=E5=B1=80=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=BC=B9=E7=AA=97=E7=9A=84=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartFloatPositionPane.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFloatPositionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFloatPositionPane.java index 4276be541e..cd3c02540a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFloatPositionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFloatPositionPane.java @@ -1,11 +1,11 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Chart; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.stable.StringUtils; @@ -13,11 +13,15 @@ import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + /** * 悬浮位置 标题和图例用到 */ public class VanChartFloatPositionPane extends BasicBeanPane { private static final long serialVersionUID = -4773313488161065678L; + private static final int VERTICAL_GAP = 8; private UISpinner floatPosition_x; private UISpinner floatPosition_y; @@ -25,24 +29,21 @@ public class VanChartFloatPositionPane extends BasicBeanPane { this.setLayout(new BorderLayout()); - this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_From_UpLeft")), BorderLayout.CENTER); - - this.add(createCustomFloatPositionPane(), BorderLayout.SOUTH); + this.add(column(VERTICAL_GAP, + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_From_UpLeft"))), + cell(createCustomFloatPositionPane())).getComponent()); } private JPanel createCustomFloatPositionPane(){ floatPosition_x = new UISpinner(0,100,1,0); floatPosition_y = new UISpinner(0,100,1,0); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p,p}; + Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_positionX")+": "),floatPosition_x}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_positionY")+": "),floatPosition_y} }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(VERTICAL_GAP, components, new double[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); } public void setFloatPosition_x(double floatPosition_x) {