From af9e39299b019536f8e356386fee7699e3736f87 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 4 Sep 2024 15:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E6=A0=87-=E6=A0=87?= =?UTF-8?q?=E7=AD=BE-=E8=BE=B9=E6=A1=86=E5=B8=83=E5=B1=80&=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=A1=8C=E9=AB=98=E5=88=97=E5=AE=BD=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/frpane/UnitInputPane.java | 10 +++++----- .../component/border/VanChartBorderWithShapePane.java | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java index 5769fdacfe..415da6f1e8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java @@ -24,6 +24,9 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.math.BigDecimal; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + /** * For input Number. */ @@ -43,16 +46,13 @@ public abstract class UnitInputPane extends BasicPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(""); this.add(centerPane, BorderLayout.CENTER); - centerPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 30)); + centerPane.setLayout(new FlowLayout(FlowLayout.LEFT, 20, 30)); UILabel titleLabel = new UILabel(title + ":"); centerPane.add(titleLabel); // Denny:在对话框中加入JSpinner对象 numberFieldSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, MAX_NUM, 1)); GUICoreUtils.setColumnForSpinner(numberFieldSpinner, 24); - numberFieldSpinner.setPreferredSize(new Dimension(60, 20)); - numberFieldSpinner.setMinimumSize(new Dimension(60, 20)); - centerPane.add(numberFieldSpinner); numberFieldSpinner.addChangeListener(new ChangeListener() { @Override @@ -64,7 +64,7 @@ public abstract class UnitInputPane extends BasicPane { }); unitLabel = new UILabel(""); - centerPane.add(unitLabel); + centerPane.add(row(4, cell(numberFieldSpinner), cell(unitLabel)).getComponent()); } public void setUnitText(String unit) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java index 8e508e810c..504da5ed9f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -27,6 +27,9 @@ import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + public class VanChartBorderWithShapePane extends BasicPane { private static final int RECTANGULAR_INDEX = 0; private static final int DIALOG_INDEX = 1; @@ -68,8 +71,7 @@ public class VanChartBorderWithShapePane extends BasicPane { detailPane = createDetailPane(); - this.add(createLineTypePane(), BorderLayout.CENTER); - this.add(detailPane, BorderLayout.SOUTH); + this.add(column(10, cell(createLineTypePane()), cell(detailPane)).getComponent()); initLineTypeListener(); initLineColorListener(); @@ -137,8 +139,7 @@ public class VanChartBorderWithShapePane extends BasicPane { JPanel panel = new JPanel(new BorderLayout()); - panel.add(center, BorderLayout.CENTER); - panel.add(south, BorderLayout.SOUTH); + panel.add(column(10, cell(center), cell(south)).getComponent()); return panel; }