Browse Source

Merge pull request #1007 in DESIGN/design from bugfix/10.0 to release/10.0

* commit '54daeb9fce18ea646fb898fdafaa4b2cbe31eece':
  REPORT-19873 设计器英文 表单自适应被遮挡
  REPORT-19733 未装数据集插件的设计器远程设计时 编辑服务器数据集  点击确定会覆盖所有服务器中的插件数据集
  update
  REPORT-19636 填报属性里,智能添加单元格组时,鼠标连续选中一片单元格,如果拖动稍微快了一点,选择会出现丢失
  REPORT-19565 设计器英文版-控件的数据字典部分显示问题
  CHART-9445 集群环境地图资源cacheMap同步
  REPORT-19381 设计器 右击-剪切功能失效,是粘贴的功能
feature/big-screen
neil 5 years ago
parent
commit
53493f552f
  1. 5
      designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java
  2. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  3. 29
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java
  4. 20
      designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java
  5. 81
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

5
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.actions.TemplateComponentAction;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.general.IOUtils;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import java.awt.event.KeyEvent; 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.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"));
this.setMnemonic('T'); 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.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setEnabled(!DesignModeContext.isBanCopyAndCut()); this.setEnabled(!DesignModeContext.isBanCopyAndCut());
} }
@Override @Override
public boolean executeActionReturnUndoRecordNeeded() { public boolean executeActionReturnUndoRecordNeeded() {
return DesignModeContext.doPaste(getEditingComponent()); return DesignModeContext.doCut(getEditingComponent());
} }
} }

3
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.design.mainframe.JTemplate;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient; 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.GisLayer;
import com.fr.plugin.chart.base.ViewCenter; import com.fr.plugin.chart.base.ViewCenter;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
@ -576,7 +575,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
mapDataTree.changeRootNode(this.getRootNode()); mapDataTree.changeRootNode(this.getRootNode());
if(samePlotChange) { if(samePlotChange) {
String nodePath = GEOJSONHelper.getDefaultJSONURL(); String nodePath = ChartGEOJSONHelper.getDefaultJSONURL();
mapPlot.setGeoUrl(nodePath); mapPlot.setGeoUrl(nodePath);
mapDataTree.setSelectNodePath(nodePath); mapDataTree.setSelectNodePath(nodePath);
selectTreePath = mapDataTree.getSelectionPath(); selectTreePath = mapDataTree.getSelectionPath();

29
designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java

@ -1,16 +1,20 @@
package com.fr.design.widget.ui.designer; 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.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.ButtonGroup; import com.fr.form.ui.ButtonGroup;
import javax.swing.BorderFactory;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import javax.swing.SpinnerNumberModel;
import java.awt.Component;
public class ButtonGroupDictPane extends JPanel { public class ButtonGroupDictPane extends JPanel {
@ -26,16 +30,23 @@ public class ButtonGroupDictPane extends JPanel {
* *
*/ */
public void initComponents() { public void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true); adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true);
adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 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)); columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
double f = TableLayout.FILL;
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{adaptiveCheckbox, columnLabel, columnSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); 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); this.add(jPanel);
} }

20
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.ButtonGroup; 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 = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true);
adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
adaptiveCheckbox.addActionListener(new ActionListener() { adaptiveCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
columnSpinner.setVisible(!adaptiveCheckbox.isSelected()); columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.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)); columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = {p, p}; double[] rowSize = {p, p, p};
double columnSize[] = {p, p, f}; double[] columnSize = {p, f};
Component[][] n_components = { int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane, null}, Component[][] components = {
{adaptiveCheckbox, columnLabel, columnSpinner} 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); this.add(panel);

81
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.stable.StringUtils;
import com.fr.write.DMLConfigJob; 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.DefaultTableCellRenderer;
import javax.swing.table.TableColumn; 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.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
public class SmartInsertDBManipulationPane extends DBManipulationPane { public class SmartInsertDBManipulationPane extends DBManipulationPane {
private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1); private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1);
@ -115,6 +124,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* *
* @param evt 事件对象 * @param evt 事件对象
*/ */
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
BasicPane bPane = new BasicPane() { BasicPane bPane = new BasicPane() {
@Override @Override
@ -131,6 +141,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
double f = TableLayout.FILL; double f = TableLayout.FILL;
bPane.add(TableLayoutHelper.createTableLayoutPane(coms, new double[]{p, p}, new double[]{p, f}), BorderLayout.NORTH); 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() { BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this), new DialogActionAdapter() {
@Override
public void doOk() { public void doOk() {
int row_offset = ((Number) rowSpinner.getValue()).intValue(); int row_offset = ((Number) rowSpinner.getValue()).intValue();
int column_offset = ((Number) columnSpinner.getValue()).intValue(); int column_offset = ((Number) columnSpinner.getValue()).intValue();
@ -177,6 +188,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* *
* @param evt 事件s * @param evt 事件s
*/ */
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
showCellWindow(false); showCellWindow(false);
} }
@ -192,6 +204,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* *
* @param e 事件s * @param e 事件s
*/ */
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showCellWindow(true); showCellWindow(true);
} }
@ -268,6 +281,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* *
* @throws Exception * @throws Exception
*/ */
@Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel();
int cnt = model.getRowCount(); int cnt = model.getRowCount();
@ -294,6 +308,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 单元格组要记录下之前的选中情况 // 单元格组要记录下之前的选中情况
private CellSelection oriCellSelection = null; private CellSelection oriCellSelection = null;
private List<String> newAdd = new ArrayList<String>();
private List<String> oldAdd = new ArrayList<String>();
public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) { public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) {
this(model, actionReportPane, false); this(model, actionReportPane, false);
} }
@ -347,6 +365,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* *
* @throws Exception * @throws Exception
*/ */
@Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
SmartInsertDBManipulationPane.this.checkValid(); SmartInsertDBManipulationPane.this.checkValid();
} }
@ -402,19 +421,21 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少 // 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少
ColumnRowGroup add = new ColumnRowGroup(); ColumnRowGroup add = new ColumnRowGroup();
int removeCount = 0;
if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) { 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) { } else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) {
dealSelectColRow(add, cellselection); dealSelectColRow(add, cellselection);
} else { } 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) { if (add.getSize() > 0) {
newValue.addAll(add); newValue.addAll(add);
} else if (removeCount > 0) {
newValue.splice(newValue.getSize() - removeCount, removeCount);
} }
kcv.cv.obj = newValue; kcv.cv.obj = newValue;
@ -424,6 +445,32 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
oriCellSelection = cellselection; 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) { private ColumnRowGroup getColumnRowGroupValue(Object oriValue) {
ColumnRowGroup newValue = new ColumnRowGroup(); ColumnRowGroup newValue = new ColumnRowGroup();
if (oriValue instanceof ColumnRowGroup) { if (oriValue instanceof ColumnRowGroup) {
@ -438,26 +485,6 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow(); 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) { private void dealSelectColRow(ColumnRowGroup add, CellSelection se) {
int c = se.getColumn(), cs = se.getColumnSpan(), int c = se.getColumn(), cs = se.getColumnSpan(),
r = se.getRow(), rs = se.getRowSpan(); r = se.getRow(), rs = se.getRowSpan();

Loading…
Cancel
Save