From de64bbf7a13d7b77a9106bb552d4903dd2e34c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 24 Oct 2024 16:55:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-138445=20fix:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9F=9FUI=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/utils/FineComponentsFactory.java | 23 +++++++++++++++---- .../map/designer/type/TileLayerPane.java | 9 ++++++-- .../chart/map/designer/type/WMSLayerPane.java | 9 ++++++-- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java b/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java index 2e8e71d393..911fc27230 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java @@ -3,20 +3,19 @@ package com.fine.theme.utils; import com.fine.theme.icon.LazyIcon; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.data.core.FormatField; +import com.fr.design.border.FineBorderFactory; import com.fr.design.border.UIRoundedBorder; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.i18n.Toolkit; import com.fr.stable.Constants; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.TitledBorder; -import java.awt.Color; +import java.awt.*; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.flex; @@ -92,4 +91,18 @@ public class FineComponentsFactory { return sampleLabel; } + /** + * 创建一个固定高度、可上下滚动的文本域面板 + * @param textArea 文本域 + * @param height 高度 + * @return 滚动面板 + */ + public static JScrollPane createFixHeightTextArea(UITextArea textArea, int height) { + JScrollPane scrollPane = new JScrollPane(textArea); + scrollPane.setPreferredSize(new Dimension(scrollPane.getPreferredSize().width, height)); + scrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); + textArea.setBorder(null); + return scrollPane; + } + } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java index 25e4316df0..c0e340b4cc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.utils.FineComponentsFactory; import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.UITextArea; @@ -9,6 +10,8 @@ import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; +import static com.fine.theme.utils.FineUIScale.scale; + /** * @author Bjorn * @version 10.0 @@ -24,8 +27,10 @@ public class TileLayerPane extends JPanel { customTileLayer = new UITextArea(); attribution = new UITextArea(); Component[][] comps = new Component[][]{ - new Component[]{new UILabel("url"), customTileLayer}, - new Component[]{new UILabel("Attribution"), attribution} + new Component[]{new UILabel("url"), + FineComponentsFactory.createFixHeightTextArea(customTileLayer, scale(36))}, + new Component[]{new UILabel("Attribution"), + FineComponentsFactory.createFixHeightTextArea(attribution, scale(36))} }; JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3}); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java index f6394c0ff9..9d44b4c2e0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.utils.FineComponentsFactory; import com.fine.theme.utils.FineLayoutBuilder; import com.fr.decision.webservice.v10.map.MapEditService; import com.fr.design.dialog.FineJOptionPane; @@ -28,6 +29,8 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import static com.fine.theme.utils.FineUIScale.scale; + /** * @author Bjorn * @version 10.0 @@ -61,9 +64,11 @@ public class WMSLayerPane extends JPanel implements UIObserver { connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); Component[][] comps = new Component[][]{ - new Component[]{new UILabel("url"), wmsUrl, null, connectButton} + new Component[]{new UILabel("url"), + FineComponentsFactory.createFixHeightTextArea(wmsUrl, scale(36)), + null, connectButton} }; - JPanel northPane = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 1.4, 0.2, 1.4}); + JPanel northPane = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 1.8, 0.2, 1.0}); wmsLayerPane = new JPanel(new BorderLayout()); resetWMSLayerPane(new ArrayList<>()); From e1481dd7eb9008fc61785b51225e75b6839b0730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 24 Oct 2024 16:57:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-138445=20fix:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9F=9FUI=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fine/theme/utils/FineComponentsFactory.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java b/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java index 911fc27230..880b2dfd16 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java @@ -11,11 +11,16 @@ import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.i18n.Toolkit; import com.fr.stable.Constants; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.border.Border; import javax.swing.border.TitledBorder; -import java.awt.*; +import java.awt.Color; +import java.awt.Dimension; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.flex;