From 2f83213beb1c69861a01cb929d108647d3ec286e Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 16 Jul 2019 15:04:04 +0800 Subject: [PATCH 1/7] =?UTF-8?q?REPORT-19381=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=20=E5=8F=B3=E5=87=BB-=E5=89=AA=E5=88=87=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A4=B1=E6=95=88=EF=BC=8C=E6=98=AF=E7=B2=98=E8=B4=B4=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/edit/CutAction.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java index 9d8453f1e2..c03d5d3de0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java @@ -7,6 +7,7 @@ import com.fr.base.BaseUtils; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.TargetComponent; +import com.fr.general.IOUtils; import javax.swing.KeyStroke; import java.awt.event.KeyEvent; @@ -25,13 +26,13 @@ public class CutAction extends TemplateComponentAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); } @Override public boolean executeActionReturnUndoRecordNeeded() { - return DesignModeContext.doPaste(getEditingComponent()); + return DesignModeContext.doCut(getEditingComponent()); } } \ No newline at end of file From fac12f874c3e73d0b8526ae832aa2649cdb5faf6 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 17 Jul 2019 21:03:08 +0800 Subject: [PATCH 2/7] =?UTF-8?q?CHART-9445=20=E9=9B=86=E7=BE=A4=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=9C=B0=E5=9B=BE=E8=B5=84=E6=BA=90cacheMap=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/map/designer/type/VanChartMapSourceChoosePane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 10664b3405..bbce11d9fe 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -20,7 +20,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; -import com.fr.geojson.helper.GEOJSONHelper; import com.fr.plugin.chart.base.GisLayer; import com.fr.plugin.chart.base.ViewCenter; import com.fr.plugin.chart.map.VanChartMapPlot; @@ -576,7 +575,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { mapDataTree.changeRootNode(this.getRootNode()); if(samePlotChange) { - String nodePath = GEOJSONHelper.getDefaultJSONURL(); + String nodePath = ChartGEOJSONHelper.getDefaultJSONURL(); mapPlot.setGeoUrl(nodePath); mapDataTree.setSelectNodePath(nodePath); selectTreePath = mapDataTree.getSelectionPath(); From 20d6a888fb653052140b208a64da86522b0d1e23 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 23 Jul 2019 15:20:50 +0800 Subject: [PATCH 3/7] =?UTF-8?q?REPORT-19565=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E7=89=88-=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E9=83=A8=E5=88=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/widget/ui/ButtonGroupDictPane.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java index 5d456d9b71..049168da14 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java @@ -18,6 +18,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor; +import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.ButtonGroup; @@ -42,23 +43,28 @@ public class ButtonGroupDictPane extends JPanel { adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true); adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); adaptiveCheckbox.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { columnSpinner.setVisible(!adaptiveCheckbox.isSelected()); columnLabel.setVisible(!adaptiveCheckbox.isSelected()); } }); - 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)); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - double rowSize[] = {p, p}; - double columnSize[] = {p, p, f}; - Component[][] n_components = { - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane, null}, - {adaptiveCheckbox, columnLabel, columnSpinner} + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + Component[][] components = { + new Component[] {dictLabel, dictPane}, + new Component[] {adaptiveCheckbox, null}, + new Component[] {columnLabel, columnSpinner} }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); + panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(panel); From 007291ce024216ce44587b1e553ba3428810ff29 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 26 Jul 2019 11:02:05 +0800 Subject: [PATCH 4/7] =?UTF-8?q?REPORT-19636=20=E5=A1=AB=E6=8A=A5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=87=8C=EF=BC=8C=E6=99=BA=E8=83=BD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E7=BB=84=E6=97=B6=EF=BC=8C=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E8=BF=9E=E7=BB=AD=E9=80=89=E4=B8=AD=E4=B8=80=E7=89=87?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E7=A8=8D=E5=BE=AE=E5=BF=AB=E4=BA=86=E4=B8=80=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E6=8B=A9=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../submit/SmartInsertDBManipulationPane.java | 72 +++++++++++++------ 1 file changed, 49 insertions(+), 23 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 26271037bd..682f050684 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -32,11 +32,20 @@ import com.fr.stable.ColumnRowGroup; import com.fr.stable.StringUtils; import com.fr.write.DMLConfigJob; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JTable; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dialog; import java.awt.event.ActionEvent; +import java.util.ArrayList; +import java.util.List; public class SmartInsertDBManipulationPane extends DBManipulationPane { private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1); @@ -115,6 +124,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * * @param evt 事件对象 */ + @Override public void actionPerformed(ActionEvent evt) { BasicPane bPane = new BasicPane() { @Override @@ -131,6 +141,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { double f = TableLayout.FILL; bPane.add(TableLayoutHelper.createTableLayoutPane(coms, new double[]{p, p}, new double[]{p, f}), BorderLayout.NORTH); BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this), new DialogActionAdapter() { + @Override public void doOk() { int row_offset = ((Number) rowSpinner.getValue()).intValue(); int column_offset = ((Number) columnSpinner.getValue()).intValue(); @@ -177,6 +188,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * * @param evt 事件s */ + @Override public void actionPerformed(ActionEvent evt) { showCellWindow(false); } @@ -192,6 +204,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * * @param e 事件s */ + @Override public void actionPerformed(ActionEvent e) { showCellWindow(true); } @@ -268,6 +281,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * * @throws Exception */ + @Override public void checkValid() throws Exception { KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); int cnt = model.getRowCount(); @@ -294,6 +308,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { // 单元格组要记录下之前的选中情况 private CellSelection oriCellSelection = null; + private List newAdd = new ArrayList(); + + private List oldAdd = new ArrayList(); + public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) { this(model, actionReportPane, false); } @@ -347,6 +365,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * * @throws Exception */ + @Override public void checkValid() throws Exception { SmartInsertDBManipulationPane.this.checkValid(); } @@ -402,19 +421,21 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { // 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少 ColumnRowGroup add = new ColumnRowGroup(); - int removeCount = 0; if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) { - removeCount = dealDragSelection(add, cellselection); + dealDragSelection(add, cellselection, newValue); } else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { dealSelectColRow(add, cellselection); } else { - add.addColumnRow(ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow())); + ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow()); + String allColumnRow = columnRow.toString(); + if (!allColumnRow.contains(columnRow.toString())) { + add.addColumnRow(columnRow); + } + } if (add.getSize() > 0) { newValue.addAll(add); - } else if (removeCount > 0) { - newValue.splice(newValue.getSize() - removeCount, removeCount); } kcv.cv.obj = newValue; @@ -438,24 +459,29 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow(); } - private int dealDragSelection(ColumnRowGroup add, CellSelection cellselection) { - int removeCount = 0; - if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() + 1) { - for (int i = 0; i < cellselection.getColumnSpan(); i++) { - add.addColumnRow(ColumnRow.valueOf( - cellselection.getColumn() + i, cellselection.getRow() + cellselection.getRowSpan() - 1)); - } - } else if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() - 1) { - removeCount = cellselection.getColumnSpan(); - } else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() + 1) { - for (int i = 0; i < cellselection.getRowSpan(); i++) { - add.addColumnRow(ColumnRow.valueOf( - cellselection.getColumn() + cellselection.getColumnSpan() - 1, cellselection.getRow() + i)); + private void dealDragSelection(ColumnRowGroup add, CellSelection cellselection, ColumnRowGroup newValue) { + int c = cellselection.getColumn(); + int cs = cellselection.getColumnSpan(); + int r = cellselection.getRow();int rs = cellselection.getRowSpan(); + String allColumnRow = newValue.toString(); + newAdd.clear(); + for (int i = 0; i < cs; i++) { + for (int j = 0; j < rs; j++) { + ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j); + if (!allColumnRow.contains(columnRow.toString())) { + add.addColumnRow(columnRow); + } + newAdd.add(columnRow.toString()); } - } else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() - 1) { - removeCount = cellselection.getRowSpan(); } - return removeCount; + int oldSize = oldAdd.size(); + int newSize = newAdd.size(); + if (oldSize > newSize && oldAdd.containsAll(newAdd)) { + int diff = oldSize - newSize; + newValue.splice(newValue.getSize() - diff, diff); + } + oldAdd.clear(); + oldAdd.addAll(newAdd); } private void dealSelectColRow(ColumnRowGroup add, CellSelection se) { From c5e1ffbce08e1b7cb6f56c20a3ea656250a9ed81 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 26 Jul 2019 11:09:49 +0800 Subject: [PATCH 5/7] update --- .../submit/SmartInsertDBManipulationPane.java | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 682f050684..693722812f 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -445,24 +445,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { oriCellSelection = cellselection; } - private ColumnRowGroup getColumnRowGroupValue(Object oriValue) { - ColumnRowGroup newValue = new ColumnRowGroup(); - if (oriValue instanceof ColumnRowGroup) { - newValue.addAll((ColumnRowGroup) oriValue); - } else if (oriValue instanceof ColumnRow) { - newValue.addColumnRow((ColumnRow) oriValue); - } - return newValue; - } - - private boolean isSameStartPoint(CellSelection cs1, CellSelection cs2) { - return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow(); - } - private void dealDragSelection(ColumnRowGroup add, CellSelection cellselection, ColumnRowGroup newValue) { int c = cellselection.getColumn(); int cs = cellselection.getColumnSpan(); - int r = cellselection.getRow();int rs = cellselection.getRowSpan(); + int r = cellselection.getRow(); + int rs = cellselection.getRowSpan(); String allColumnRow = newValue.toString(); newAdd.clear(); for (int i = 0; i < cs; i++) { @@ -484,6 +471,20 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { oldAdd.addAll(newAdd); } + private ColumnRowGroup getColumnRowGroupValue(Object oriValue) { + ColumnRowGroup newValue = new ColumnRowGroup(); + if (oriValue instanceof ColumnRowGroup) { + newValue.addAll((ColumnRowGroup) oriValue); + } else if (oriValue instanceof ColumnRow) { + newValue.addColumnRow((ColumnRow) oriValue); + } + return newValue; + } + + private boolean isSameStartPoint(CellSelection cs1, CellSelection cs2) { + return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow(); + } + private void dealSelectColRow(ColumnRowGroup add, CellSelection se) { int c = se.getColumn(), cs = se.getColumnSpan(), r = se.getRow(), rs = se.getRowSpan(); From eaa4de18931a875d2460e12ad073b1f12aa2d21f Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 26 Jul 2019 14:00:45 +0800 Subject: [PATCH 6/7] =?UTF-8?q?REPORT-19733=20=E6=9C=AA=E8=A3=85=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=8F=92=E4=BB=B6=E7=9A=84=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=97=B6=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=20=20=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A=E4=BC=9A?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=89=80=E6=9C=89=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=8F=92=E4=BB=B6=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataPaneListPane.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 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 59880cc4ef..963238d228 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,7 +22,6 @@ 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; @@ -211,15 +210,19 @@ public class TableDataPaneListPane extends JListControlPane implements TableData @Override public void update(TableDataConfig tableDataConfig) { - tableDataConfig.removeAllTableData(); - ProcedureConfig.getInstance().removeAllProcedure(); + 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()); + } Nameable[] tableDataArray = this.update(); - Map tableDataMap = new LinkedHashMap(); for (int i = 0; i < tableDataArray.length; i++) { NameObject nameObject = (NameObject) tableDataArray[i]; - tableDataMap.put(nameObject.getName(), (TableData) nameObject.getObject()); + tableDataConfig.addTableData(nameObject.getName(), (TableData) nameObject.getObject()); } - tableDataConfig.setTableDatas(tableDataMap); } @Override From 9c7c9aba6ed0f01d57f56997b9281136c0b40f30 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 30 Jul 2019 15:44:57 +0800 Subject: [PATCH 7/7] =?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); }