|
|
@ -1,21 +1,5 @@ |
|
|
|
package com.fr.design.write.submit; |
|
|
|
package com.fr.design.write.submit; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.Container; |
|
|
|
|
|
|
|
import java.awt.Dialog; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JDialog; |
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.JTable; |
|
|
|
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
|
|
|
import javax.swing.table.DefaultTableCellRenderer; |
|
|
|
|
|
|
|
import javax.swing.table.TableCellRenderer; |
|
|
|
|
|
|
|
import javax.swing.table.TableColumn; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.cache.list.IntList; |
|
|
|
import com.fr.cache.list.IntList; |
|
|
|
import com.fr.data.ClassSubmitJob; |
|
|
|
import com.fr.data.ClassSubmitJob; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
@ -30,13 +14,16 @@ import com.fr.design.gui.controlpane.NameObjectCreator; |
|
|
|
import com.fr.design.gui.controlpane.NameableCreator; |
|
|
|
import com.fr.design.gui.controlpane.NameableCreator; |
|
|
|
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.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
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.*; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.JWorkBook; |
|
|
|
import com.fr.design.selection.SelectionEvent; |
|
|
|
import com.fr.design.selection.SelectionEvent; |
|
|
|
import com.fr.design.selection.SelectionListener; |
|
|
|
import com.fr.design.selection.SelectionListener; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.grid.selection.CellSelection; |
|
|
|
import com.fr.grid.selection.CellSelection; |
|
|
|
import com.fr.grid.selection.FloatSelection; |
|
|
|
import com.fr.grid.selection.FloatSelection; |
|
|
|
import com.fr.grid.selection.Selection; |
|
|
|
import com.fr.grid.selection.Selection; |
|
|
@ -45,6 +32,12 @@ 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.table.DefaultTableCellRenderer; |
|
|
|
|
|
|
|
import javax.swing.table.TableColumn; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
private ElementCasePane ePane; |
|
|
|
private ElementCasePane ePane; |
|
|
@ -88,7 +81,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public NameableCreator[] createNameableCreators() { |
|
|
|
public NameableCreator[] createNameableCreators() { |
|
|
|
return new NameableCreator[] { |
|
|
|
return new NameableCreator[]{ |
|
|
|
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Submit", "Event"}), |
|
|
|
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Submit", "Event"}), |
|
|
|
"/com/fr/web/images/reportlet.png", |
|
|
|
"/com/fr/web/images/reportlet.png", |
|
|
|
DMLConfigJob.class, |
|
|
|
DMLConfigJob.class, |
|
|
@ -96,13 +89,13 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Custom", "Event"}), |
|
|
|
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Custom", "Event"}), |
|
|
|
"/com/fr/web/images/reportlet.png", |
|
|
|
"/com/fr/web/images/reportlet.png", |
|
|
|
ClassSubmitJob.class, |
|
|
|
ClassSubmitJob.class, |
|
|
|
CustomSubmitJobPane.class) }; |
|
|
|
CustomSubmitJobPane.class)}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected UpdateAction[] getActions() { |
|
|
|
protected UpdateAction[] getActions() { |
|
|
|
return new UpdateAction[] { |
|
|
|
return new UpdateAction[]{ |
|
|
|
new SmartAddFieldsAction(), |
|
|
|
new SmartAddFieldsAction(), |
|
|
|
new AddFieldAction(), |
|
|
|
new AddFieldAction(), |
|
|
|
new SmartAddCellAction(), |
|
|
|
new SmartAddCellAction(), |
|
|
@ -119,6 +112,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 执行事件 |
|
|
|
* 执行事件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param evt 事件对象 |
|
|
|
* @param evt 事件对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
@ -132,15 +126,15 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
bPane.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, 0, 0)); |
|
|
|
bPane.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, 0, 0)); |
|
|
|
final UIBasicSpinner columnSpinner = new UIBasicSpinner(); |
|
|
|
final UIBasicSpinner columnSpinner = new UIBasicSpinner(); |
|
|
|
final UIBasicSpinner rowSpinner = new UIBasicSpinner(); |
|
|
|
final UIBasicSpinner rowSpinner = new UIBasicSpinner(); |
|
|
|
Component[][] coms = new Component[][] { { new UILabel(com.fr.design.i18n.Toolkit.i18nText("RWA-Row_Offset")), rowSpinner },{ new UILabel(com.fr.design.i18n.Toolkit.i18nText("RWA-Column_Offset")), columnSpinner } }; |
|
|
|
Component[][] coms = new Component[][]{{new UILabel(com.fr.design.i18n.Toolkit.i18nText("RWA-Row_Offset")), rowSpinner}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("RWA-Column_Offset")), columnSpinner}}; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
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() { |
|
|
|
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(); |
|
|
|
KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); |
|
|
|
KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); |
|
|
|
int[] selectedRows = keyColumnValuesTable.getSelectedRows(); |
|
|
|
int[] selectedRows = keyColumnValuesTable.getSelectedRows(); |
|
|
|
// 如果一行都没选中,取所有的行
|
|
|
|
// 如果一行都没选中,取所有的行
|
|
|
|
if (selectedRows.length == 0) { |
|
|
|
if (selectedRows.length == 0) { |
|
|
@ -150,7 +144,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
int row = selectedRows[i]; |
|
|
|
int row = selectedRows[i]; |
|
|
|
KeyColumnNameValue kcnv = model.getKeyColumnNameValue(row); |
|
|
|
KeyColumnNameValue kcnv = model.getKeyColumnNameValue(row); |
|
|
|
if (kcnv.cv.obj instanceof ColumnRow) { |
|
|
|
if (kcnv.cv.obj instanceof ColumnRow) { |
|
|
|
ColumnRow or = (ColumnRow)kcnv.cv.obj; |
|
|
|
ColumnRow or = (ColumnRow) kcnv.cv.obj; |
|
|
|
int n_column = or.getColumn() + column_offset; |
|
|
|
int n_column = or.getColumn() + column_offset; |
|
|
|
if (n_column < 0) { |
|
|
|
if (n_column < 0) { |
|
|
|
n_column = 0; |
|
|
|
n_column = 0; |
|
|
@ -180,6 +174,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 执行事件 |
|
|
|
* 执行事件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param evt 事件s |
|
|
|
* @param evt 事件s |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
@ -194,6 +189,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 智能添加单元格组 |
|
|
|
* 智能添加单元格组 |
|
|
|
|
|
|
|
* |
|
|
|
* @param e 事件s |
|
|
|
* @param e 事件s |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
@ -203,10 +199,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 切换到单元格窗口,设置属性面板不可编辑 |
|
|
|
* 切换到单元格窗口,设置属性面板不可编辑 |
|
|
|
|
|
|
|
* |
|
|
|
* @param isCellGroup 判断是否单元格组 |
|
|
|
* @param isCellGroup 判断是否单元格组 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
private void showCellWindow(boolean isCellGroup){ |
|
|
|
private void showCellWindow(boolean isCellGroup) { |
|
|
|
if (ePane == null) { |
|
|
|
if (ePane == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -232,7 +229,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
private void showDialogAfterAddCellAction() { |
|
|
|
private void showDialogAfterAddCellAction() { |
|
|
|
Container dialog = this; |
|
|
|
Container dialog = this; |
|
|
|
if (parentPane != null && parentPane.getContentDBManiPane() instanceof SmartInsertDBManipulationPane && parentPane.getContentDBManiPane() != this) { |
|
|
|
if (parentPane != null && parentPane.getContentDBManiPane() instanceof SmartInsertDBManipulationPane && parentPane.getContentDBManiPane() != this) { |
|
|
|
((SmartInsertDBManipulationPane)parentPane.getContentDBManiPane()).showDialogAfterAddCellAction(); |
|
|
|
((SmartInsertDBManipulationPane) parentPane.getContentDBManiPane()).showDialogAfterAddCellAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
while (dialog.getParent() != null) { |
|
|
|
while (dialog.getParent() != null) { |
|
|
|
dialog = dialog.getParent(); |
|
|
|
dialog = dialog.getParent(); |
|
|
@ -254,7 +251,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
private void hideDialog4AddCellAction() { |
|
|
|
private void hideDialog4AddCellAction() { |
|
|
|
Container dialog = this; |
|
|
|
Container dialog = this; |
|
|
|
if (parentPane != null && parentPane.getContentDBManiPane() instanceof SmartInsertDBManipulationPane && parentPane.getContentDBManiPane() != this) { |
|
|
|
if (parentPane != null && parentPane.getContentDBManiPane() instanceof SmartInsertDBManipulationPane && parentPane.getContentDBManiPane() != this) { |
|
|
|
((SmartInsertDBManipulationPane)parentPane.getContentDBManiPane()).hideDialog4AddCellAction(); |
|
|
|
((SmartInsertDBManipulationPane) parentPane.getContentDBManiPane()).hideDialog4AddCellAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
while (dialog.getParent() != null) { |
|
|
|
while (dialog.getParent() != null) { |
|
|
|
dialog = dialog.getParent(); |
|
|
|
dialog = dialog.getParent(); |
|
|
@ -268,13 +265,14 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 检测是否合法 |
|
|
|
* 检测是否合法 |
|
|
|
|
|
|
|
* |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
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(); |
|
|
|
int groupLength = -1; |
|
|
|
int groupLength = -1; |
|
|
|
for (int i=0; i<cnt; i++) { |
|
|
|
for (int i = 0; i < cnt; i++) { |
|
|
|
KeyColumnNameValue kcv = model.getKeyColumnNameValue(i); |
|
|
|
KeyColumnNameValue kcv = model.getKeyColumnNameValue(i); |
|
|
|
Object val = kcv.cv.obj; |
|
|
|
Object val = kcv.cv.obj; |
|
|
|
if (val instanceof ColumnRowGroup) { |
|
|
|
if (val instanceof ColumnRowGroup) { |
|
|
@ -346,6 +344,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 检查是否合法 |
|
|
|
* 检查是否合法 |
|
|
|
|
|
|
|
* |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void checkValid() throws Exception { |
|
|
|
public void checkValid() throws Exception { |
|
|
@ -356,17 +355,17 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void selectionChanged(SelectionEvent e) { |
|
|
|
public void selectionChanged(SelectionEvent e) { |
|
|
|
KeyColumnTableModel model = (KeyColumnTableModel)table.getModel(); |
|
|
|
KeyColumnTableModel model = (KeyColumnTableModel) table.getModel(); |
|
|
|
if (editingRowIndex < 0 || editingRowIndex >= model.getRowCount()) { |
|
|
|
if (editingRowIndex < 0 || editingRowIndex >= model.getRowCount()) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
KeyColumnNameValue kcv = model.getKeyColumnNameValue(editingRowIndex); |
|
|
|
KeyColumnNameValue kcv = model.getKeyColumnNameValue(editingRowIndex); |
|
|
|
ElementCasePane currentReportPane = (ElementCasePane)e.getSource(); |
|
|
|
ElementCasePane currentReportPane = (ElementCasePane) e.getSource(); |
|
|
|
Selection selection = currentReportPane.getSelection(); |
|
|
|
Selection selection = currentReportPane.getSelection(); |
|
|
|
if (selection == NO_SELECTION || selection instanceof FloatSelection) { |
|
|
|
if (selection == NO_SELECTION || selection instanceof FloatSelection) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
CellSelection cellselection = (CellSelection)selection; |
|
|
|
CellSelection cellselection = (CellSelection) selection; |
|
|
|
kcv.cv.obj = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow()); |
|
|
|
kcv.cv.obj = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow()); |
|
|
|
|
|
|
|
|
|
|
|
if (editingRowIndex >= model.getRowCount() - 1) { |
|
|
|
if (editingRowIndex >= model.getRowCount() - 1) { |
|
|
@ -387,17 +386,17 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
private SelectionListener groupListener = new SelectionListener() { |
|
|
|
private SelectionListener groupListener = new SelectionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void selectionChanged(SelectionEvent e) { |
|
|
|
public void selectionChanged(SelectionEvent e) { |
|
|
|
KeyColumnTableModel model = (KeyColumnTableModel)table.getModel(); |
|
|
|
KeyColumnTableModel model = (KeyColumnTableModel) table.getModel(); |
|
|
|
if (editingRowIndex < 0 || editingRowIndex >= model.getRowCount()) { |
|
|
|
if (editingRowIndex < 0 || editingRowIndex >= model.getRowCount()) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
KeyColumnNameValue kcv = model.getKeyColumnNameValue(editingRowIndex); |
|
|
|
KeyColumnNameValue kcv = model.getKeyColumnNameValue(editingRowIndex); |
|
|
|
ElementCasePane currentReportPane = (ElementCasePane)e.getSource(); |
|
|
|
ElementCasePane currentReportPane = (ElementCasePane) e.getSource(); |
|
|
|
Selection selection = currentReportPane.getSelection(); |
|
|
|
Selection selection = currentReportPane.getSelection(); |
|
|
|
if (selection == NO_SELECTION || selection instanceof FloatSelection) { |
|
|
|
if (selection == NO_SELECTION || selection instanceof FloatSelection) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
CellSelection cellselection = (CellSelection)selection; |
|
|
|
CellSelection cellselection = (CellSelection) selection; |
|
|
|
Object oriValue = kcv.cv.obj; |
|
|
|
Object oriValue = kcv.cv.obj; |
|
|
|
ColumnRowGroup newValue = getColumnRowGroupValue(oriValue); |
|
|
|
ColumnRowGroup newValue = getColumnRowGroupValue(oriValue); |
|
|
|
|
|
|
|
|
|
|
@ -415,7 +414,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
if (add.getSize() > 0) { |
|
|
|
if (add.getSize() > 0) { |
|
|
|
newValue.addAll(add); |
|
|
|
newValue.addAll(add); |
|
|
|
} else if (removeCount > 0) { |
|
|
|
} else if (removeCount > 0) { |
|
|
|
newValue.splice(newValue.getSize()-removeCount, removeCount); |
|
|
|
newValue.splice(newValue.getSize() - removeCount, removeCount); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
kcv.cv.obj = newValue; |
|
|
|
kcv.cv.obj = newValue; |
|
|
@ -428,7 +427,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
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) { |
|
|
|
newValue.addAll((ColumnRowGroup)oriValue); |
|
|
|
newValue.addAll((ColumnRowGroup) oriValue); |
|
|
|
} else if (oriValue instanceof ColumnRow) { |
|
|
|
} else if (oriValue instanceof ColumnRow) { |
|
|
|
newValue.addColumnRow((ColumnRow) oriValue); |
|
|
|
newValue.addColumnRow((ColumnRow) oriValue); |
|
|
|
} |
|
|
|
} |
|
|
@ -442,14 +441,14 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
private int dealDragSelection(ColumnRowGroup add, CellSelection cellselection) { |
|
|
|
private int dealDragSelection(ColumnRowGroup add, CellSelection cellselection) { |
|
|
|
int removeCount = 0; |
|
|
|
int removeCount = 0; |
|
|
|
if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() + 1) { |
|
|
|
if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() + 1) { |
|
|
|
for (int i=0; i<cellselection.getColumnSpan(); i++) { |
|
|
|
for (int i = 0; i < cellselection.getColumnSpan(); i++) { |
|
|
|
add.addColumnRow(ColumnRow.valueOf( |
|
|
|
add.addColumnRow(ColumnRow.valueOf( |
|
|
|
cellselection.getColumn() + i, cellselection.getRow() + cellselection.getRowSpan() -1)); |
|
|
|
cellselection.getColumn() + i, cellselection.getRow() + cellselection.getRowSpan() - 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() - 1) { |
|
|
|
} else if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() - 1) { |
|
|
|
removeCount = cellselection.getColumnSpan(); |
|
|
|
removeCount = cellselection.getColumnSpan(); |
|
|
|
} else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() + 1) { |
|
|
|
} else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() + 1) { |
|
|
|
for (int i=0; i<cellselection.getRowSpan(); i++) { |
|
|
|
for (int i = 0; i < cellselection.getRowSpan(); i++) { |
|
|
|
add.addColumnRow(ColumnRow.valueOf( |
|
|
|
add.addColumnRow(ColumnRow.valueOf( |
|
|
|
cellselection.getColumn() + cellselection.getColumnSpan() - 1, cellselection.getRow() + i)); |
|
|
|
cellselection.getColumn() + cellselection.getColumnSpan() - 1, cellselection.getRow() + i)); |
|
|
|
} |
|
|
|
} |
|
|
@ -462,9 +461,9 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
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(); |
|
|
|
for (int i=0; i<cs; i++) { |
|
|
|
for (int i = 0; i < cs; i++) { |
|
|
|
for (int j=0; j<rs; j++) { |
|
|
|
for (int j = 0; j < rs; j++) { |
|
|
|
add.addColumnRow(ColumnRow.valueOf(c+i, r+j)); |
|
|
|
add.addColumnRow(ColumnRow.valueOf(c + i, r + j)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -486,7 +485,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
updateUpdateCheckBoxEnable(); |
|
|
|
updateUpdateCheckBoxEnable(); |
|
|
|
((SmartInsertDBManipulationPane)dialog).showDialogAfterAddCellAction(); |
|
|
|
((SmartInsertDBManipulationPane) dialog).showDialogAfterAddCellAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -499,8 +498,8 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
|
|
|
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
|
|
|
|
|
|
|
|
|
|
|
if (value instanceof ColumnValue) { |
|
|
|
if (value instanceof ColumnValue) { |
|
|
|
if (((ColumnValue)value).obj != null) { |
|
|
|
if (((ColumnValue) value).obj != null) { |
|
|
|
this.setText(((ColumnValue)value).obj.toString()); |
|
|
|
this.setText(((ColumnValue) value).obj.toString()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.setText(StringUtils.EMPTY); |
|
|
|
this.setText(StringUtils.EMPTY); |
|
|
|
} |
|
|
|
} |
|
|
@ -525,9 +524,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { |
|
|
|
|
|
|
|
|
|
|
|
if (value instanceof ColumnValue) { |
|
|
|
if (value instanceof ColumnValue) { |
|
|
|
Object cv = ((ColumnValue) value).obj; |
|
|
|
Object cv = ((ColumnValue) value).obj; |
|
|
|
if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) { |
|
|
|
if (cv instanceof ColumnRowGroup && ((ColumnRowGroup) cv).getSize() >= CELL_GROUP_LIMIT) { |
|
|
|
this.setText("[" + com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Has_Selected", "Classifier-Ge", "Cell"}, |
|
|
|
this.setText("[" + |
|
|
|
new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]"); |
|
|
|
Toolkit.i18nText("Fine-Design_Write_Select_Cell_Count", ((ColumnRowGroup) cv).getSize()) |
|
|
|
|
|
|
|
+ "]"); |
|
|
|
tip = cv.toString() + " " + tip; |
|
|
|
tip = cv.toString() + " " + tip; |
|
|
|
} else if (cv != null) { |
|
|
|
} else if (cv != null) { |
|
|
|
this.setText(cv.toString()); |
|
|
|
this.setText(cv.toString()); |
|
|
|