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 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(); 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); } 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); 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..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 @@ -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; @@ -424,6 +445,32 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { oriCellSelection = cellselection; } + 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()); + } + } + 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 ColumnRowGroup getColumnRowGroupValue(Object oriValue) { ColumnRowGroup newValue = new ColumnRowGroup(); if (oriValue instanceof ColumnRowGroup) { @@ -438,26 +485,6 @@ 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)); - } - } else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() - 1) { - removeCount = cellselection.getRowSpan(); - } - return removeCount; - } - private void dealSelectColRow(ColumnRowGroup add, CellSelection se) { int c = se.getColumn(), cs = se.getColumnSpan(), r = se.getRow(), rs = se.getRowSpan();