From 9c7c9aba6ed0f01d57f56997b9281136c0b40f30 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 30 Jul 2019 15:44:57 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-19873=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=8B=B1=E6=96=87=20=E8=A1=A8=E5=8D=95=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E8=A2=AB=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataPaneListPane.java | 15 ++++------ .../ui/designer/ButtonGroupDictPane.java | 29 +++++++++++++------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 963238d228..59880cc4ef 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -210,19 +211,15 @@ public class TableDataPaneListPane extends JListControlPane implements TableData @Override public void update(TableDataConfig tableDataConfig) { - Iterator tableDataNames = tableDataConfig.getTableDatas().keySet().iterator(); - while (tableDataNames.hasNext()) { - tableDataConfig.removeTableData(tableDataNames.next()); - } - Iterator procedureName = ProcedureConfig.getInstance().getProcedures().keySet().iterator(); - while (procedureName.hasNext()) { - ProcedureConfig.getInstance().removeProcedure(procedureName.next()); - } + tableDataConfig.removeAllTableData(); + ProcedureConfig.getInstance().removeAllProcedure(); Nameable[] tableDataArray = this.update(); + Map tableDataMap = new LinkedHashMap(); for (int i = 0; i < tableDataArray.length; i++) { NameObject nameObject = (NameObject) tableDataArray[i]; - tableDataConfig.addTableData(nameObject.getName(), (TableData) nameObject.getObject()); + tableDataMap.put(nameObject.getName(), (TableData) nameObject.getObject()); } + tableDataConfig.setTableDatas(tableDataMap); } @Override diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java index 500d42a1cd..bc69bbd1a2 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java @@ -1,16 +1,20 @@ package com.fr.design.widget.ui.designer; +import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.ButtonGroup; - -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SpinnerNumberModel; +import java.awt.Component; public class ButtonGroupDictPane extends JPanel { @@ -26,16 +30,23 @@ public class ButtonGroupDictPane extends JPanel { * */ public void initComponents() { - - - this.setLayout(FRGUIPaneFactory.createBorderLayout()); adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true); adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.columnLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":"); + UILabel dictLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")); + this.columnLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":", dictLabel.getPreferredSize().width); columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1)); - - JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{adaptiveCheckbox, columnLabel, columnSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}}; + Component[][] components = { + new Component[] {adaptiveCheckbox, null}, + new Component[] {columnLabel, columnSpinner}, + }; + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(jPanel); }