From 4a5c3d8e2727052201035b5bd3640d391dcb3656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Wed, 18 Sep 2024 13:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=20=E6=BC=8F=E7=BF=BB=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/MapAreaMatchPane.java | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index aadda3e77f..0334044235 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -1,6 +1,9 @@ package com.fr.design.chartx.component; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.chartx.TwoTuple; import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; @@ -31,19 +34,24 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.table.DefaultTableModel; import javax.swing.tree.DefaultMutableTreeNode; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; -import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; +import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; +import static com.fine.theme.utils.FineUIScale.scale; + /** * @author Bjorn * @version 10.0 @@ -67,49 +75,39 @@ public class MapAreaMatchPane extends BasicBeanPane { initButtonGroup(); initRefreshLabel(); areaNameBox = new UIComboBox(); - this.setLayout(new BorderLayout(5, 5)); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); this.add(createContentPane(), BorderLayout.NORTH); initTable(treeNodeAndItems); JPanel tablePane = new JPanel(); - tablePane.setLayout(new BorderLayout(5, 10)); - tablePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + tablePane.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); JScrollPane matchAreaScroll = new JScrollPane(matchAreaTable) { @Override public Dimension getPreferredSize() { - return new Dimension(400, 290); + return scale(new Dimension(400, 290)); } }; tablePane.add(matchAreaScroll, BorderLayout.CENTER); - JScrollPane matchResultScroll = new JScrollPane(matchResultTable) { + JScrollPane matchResultScroll = new JScrollPane(matchResultTable){ @Override public Dimension getPreferredSize() { - return new Dimension(400, 200); + return scale(new Dimension(400, 200)); } }; - matchResultScroll.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_Custom_Match_List"))); - tablePane.add(matchResultScroll, BorderLayout.SOUTH); + Component matchResult = FineUIUtils.wrapComponentWithTitle(matchResultScroll, Toolkit.i18nText("Fine-Design_Chart_Custom_Match_List")); + tablePane.add(matchResult, BorderLayout.SOUTH); - this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); this.add(tablePane, BorderLayout.CENTER); } private JPanel createContentPane() { - JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - - JPanel tableDataPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - panel.add(tableDataPane); - tableDataPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")); - tableNameCombox.setPreferredSize(new Dimension(96, 20)); - tableDataPane.add(tableNameCombox); - - JPanel areaNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - panel.add(areaNamePane); - areaNamePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":")); - areaNamePane.add(areaNameBox); - areaNameBox.setPreferredSize(new Dimension(96, 20)); - panel.add(refreshLabel); - return panel; + tableNameCombox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); + areaNameBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); + return FineLayoutBuilder.createHorizontalLayout(10, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":"), tableNameCombox, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":"), areaNameBox, + refreshLabel); } private void initTable(TwoTuple> treeNodeAndItems) {