|
|
|
@ -79,16 +79,24 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
private Map<String, int[]> pic;
|
|
|
|
|
private Map<String, int[]> general2;
|
|
|
|
|
private List<String> disableEdit2;
|
|
|
|
|
private JRadioPanel sysl;
|
|
|
|
|
private JRadioPanel yssl;
|
|
|
|
|
private JCheckPanel mqjd;
|
|
|
|
|
String[] colNames = { "jd2_no", "jd2_gg", "jd2_gg1", "jd2_gc", "jd2_gc1", "jd2_1", "jd2_2", "jd2_3", "jd2_4",
|
|
|
|
|
"jd2_5", "jd2_6", "jd2_7", "jd2_8", "jd2_9", "jd2_10", "jd2_min", "jd2_max", "jd2_jg" };
|
|
|
|
|
String[] colNames1 = { "jd2_ctq1", "jd2_ctq2", "jd2_ctq3", "jd2_ctq4", "jd2_ctq5", "jd2_ctq6", "jd2_ctq7",
|
|
|
|
|
private String[] colNames = { "jd2_no", "jd2_gg", "jd2_gg1", "jd2_gc", "jd2_gc1", "jd2_1", "jd2_2", "jd2_3",
|
|
|
|
|
"jd2_4", "jd2_5", "jd2_6", "jd2_7", "jd2_8", "jd2_9", "jd2_10", "jd2_min", "jd2_max", "jd2_jg" };
|
|
|
|
|
private String[] colNames1 = { "jd2_ctq1", "jd2_ctq2", "jd2_ctq3", "jd2_ctq4", "jd2_ctq5", "jd2_ctq6", "jd2_ctq7",
|
|
|
|
|
"jd2_ctq8" };
|
|
|
|
|
String[] colNames2 = { "jd2_no", "jd2_ctq1", "jd2_ctq2", "jd2_ctq3", "jd2_ctq4", "jd2_ctq5", "jd2_ctq6", "jd2_ctq7",
|
|
|
|
|
"jd2_ctq8" };
|
|
|
|
|
String[] colNames3 = { "jd2_ctq1", "jd2_ctq2", "jd2_ctq3", "jd2_ctq4", "jd2_ctq5", "jd2_ctq6", "jd2_ctq7",
|
|
|
|
|
private String[] colNames2 = { "jd2_no", "jd2_ctq1", "jd2_ctq2", "jd2_ctq3", "jd2_ctq4", "jd2_ctq5", "jd2_ctq6",
|
|
|
|
|
"jd2_ctq7", "jd2_ctq8" };
|
|
|
|
|
private String[] colNames3 = { "jd2_ctq1", "jd2_ctq2", "jd2_ctq3", "jd2_ctq4", "jd2_ctq5", "jd2_ctq6", "jd2_ctq7",
|
|
|
|
|
"jd2_ctq8" };
|
|
|
|
|
private JMenuItem addP;
|
|
|
|
|
private JMenuItem delP;
|
|
|
|
|
private JMenuItem addR;
|
|
|
|
|
private JMenuItem insertR;
|
|
|
|
|
private JMenuItem delR;
|
|
|
|
|
private JMenuItem addR2;
|
|
|
|
|
private JMenuItem insertR2;
|
|
|
|
|
private JMenuItem delR2;
|
|
|
|
|
|
|
|
|
|
public SampleConfirmationForm(TCComponent arg0) throws Exception {
|
|
|
|
|
super(arg0);
|
|
|
|
@ -175,8 +183,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
general.put("jd2_wlbm", new int[] { 7, 2 });
|
|
|
|
|
model.setValueAt("送样数量", 7, 8);
|
|
|
|
|
disableEdit.add("7,8");
|
|
|
|
|
sysl = new JRadioPanel(new String[] { "3", "5", "10", "30" });
|
|
|
|
|
model.setValueAt(sysl, 7, 10);
|
|
|
|
|
yssl = new JRadioPanel(new String[] { "3", "5", "10", "30" });
|
|
|
|
|
model.setValueAt(yssl, 7, 10);
|
|
|
|
|
model.setValueAt("状态", 7, 14);
|
|
|
|
|
disableEdit.add("7,14");
|
|
|
|
|
general.put("jd2_zt", new int[] { 7, 17 });
|
|
|
|
@ -254,14 +262,14 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
disableEdit.add(bottom + 2 + ",15");
|
|
|
|
|
model.setValueAt("物料包装及标签", bottom + 2, 18);
|
|
|
|
|
disableEdit.add(bottom + 2 + ",18");
|
|
|
|
|
general.put("jd2_CTime", new int[] { bottom + 3, 5 });
|
|
|
|
|
general.put("jd2_Ctime", new int[] { bottom + 3, 5 });
|
|
|
|
|
general.put("jd2_zs", new int[] { bottom + 3, 6 });
|
|
|
|
|
general.put("jd2_lq", new int[] { bottom + 3, 7 });
|
|
|
|
|
general.put("jd2_baoz", new int[] { bottom + 3, 8 });
|
|
|
|
|
pic.put("jd2_gfzjbg", new int[] { bottom + 3, 9 });
|
|
|
|
|
pic.put("jd2_gfzyzds", new int[] { bottom + 3, 12 });
|
|
|
|
|
pic.put("jd2_gfqcgct", new int[] { bottom + 3, 15 });
|
|
|
|
|
pic.put("jd2_wlbzjbg", new int[] { bottom + 3, 18 });
|
|
|
|
|
pic.put("jd2_wlbzjbq", new int[] { bottom + 3, 18 });
|
|
|
|
|
model.setValueAt("Shot/24Hr", bottom + 4, 5);
|
|
|
|
|
disableEdit.add(bottom + 4 + ",5");
|
|
|
|
|
model.setValueAt("吨", bottom + 4, 6);
|
|
|
|
@ -270,8 +278,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
general.put("jd2_d", new int[] { bottom + 5, 6 });
|
|
|
|
|
model.setValueAt("3D重量", bottom + 6, 4);
|
|
|
|
|
disableEdit.add(bottom + 6 + ",4");
|
|
|
|
|
model.setValueAt("jd2_3dzl", bottom + 6, 5);
|
|
|
|
|
general.put("jd2_3dzl", new int[] { bottom + 6, 5 });
|
|
|
|
|
model.setValueAt("jd2_3Dzl", bottom + 6, 5);
|
|
|
|
|
general.put("jd2_3Dzl", new int[] { bottom + 6, 5 });
|
|
|
|
|
model.setValueAt("注塑工艺条件", bottom + 6, 7);
|
|
|
|
|
disableEdit.add(bottom + 6 + ",7");
|
|
|
|
|
model.setValueAt("IQC首检报告", bottom + 6, 9);
|
|
|
|
@ -282,17 +290,17 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
disableEdit.add(bottom + 6 + ",15");
|
|
|
|
|
model.setValueAt("模具标识", bottom + 6, 18);
|
|
|
|
|
disableEdit.add(bottom + 6 + ",18");
|
|
|
|
|
pic.put("jd2_gytj", new int[] { bottom + 7, 7 });
|
|
|
|
|
pic.put("jd2_iqcsjbg", new int[] { bottom + 7, 9 });
|
|
|
|
|
pic.put("jd2_zsgytj", new int[] { bottom + 7, 7 });
|
|
|
|
|
pic.put("jd2_icqsjbg", new int[] { bottom + 7, 9 });
|
|
|
|
|
pic.put("jd2_csbg", new int[] { bottom + 7, 12 });
|
|
|
|
|
pic.put("jd2_czbf", new int[] { bottom + 7, 15 });
|
|
|
|
|
pic.put("jd2_czbg", new int[] { bottom + 7, 15 });
|
|
|
|
|
pic.put("jd2_mjbs", new int[] { bottom + 7, 18 });
|
|
|
|
|
model.setValueAt("实测重量", bottom + 8, 4);
|
|
|
|
|
disableEdit.add(bottom + 8 + ",4");
|
|
|
|
|
general.put("jd2_sczl", new int[] { bottom + 8, 5 });
|
|
|
|
|
model.setValueAt("IQC作业指导书", bottom + 10, 4);
|
|
|
|
|
disableEdit.add(bottom + 10 + ",4");
|
|
|
|
|
pic.put("jd2_icqjyzyzds", new int[] { bottom + 11, 4 });
|
|
|
|
|
pic.put("jd2_icqjyzds", new int[] { bottom + 11, 4 });
|
|
|
|
|
model.setValueAt("决定", bottom + 12, 12);
|
|
|
|
|
disableEdit.add(bottom + 12 + ",12");
|
|
|
|
|
general.put("jd2_jued", new int[] { bottom + 12, 15 });
|
|
|
|
@ -447,7 +455,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
tcr1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
|
table.setDefaultRenderer(Object.class, tcr1);
|
|
|
|
|
for (int i = 0; i < model.getColumnCount(); i++) {
|
|
|
|
|
table.getColumnModel().getColumn(i).setCellEditor(new MyCellEditor(new JTextField()));
|
|
|
|
|
table.getColumnModel().getColumn(i).setCellEditor(new MyCellEditor(new JTextField(), top, end, bottom));
|
|
|
|
|
}
|
|
|
|
|
table.addMouseListener(rightClick());
|
|
|
|
|
confirmPanel.add(table, BorderLayout.CENTER);
|
|
|
|
@ -458,18 +466,21 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
model.setValueAt(prop.get(entry.getKey()), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
} else {
|
|
|
|
|
model.setValueAt(entry.getKey(), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
model.setValueAt("", entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
System.out.println("属性‘" + entry.getKey() + "’未找到");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_sysl")) {
|
|
|
|
|
sysl.setSelected(prop.get("jd2_sysl"));
|
|
|
|
|
if (prop.containsKey("jd2_yssl")) {
|
|
|
|
|
yssl.setSelected(prop.get("jd2_yssl"));
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("属性‘jd2_yssl’未找到");
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_mqjd")) {
|
|
|
|
|
mqjd.setSelected(prop.get("jd2_mqjd"));
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("属性‘jd2_mqjd’未找到");
|
|
|
|
|
}
|
|
|
|
|
pic.put("user_data_1", new int[] { bottom + 3, 0 });
|
|
|
|
|
pic.put("user_data_2", new int[] { bottom + 3, 9 });
|
|
|
|
|
|
|
|
|
|
for (Entry<String, int[]> entry : pic.entrySet()) {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
TCComponent comp = null;
|
|
|
|
@ -503,13 +514,17 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
label.addMouseListener(showImg(img.getPath()));
|
|
|
|
|
label.setToolTipText(dataset.getUid());
|
|
|
|
|
model.setValueAt(label, row, col);
|
|
|
|
|
} else {
|
|
|
|
|
model.setValueAt(new JLabel(""), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
System.out.println("未找到uid为\"" + prop.get(entry.getKey()) + "\"的数据集");
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
model.setValueAt(new JLabel(""), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
e.printStackTrace(System.out);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
model.setValueAt(new JLabel(entry.getKey()), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
model.setValueAt(new JLabel(""), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
System.out.println("属性‘" + entry.getKey() + "’未找到");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -528,6 +543,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
model.setValueAt(tableRows[i][ii], i + top + 2, ii > 2 ? ii + 2 : ii);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("属性‘jd2_ypqrdtable’未找到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollPane confirmScrollPanel = new ScrollPane();
|
|
|
|
@ -682,29 +699,41 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
|
|
|
|
|
// 确认单右键菜单
|
|
|
|
|
menu.setVisible(false);
|
|
|
|
|
JMenuItem addP;
|
|
|
|
|
addP = new JMenuItem("添加图片");
|
|
|
|
|
addP.setEnabled(false);
|
|
|
|
|
menu.add(addP);
|
|
|
|
|
addP.addActionListener(addPic());
|
|
|
|
|
JMenuItem addR;
|
|
|
|
|
delP = new JMenuItem("删除图片");
|
|
|
|
|
delP.setEnabled(false);
|
|
|
|
|
menu.add(delP);
|
|
|
|
|
delP.addActionListener(delPic());
|
|
|
|
|
addR = new JMenuItem("添加行");
|
|
|
|
|
addR.setEnabled(false);
|
|
|
|
|
menu.add(addR);
|
|
|
|
|
addR.addActionListener(addRow());
|
|
|
|
|
JMenuItem insertR;
|
|
|
|
|
insertR = new JMenuItem("插入行");
|
|
|
|
|
insertR.setEnabled(false);
|
|
|
|
|
menu.add(insertR);
|
|
|
|
|
insertR.addActionListener(insertRow());
|
|
|
|
|
delR = new JMenuItem("删除行");
|
|
|
|
|
delR.setEnabled(false);
|
|
|
|
|
menu.add(delR);
|
|
|
|
|
delR.addActionListener(deleteRow());
|
|
|
|
|
|
|
|
|
|
// 检验单右键菜单
|
|
|
|
|
menu2.setVisible(false);
|
|
|
|
|
JMenuItem addR2;
|
|
|
|
|
addR2 = new JMenuItem("添加行");
|
|
|
|
|
addR2.setEnabled(false);
|
|
|
|
|
menu2.add(addR2);
|
|
|
|
|
addR2.addActionListener(addRow2());
|
|
|
|
|
JMenuItem insertR2;
|
|
|
|
|
insertR2 = new JMenuItem("插入行");
|
|
|
|
|
insertR2.setEnabled(false);
|
|
|
|
|
menu2.add(insertR2);
|
|
|
|
|
insertR2.addActionListener(insertRow2());
|
|
|
|
|
delR2 = new JMenuItem("删除行");
|
|
|
|
|
delR2.setEnabled(false);
|
|
|
|
|
menu2.add(delR2);
|
|
|
|
|
delR2.addActionListener(deleteRow2());
|
|
|
|
|
|
|
|
|
|
center.add("confirm", confirmScrollPanel);
|
|
|
|
|
center.add("examine", examineScrollPanel);
|
|
|
|
@ -741,11 +770,19 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
}
|
|
|
|
|
// 保存选择
|
|
|
|
|
try {
|
|
|
|
|
if (prop.containsKey("jd2_sysl")) {
|
|
|
|
|
form.setProperty("jd2_sysl", sysl.getSelected() == null ? "" : sysl.getSelected().getText());
|
|
|
|
|
if (prop.containsKey("jd2_yssl")) {
|
|
|
|
|
String value = yssl.getSelected() == null ? "" : yssl.getSelected().getText();
|
|
|
|
|
if (form.getTCProperty("jd2_yssl").getLOV() != null && !"".equals(value)) {
|
|
|
|
|
value = (String) form.getTCProperty("jd2_yssl").getLOV().getListOfValues().getRealValue(value);
|
|
|
|
|
}
|
|
|
|
|
form.setProperty("jd2_yssl", value);
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_mqjd")) {
|
|
|
|
|
form.setProperty("jd2_mqjd", mqjd.getSelectedText() == null ? "" : mqjd.getSelectedText());
|
|
|
|
|
String value = mqjd.getSelectedText() == null ? "" : mqjd.getSelectedText();
|
|
|
|
|
if (form.getTCProperty("jd2_mqjd").getLOV() != null && !"".equals(value)) {
|
|
|
|
|
value = (String) form.getTCProperty("jd2_mqjd").getLOV().getListOfValues().getRealValue(value);
|
|
|
|
|
}
|
|
|
|
|
form.setProperty("jd2_mqjd", value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
@ -756,8 +793,12 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
for (Entry<String, int[]> entry : general.entrySet()) {
|
|
|
|
|
try {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
form.setProperty(entry.getKey(),
|
|
|
|
|
model.getValueAt(entry.getValue()[0], entry.getValue()[1]).toString());
|
|
|
|
|
String value = model.getValueAt(entry.getValue()[0], entry.getValue()[1]).toString();
|
|
|
|
|
if (form.getTCProperty(entry.getKey()).getLOV() != null && !"".equals(value)) {
|
|
|
|
|
value = (String) form.getTCProperty(entry.getKey()).getLOV().getListOfValues()
|
|
|
|
|
.getRealValue(value);
|
|
|
|
|
}
|
|
|
|
|
form.setProperty(entry.getKey(), value);
|
|
|
|
|
}
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
@ -806,7 +847,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq1", "JD2_CTQ1", colNames1, dataArr);
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq1", "JD2_CQT1", colNames1, dataArr);
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq2")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
@ -829,7 +870,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq2", "JD2_CTQ2", colNames2, dataArr);
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq2", "JD2_CQT2", colNames2, dataArr);
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq3")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
@ -852,7 +893,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq3", "JD2_CTQ3", colNames3, dataArr);
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq3", "JD2_CQT3", colNames3, dataArr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -887,6 +928,13 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
@Override
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
if (e.getButton() == MouseEvent.BUTTON3 && form.isCheckedOut() && table.getSelectedRow() != -1) {
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
boolean flag = (row >= top && row <= bottom);
|
|
|
|
|
addR.setEnabled(flag);
|
|
|
|
|
insertR.setEnabled(flag);
|
|
|
|
|
delR.setEnabled(flag);
|
|
|
|
|
flag = row > bottom;
|
|
|
|
|
addP.setEnabled(flag);
|
|
|
|
|
menu.show(e.getComponent(), e.getX(), e.getY());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -899,6 +947,11 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
@Override
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
if (e.getButton() == MouseEvent.BUTTON3 && form.isCheckedOut() && table2.getSelectedRow() != -1) {
|
|
|
|
|
int row = table2.getSelectedRow();
|
|
|
|
|
boolean flag = (row >= top2 && row <= bottom2);
|
|
|
|
|
addR2.setEnabled(flag);
|
|
|
|
|
insertR2.setEnabled(flag);
|
|
|
|
|
delR2.setEnabled(flag);
|
|
|
|
|
menu2.show(e.getComponent(), e.getX(), e.getY());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -972,86 +1025,124 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener delPic() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
int col = table.getSelectedColumn();
|
|
|
|
|
model.setValueAt(new JLabel(""), row, col);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener addRow() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(bottom, 0).toString());
|
|
|
|
|
model.insertRow(++bottom);
|
|
|
|
|
model.setValueAt(num + 1, bottom, 0);
|
|
|
|
|
model.combine(new int[] { bottom }, new int[] { 2, 3, 4 });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener addRow2() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int num = Integer.parseInt(model2.getValueAt(bottom2, 0).toString());
|
|
|
|
|
model2.insertRow(++bottom2);
|
|
|
|
|
model2.setValueAt(num + 1, bottom2, 0);
|
|
|
|
|
model2.combine(new int[] { bottom2 }, new int[] { 0, 1 });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener insertRow() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
if (row >= top && row <= bottom) {
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(bottom, 0).toString());
|
|
|
|
|
model.insertRow(++bottom);
|
|
|
|
|
model.setValueAt(num + 1, bottom, 0);
|
|
|
|
|
model.combine(new int[] { bottom }, new int[] { 2, 3, 4 });
|
|
|
|
|
} else {
|
|
|
|
|
// Ìáʾ
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(row, 0).toString());
|
|
|
|
|
model.insertRow(row);
|
|
|
|
|
bottom++;
|
|
|
|
|
for (int i = row; i <= bottom; i++) {
|
|
|
|
|
model.setValueAt(num + i - row, i, 0);
|
|
|
|
|
}
|
|
|
|
|
model.combine(new int[] { row }, new int[] { 2, 3, 4 });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener addRow2() {
|
|
|
|
|
private ActionListener insertRow2() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table2.getSelectedRow();
|
|
|
|
|
if (row >= top2 && row <= bottom2) {
|
|
|
|
|
int num = Integer.parseInt(model2.getValueAt(bottom2, 0).toString());
|
|
|
|
|
model2.insertRow(++bottom2);
|
|
|
|
|
model2.setValueAt(num + 1, bottom2, 0);
|
|
|
|
|
model2.combine(new int[] { bottom2 }, new int[] { 0, 1 });
|
|
|
|
|
} else {
|
|
|
|
|
// Ìáʾ
|
|
|
|
|
int num = Integer.parseInt(model2.getValueAt(row, 0).toString());
|
|
|
|
|
model2.insertRow(row);
|
|
|
|
|
bottom2++;
|
|
|
|
|
for (int i = row; i <= bottom2; i++) {
|
|
|
|
|
model2.setValueAt(num + i - row, i, 0);
|
|
|
|
|
}
|
|
|
|
|
model2.combine(new int[] { row }, new int[] { 0, 1 });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener insertRow() {
|
|
|
|
|
private ActionListener deleteRow() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
if (row >= top && row <= bottom) {
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(row, 0).toString());
|
|
|
|
|
model.insertRow(row);
|
|
|
|
|
bottom++;
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(row, 0).toString());
|
|
|
|
|
model.removeRow(row);
|
|
|
|
|
bottom--;
|
|
|
|
|
if (row <= bottom) {
|
|
|
|
|
for (int i = row; i <= bottom; i++) {
|
|
|
|
|
model.setValueAt(num + i - row, i, 0);
|
|
|
|
|
}
|
|
|
|
|
model.combine(new int[] { row }, new int[] { 2, 3, 4 });
|
|
|
|
|
} else {
|
|
|
|
|
// Ìáʾ
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return actionListener;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener insertRow2() {
|
|
|
|
|
private ActionListener deleteRow2() {
|
|
|
|
|
ActionListener actionListener = new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table2.getSelectedRow();
|
|
|
|
|
if (row >= top2 && row <= bottom2) {
|
|
|
|
|
int num = Integer.parseInt(model2.getValueAt(row, 0).toString());
|
|
|
|
|
model2.insertRow(row);
|
|
|
|
|
bottom2++;
|
|
|
|
|
int num = Integer.parseInt(model2.getValueAt(row, 0).toString());
|
|
|
|
|
model2.removeRow(row);
|
|
|
|
|
bottom2--;
|
|
|
|
|
if (row <= bottom2) {
|
|
|
|
|
for (int i = row; i <= bottom2; i++) {
|
|
|
|
|
model2.setValueAt(num + i - row, i, 0);
|
|
|
|
|
}
|
|
|
|
|
model2.combine(new int[] { row }, new int[] { 0, 1 });
|
|
|
|
|
} else {
|
|
|
|
|
// Ìáʾ
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|