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) {