|
|
|
@ -39,6 +39,7 @@ import com.connor.jd.plm.table.CTable;
|
|
|
|
|
import com.connor.jd.plm.table.JCheckPanel;
|
|
|
|
|
import com.connor.jd.plm.table.JRadioPanel;
|
|
|
|
|
import com.connor.jd.plm.table.MyCellEditor;
|
|
|
|
|
import com.connor.jd.plm.table.MyCellEditor1;
|
|
|
|
|
import com.connor.jd.plm.table.TCTableUtil;
|
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
|
|
|
|
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
|
|
|
@ -80,9 +81,14 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
private List<String> disableEdit2;
|
|
|
|
|
private JRadioPanel sysl;
|
|
|
|
|
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[] 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",
|
|
|
|
|
"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",
|
|
|
|
|
"jd2_ctq8" };
|
|
|
|
|
|
|
|
|
|
public SampleConfirmationForm(TCComponent arg0) throws Exception {
|
|
|
|
|
super(arg0);
|
|
|
|
@ -195,8 +201,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
general.put("jd2_syyy", new int[] { 9, 10 });
|
|
|
|
|
model.setValueAt("目前阶段", 12, 0);
|
|
|
|
|
disableEdit.add("12,0");
|
|
|
|
|
mqjd = new JCheckPanel(
|
|
|
|
|
new String[] { "DV", "PV", "PR", "SR", "ÏÖ³¡²âÊÔ", "MP" });
|
|
|
|
|
mqjd = new JCheckPanel(new String[] { "DV", "PV", "PR", "SR", "ÏÖ³¡²âÊÔ", "MP" });
|
|
|
|
|
model.setValueAt(mqjd, 12, 2);
|
|
|
|
|
|
|
|
|
|
model.setValueAt("No", top, 0);
|
|
|
|
@ -294,22 +299,19 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
pic.put("jd2_qtbg", new int[] { bottom + 10, 7 });
|
|
|
|
|
|
|
|
|
|
// 合并单元格
|
|
|
|
|
model.combine(new int[] { 0, 1 },
|
|
|
|
|
new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });
|
|
|
|
|
model.combine(new int[] { 0, 1 }, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });
|
|
|
|
|
model.combine(new int[] { 0, 1 }, new int[] { 14, 15 });
|
|
|
|
|
model.combine(new int[] { 0, 1 }, new int[] { 16, 17 });
|
|
|
|
|
model.combine(new int[] { 0, 1 }, new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { 2, 3 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 2, 3 },
|
|
|
|
|
new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });
|
|
|
|
|
model.combine(new int[] { 2, 3 }, new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });
|
|
|
|
|
model.combine(new int[] { 2, 3 }, new int[] { 14, 15 });
|
|
|
|
|
model.combine(new int[] { 2, 3 }, new int[] { 16, 17 });
|
|
|
|
|
model.combine(new int[] { 2, 3 }, new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 2, 3, 4 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 5, 6 });
|
|
|
|
|
model.combine(new int[] { 4, 5 },
|
|
|
|
|
new int[] { 7, 8, 9, 10, 11, 12, 13 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 7, 8, 9, 10, 11, 12, 13 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 14, 15 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 16, 17 });
|
|
|
|
|
model.combine(new int[] { 4, 5 }, new int[] { 18, 19 });
|
|
|
|
@ -329,84 +331,59 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
model.combine(new int[] { 8 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 8 }, new int[] { 2, 3, 4, 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { 8 }, new int[] { 8, 9 });
|
|
|
|
|
model.combine(new int[] { 8 },
|
|
|
|
|
new int[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { 8 }, new int[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { 9 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 9 }, new int[] { 2, 3, 4, 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { 9, 10, 11 }, new int[] { 8, 9 });
|
|
|
|
|
model.combine(new int[] { 9, 10, 11 },
|
|
|
|
|
new int[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { 9, 10, 11 }, new int[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { 10 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 10 }, new int[] { 2, 3, 4, 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { 11 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 11 }, new int[] { 2, 3, 4, 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { 12 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 12 }, new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
|
|
|
|
11, 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { 12 }, new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { top, 1 }, new int[] { 0 });
|
|
|
|
|
model.combine(new int[] { top }, new int[] { 1, 2, 3, 4, 5, 6 });
|
|
|
|
|
model.combine(new int[] { top },
|
|
|
|
|
new int[] { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 });
|
|
|
|
|
model.combine(new int[] { top }, new int[] { 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 });
|
|
|
|
|
model.combine(new int[] { top, top + 1 }, new int[] { 19 });
|
|
|
|
|
model.combine(new int[] { top + 1 }, new int[] { 1, 2, 3, 4 });
|
|
|
|
|
model.combine(new int[] { top + 1 }, new int[] { 5, 6 });
|
|
|
|
|
model.combine(new int[] { bottom + 1 }, new int[] { 0, 1, 2, 3, 4, 5 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 2, 3 });
|
|
|
|
|
model.combine(
|
|
|
|
|
new int[] { bottom + 3, bottom + 4, bottom + 5, bottom + 6,
|
|
|
|
|
bottom + 7, bottom + 8, bottom + 9, bottom + 10,
|
|
|
|
|
bottom + 11, bottom + 12, bottom + 13 },
|
|
|
|
|
new int[] { 0, 1, 2, 3 });
|
|
|
|
|
model.combine(
|
|
|
|
|
new int[] { bottom + 2, bottom + 3, bottom + 4, bottom + 5 },
|
|
|
|
|
new int[] { 4 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5, bottom + 6, bottom + 7, bottom + 8, bottom + 9,
|
|
|
|
|
bottom + 10, bottom + 11, bottom + 12, bottom + 13 }, new int[] { 0, 1, 2, 3 });
|
|
|
|
|
model.combine(new int[] { bottom + 2, bottom + 3, bottom + 4, bottom + 5 }, new int[] { 4 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 15, 16, 17 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 4, bottom + 5 }, new int[] { 7, 8 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 },
|
|
|
|
|
new int[] { 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 },
|
|
|
|
|
new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 },
|
|
|
|
|
new int[] { 15, 16, 17 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 },
|
|
|
|
|
new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 }, new int[] { 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 }, new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 }, new int[] { 15, 16, 17 });
|
|
|
|
|
model.combine(new int[] { bottom + 3, bottom + 4, bottom + 5 }, new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 6, bottom + 7 }, new int[] { 4 });
|
|
|
|
|
model.combine(new int[] { bottom + 8, bottom + 9 }, new int[] { 4 });
|
|
|
|
|
model.combine(new int[] { bottom + 6, bottom + 7 }, new int[] { 5 });
|
|
|
|
|
model.combine(new int[] { bottom + 8, bottom + 9 }, new int[] { 5 });
|
|
|
|
|
model.combine(
|
|
|
|
|
new int[] { bottom + 6, bottom + 7, bottom + 8, bottom + 9 },
|
|
|
|
|
new int[] { 6 });
|
|
|
|
|
model.combine(new int[] { bottom + 6, bottom + 7, bottom + 8, bottom + 9 }, new int[] { 6 });
|
|
|
|
|
model.combine(new int[] { bottom + 6 }, new int[] { 7, 8 });
|
|
|
|
|
model.combine(new int[] { bottom + 6 }, new int[] { 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 6 }, new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 6 }, new int[] { 15, 16, 17 });
|
|
|
|
|
model.combine(new int[] { bottom + 6 }, new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 },
|
|
|
|
|
new int[] { 7, 8 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 },
|
|
|
|
|
new int[] { 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 },
|
|
|
|
|
new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 },
|
|
|
|
|
new int[] { 15, 16, 17 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 },
|
|
|
|
|
new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 }, new int[] { 7, 8 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 }, new int[] { 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 }, new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 }, new int[] { 15, 16, 17 });
|
|
|
|
|
model.combine(new int[] { bottom + 7, bottom + 8, bottom + 9 }, new int[] { 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 10 }, new int[] { 4, 5, 6 });
|
|
|
|
|
model.combine(new int[] { bottom + 11, bottom + 12, bottom + 13 },
|
|
|
|
|
new int[] { 4, 5, 6 });
|
|
|
|
|
model.combine(new int[] { bottom + 10, bottom + 11, bottom + 12,
|
|
|
|
|
bottom + 13 }, new int[] { 7, 8, 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 10, bottom + 11 },
|
|
|
|
|
new int[] { 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 12, bottom + 13 },
|
|
|
|
|
new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 12, bottom + 13 },
|
|
|
|
|
new int[] { 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 11, bottom + 12, bottom + 13 }, new int[] { 4, 5, 6 });
|
|
|
|
|
model.combine(new int[] { bottom + 10, bottom + 11, bottom + 12, bottom + 13 }, new int[] { 7, 8, 9, 10, 11 });
|
|
|
|
|
model.combine(new int[] { bottom + 10, bottom + 11 }, new int[] { 12, 13, 14, 15, 16, 17, 18, 19 });
|
|
|
|
|
model.combine(new int[] { bottom + 12, bottom + 13 }, new int[] { 12, 13, 14 });
|
|
|
|
|
model.combine(new int[] { bottom + 12, bottom + 13 }, new int[] { 15, 16, 17, 18, 19 });
|
|
|
|
|
|
|
|
|
|
table = new CTable(model) {
|
|
|
|
|
@Override
|
|
|
|
@ -429,14 +406,12 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
for (int i = 7; i < model.getColumnCount() - 1; i++) {
|
|
|
|
|
table.getColumnModel().getColumn(i).setPreferredWidth(45);
|
|
|
|
|
}
|
|
|
|
|
table.getColumnModel().getColumn(model.getColumnCount() - 1)
|
|
|
|
|
.setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(model.getColumnCount() - 1).setPreferredWidth(80);
|
|
|
|
|
DefaultTableCellRenderer tcr1 = new DefaultTableCellRenderer() {
|
|
|
|
|
// 重写方法
|
|
|
|
|
@Override
|
|
|
|
|
public Component getTableCellRendererComponent(JTable table,
|
|
|
|
|
Object value, boolean isSelected, boolean hasFocus, int row,
|
|
|
|
|
int column) {
|
|
|
|
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
|
|
|
|
boolean hasFocus, int row, int column) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
if (value instanceof JLabel) {
|
|
|
|
@ -450,10 +425,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
int maxPreferredHeight = 0;
|
|
|
|
|
for (int i = 0; i < table.getColumnCount(); i++) {
|
|
|
|
|
setText("" + table.getValueAt(row, i));
|
|
|
|
|
setSize(table.getColumnModel().getColumn(column).getWidth(),
|
|
|
|
|
0);
|
|
|
|
|
maxPreferredHeight = Math.max(maxPreferredHeight,
|
|
|
|
|
getPreferredSize().height);
|
|
|
|
|
setSize(table.getColumnModel().getColumn(column).getWidth(), 0);
|
|
|
|
|
maxPreferredHeight = Math.max(maxPreferredHeight, getPreferredSize().height);
|
|
|
|
|
}
|
|
|
|
|
setBackground(Color.white);
|
|
|
|
|
// if(points1.contains(new Point(row,column)))
|
|
|
|
@ -474,8 +447,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()));
|
|
|
|
|
}
|
|
|
|
|
table.addMouseListener(rightClick());
|
|
|
|
|
confirmPanel.add(table, BorderLayout.CENTER);
|
|
|
|
@ -484,11 +456,9 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
prop = form.getProperties();
|
|
|
|
|
for (Entry<String, int[]> entry : general.entrySet()) {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
model.setValueAt(prop.get(entry.getKey()), entry.getValue()[0],
|
|
|
|
|
entry.getValue()[1]);
|
|
|
|
|
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.getKey(), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
System.out.println("属性‘" + entry.getKey() + "’未找到");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -509,11 +479,9 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
TCComponentDataset dataset = (TCComponentDataset) comp;
|
|
|
|
|
String temp = System.getenv("temp");
|
|
|
|
|
System.out.println(temp);
|
|
|
|
|
String[] types = dataset.getProperty("ref_names")
|
|
|
|
|
.split(",");
|
|
|
|
|
String[] types = dataset.getProperty("ref_names").split(",");
|
|
|
|
|
System.out.println(Arrays.toString(types));
|
|
|
|
|
System.out.println(Arrays
|
|
|
|
|
.toString(dataset.getFileNames(types[0])));
|
|
|
|
|
System.out.println(Arrays.toString(dataset.getFileNames(types[0])));
|
|
|
|
|
File img = dataset.getFiles(types[0], temp)[0];
|
|
|
|
|
System.out.println(img.getPath());
|
|
|
|
|
|
|
|
|
@ -527,10 +495,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
}
|
|
|
|
|
System.out.println("row:" + arr[0] + ",col:" + arr[1]);
|
|
|
|
|
icon.setImage(icon.getImage().getScaledInstance(
|
|
|
|
|
table.getColumnModel().getColumn(col)
|
|
|
|
|
.getPreferredWidth() * arr[1],
|
|
|
|
|
table.getRowHeight() * arr[0],
|
|
|
|
|
Image.SCALE_SMOOTH));
|
|
|
|
|
table.getColumnModel().getColumn(col).getPreferredWidth() * arr[1],
|
|
|
|
|
table.getRowHeight() * arr[0], Image.SCALE_SMOOTH));
|
|
|
|
|
JLabel label = new JLabel();
|
|
|
|
|
label.setLayout(new FlowLayout(FlowLayout.CENTER));
|
|
|
|
|
label.setIcon(icon);
|
|
|
|
@ -543,28 +509,23 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
model.setValueAt(new JLabel(entry.getKey()),
|
|
|
|
|
entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
model.setValueAt(new JLabel(entry.getKey()), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
System.out.println("属性‘" + entry.getKey() + "’未找到");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ypqrdtable")) {
|
|
|
|
|
String[][] tableRows = TCTableUtil.getTableRows(form,
|
|
|
|
|
"jd2_ypqrdtable", colNames);
|
|
|
|
|
String[][] tableRows = TCTableUtil.getTableRows(form, "jd2_ypqrdtable", colNames);
|
|
|
|
|
System.out.println(Arrays.deepToString(tableRows));
|
|
|
|
|
for (int i = 0; i < tableRows.length; i++) {
|
|
|
|
|
for (int ii = 0; ii < tableRows[0].length; ii++) {
|
|
|
|
|
if (i + top + 2 > bottom) {
|
|
|
|
|
int num = Integer.parseInt(
|
|
|
|
|
model.getValueAt(bottom, 0).toString());
|
|
|
|
|
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 });
|
|
|
|
|
model.combine(new int[] { bottom }, new int[] { 2, 3, 4 });
|
|
|
|
|
bottom = model.getRowCount() - end;
|
|
|
|
|
}
|
|
|
|
|
model.setValueAt(tableRows[i][ii], i + top + 2,
|
|
|
|
|
ii > 2 ? ii + 2 : ii);
|
|
|
|
|
model.setValueAt(tableRows[i][ii], i + top + 2, ii > 2 ? ii + 2 : ii);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -577,6 +538,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
|
|
|
|
|
model2 = new CTMap(49, 10);
|
|
|
|
|
bottom2 = model2.getRowCount() - end2;
|
|
|
|
|
disableEdit2 = new ArrayList<String>();
|
|
|
|
|
model2.setValueAt("SPL No", 0, 0);
|
|
|
|
|
disableEdit2.add("0,0");
|
|
|
|
|
model2.combine(new int[] { 0, 1, 2, 3 }, new int[] { 0 });
|
|
|
|
@ -584,7 +546,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
disableEdit2.add("0,1");
|
|
|
|
|
model2.combine(new int[] { 0, 1 }, new int[] { 1 });
|
|
|
|
|
for (int i = 0; i < 8; i++) {
|
|
|
|
|
model2.setValueAt("CTQ<" + i + 1 + ">", 0, i + 2);
|
|
|
|
|
model2.setValueAt("CTQ<" + (i + 1) + ">", 0, i + 2);
|
|
|
|
|
disableEdit2.add("0," + (i + 2));
|
|
|
|
|
}
|
|
|
|
|
model2.setValueAt("LOW", 2, 1);
|
|
|
|
@ -592,8 +554,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
model2.setValueAt("UP", 3, 1);
|
|
|
|
|
disableEdit2.add("3,1");
|
|
|
|
|
|
|
|
|
|
for (int i = top2; i <= model2.getRowCount(); i++) {
|
|
|
|
|
model2.setValueAt(i - top2, i, 0);
|
|
|
|
|
for (int i = top2; i < model2.getRowCount(); i++) {
|
|
|
|
|
model2.setValueAt(i - top2 + 1, i, 0);
|
|
|
|
|
disableEdit2.add(i + ",0");
|
|
|
|
|
model2.combine(new int[] { i }, new int[] { 0, 1 });
|
|
|
|
|
}
|
|
|
|
@ -614,6 +576,11 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
model2.setValueAt("工程能力意义", bottom + 15, 0);
|
|
|
|
|
|
|
|
|
|
table2 = new CTable(model2) {
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isCellEditable(int row, int col) {
|
|
|
|
|
if (isEditorDisable(disableEdit2, row, col)) {
|
|
|
|
@ -624,23 +591,20 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
};
|
|
|
|
|
table2.setRowHeight(25);
|
|
|
|
|
table2.setBorder(BorderFactory.createLineBorder(Color.black));
|
|
|
|
|
for (int i = 0; i < model.getColumnCount(); i++) {
|
|
|
|
|
for (int i = 0; i < model2.getColumnCount(); i++) {
|
|
|
|
|
table2.getColumnModel().getColumn(i).setPreferredWidth(80);
|
|
|
|
|
}
|
|
|
|
|
DefaultTableCellRenderer tcr2 = new DefaultTableCellRenderer() {
|
|
|
|
|
// 重写方法
|
|
|
|
|
@Override
|
|
|
|
|
public Component getTableCellRendererComponent(JTable table,
|
|
|
|
|
Object value, boolean isSelected, boolean hasFocus, int row,
|
|
|
|
|
int column) {
|
|
|
|
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
|
|
|
|
boolean hasFocus, int row, int column) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int maxPreferredHeight = 0;
|
|
|
|
|
for (int i = 0; i < table.getColumnCount(); i++) {
|
|
|
|
|
setText("" + table.getValueAt(row, i));
|
|
|
|
|
setSize(table.getColumnModel().getColumn(column).getWidth(),
|
|
|
|
|
0);
|
|
|
|
|
maxPreferredHeight = Math.max(maxPreferredHeight,
|
|
|
|
|
getPreferredSize().height);
|
|
|
|
|
setSize(table.getColumnModel().getColumn(column).getWidth(), 0);
|
|
|
|
|
maxPreferredHeight = Math.max(maxPreferredHeight, getPreferredSize().height);
|
|
|
|
|
}
|
|
|
|
|
setBackground(Color.white);
|
|
|
|
|
// if(points1.contains(new Point(row,column)))
|
|
|
|
@ -660,8 +624,58 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
};
|
|
|
|
|
tcr2.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
|
table2.setDefaultRenderer(Object.class, tcr2);
|
|
|
|
|
MyCellEditor1[] editor1 = new MyCellEditor1[model2.getColumnCount()];
|
|
|
|
|
for (int i = 0; i < model2.getColumnCount(); i++) {
|
|
|
|
|
editor1[i] = new MyCellEditor1(new JTextField(), top2, end2, bottom2);
|
|
|
|
|
table2.getColumnModel().getColumn(i).setCellEditor(editor1[i]);
|
|
|
|
|
}
|
|
|
|
|
table2.addMouseListener(rightClick2());
|
|
|
|
|
examinePanel.add(table2, BorderLayout.CENTER);
|
|
|
|
|
if (prop.containsKey("jd2_ctq1")) {
|
|
|
|
|
String[][] tableRows = TCTableUtil.getTableRows(form, "jd2_ctq1", colNames1);
|
|
|
|
|
System.out.println(Arrays.deepToString(tableRows));
|
|
|
|
|
for (int i = 0; i < tableRows.length; i++) {
|
|
|
|
|
for (int ii = 0; ii < tableRows[0].length; ii++) {
|
|
|
|
|
model2.setValueAt(tableRows[i][ii], i + 1, ii + 2);
|
|
|
|
|
if (i == 1) {
|
|
|
|
|
if (!"".equals(tableRows[i][ii])) {
|
|
|
|
|
editor1[ii + 2].setLow(Double.parseDouble(tableRows[i][ii]));
|
|
|
|
|
editor1[ii + 2].setCnt(editor1[ii + 2].getCnt() + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (i == 2) {
|
|
|
|
|
if (!"".equals(tableRows[i][ii])) {
|
|
|
|
|
editor1[ii + 2].setUp(Double.parseDouble(tableRows[i][ii]));
|
|
|
|
|
editor1[ii + 2].setCnt(editor1[ii + 2].getCnt() + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq2")) {
|
|
|
|
|
String[][] tableRows = TCTableUtil.getTableRows(form, "jd2_ctq2", colNames2);
|
|
|
|
|
System.out.println(Arrays.deepToString(tableRows));
|
|
|
|
|
for (int i = 0; i < tableRows.length; i++) {
|
|
|
|
|
for (int ii = 0; ii < tableRows[0].length; ii++) {
|
|
|
|
|
if (i + top2 > 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 });
|
|
|
|
|
}
|
|
|
|
|
model2.setValueAt(tableRows[i][ii], i + top2, ii > 0 ? ii + 1 : ii);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq3")) {
|
|
|
|
|
String[][] tableRows = TCTableUtil.getTableRows(form, "jd2_ctq3", colNames3);
|
|
|
|
|
System.out.println(Arrays.deepToString(tableRows));
|
|
|
|
|
for (int i = 0; i < tableRows.length; i++) {
|
|
|
|
|
for (int ii = 0; ii < tableRows[0].length; ii++) {
|
|
|
|
|
model2.setValueAt(tableRows[i][ii], i + bottom2 + 1, ii + 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollPane examineScrollPanel = new ScrollPane();
|
|
|
|
|
examineScrollPanel.add(examinePanel);
|
|
|
|
@ -715,8 +729,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
JLabel label = null;
|
|
|
|
|
for (Entry<String, int[]> entry : pic.entrySet()) {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
label = (JLabel) model.getValueAt(entry.getValue()[0],
|
|
|
|
|
entry.getValue()[1]);
|
|
|
|
|
label = (JLabel) model.getValueAt(entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
try {
|
|
|
|
|
form.setProperty(entry.getKey(), label.getToolTipText());
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
@ -729,12 +742,10 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
// 保存选择
|
|
|
|
|
try {
|
|
|
|
|
if (prop.containsKey("jd2_sysl")) {
|
|
|
|
|
form.setProperty("jd2_sysl", sysl.getSelected() == null ? ""
|
|
|
|
|
: sysl.getSelected().getText());
|
|
|
|
|
form.setProperty("jd2_sysl", sysl.getSelected() == null ? "" : sysl.getSelected().getText());
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_mqjd")) {
|
|
|
|
|
form.setProperty("jd2_mqjd", mqjd.getSelectedText() == null ? ""
|
|
|
|
|
: mqjd.getSelectedText());
|
|
|
|
|
form.setProperty("jd2_mqjd", mqjd.getSelectedText() == null ? "" : mqjd.getSelectedText());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
@ -746,8 +757,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
try {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
form.setProperty(entry.getKey(),
|
|
|
|
|
model.getValueAt(entry.getValue()[0],
|
|
|
|
|
entry.getValue()[1]).toString());
|
|
|
|
|
model.getValueAt(entry.getValue()[0], entry.getValue()[1]).toString());
|
|
|
|
|
}
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
@ -758,25 +768,91 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
if (prop.containsKey("jd2_ypqrdtable")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
|
int num = 0;
|
|
|
|
|
while (model.getValueAt(top + 2 + num, 1) != null
|
|
|
|
|
&& !"".equals(model.getValueAt(top + 2 + num, 1))) {
|
|
|
|
|
while (model.getValueAt(top + 2 + num, 1) != null && !"".equals(model.getValueAt(top + 2 + num, 1))) {
|
|
|
|
|
String[] row = new String[18];
|
|
|
|
|
for (int ii = 0; ii < 18; ii++) {
|
|
|
|
|
Object object = model.getValueAt(top + 2 + num,
|
|
|
|
|
ii > 2 ? ii + 2 : ii);
|
|
|
|
|
for (int ii = 0; ii < row.length; ii++) {
|
|
|
|
|
Object object = model.getValueAt(top + 2 + num, ii > 2 ? ii + 2 : ii);
|
|
|
|
|
if (object == null) {
|
|
|
|
|
row[ii] = "";
|
|
|
|
|
} else {
|
|
|
|
|
row[ii] = object.toString();
|
|
|
|
|
}
|
|
|
|
|
System.out.println(row[ii]);
|
|
|
|
|
}
|
|
|
|
|
data.add(row);
|
|
|
|
|
num++;
|
|
|
|
|
if (top + 2 + num > bottom) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ypqrdtable", "JD2_YPQRDTABLE", colNames, dataArr);
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq1")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
|
int num = 0;
|
|
|
|
|
while (num < 3) {
|
|
|
|
|
String[] row = new String[8];
|
|
|
|
|
for (int ii = 0; ii < row.length; ii++) {
|
|
|
|
|
Object object = model2.getValueAt(num + 1, ii + 2);
|
|
|
|
|
if (object == null) {
|
|
|
|
|
row[ii] = "";
|
|
|
|
|
} else {
|
|
|
|
|
row[ii] = object.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data.add(row);
|
|
|
|
|
num++;
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq1", "JD2_CTQ1", colNames1, dataArr);
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq2")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
|
int num = 0;
|
|
|
|
|
while (model2.getValueAt(top2 + num, 2) != null && !"".equals(model2.getValueAt(top2 + num, 2))) {
|
|
|
|
|
String[] row = new String[9];
|
|
|
|
|
for (int ii = 0; ii < row.length; ii++) {
|
|
|
|
|
Object object = model2.getValueAt(top2 + num, ii > 0 ? ii + 1 : ii);
|
|
|
|
|
if (object == null) {
|
|
|
|
|
row[ii] = "";
|
|
|
|
|
} else {
|
|
|
|
|
row[ii] = object.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data.add(row);
|
|
|
|
|
num++;
|
|
|
|
|
if (top2 + num > bottom2) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq2", "JD2_CTQ2", colNames2, dataArr);
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_ctq3")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
|
int num = 0;
|
|
|
|
|
while (num < end2 - 1) {
|
|
|
|
|
String[] row = new String[8];
|
|
|
|
|
for (int ii = 0; ii < row.length; ii++) {
|
|
|
|
|
Object object = model2.getValueAt(bottom2 + 1 + num, ii + 2);
|
|
|
|
|
if (object == null) {
|
|
|
|
|
row[ii] = "";
|
|
|
|
|
} else {
|
|
|
|
|
row[ii] = object.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data.add(row);
|
|
|
|
|
num++;
|
|
|
|
|
if (bottom2 + 1 + num > model2.getRowCount()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ypqrdtable", colNames, dataArr);
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_ctq3", "JD2_CTQ3", colNames3, dataArr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -810,8 +886,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
MouseAdapter mouseAdapter = new MouseAdapter() {
|
|
|
|
|
@Override
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
if (e.getButton() == MouseEvent.BUTTON3 && form.isCheckedOut()
|
|
|
|
|
&& table.getSelectedRow() != -1) {
|
|
|
|
|
if (e.getButton() == MouseEvent.BUTTON3 && form.isCheckedOut() && table.getSelectedRow() != -1) {
|
|
|
|
|
menu.show(e.getComponent(), e.getX(), e.getY());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -823,8 +898,7 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
MouseAdapter mouseAdapter = new MouseAdapter() {
|
|
|
|
|
@Override
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
if (e.getButton() == MouseEvent.BUTTON3 && form.isCheckedOut()
|
|
|
|
|
&& table2.getSelectedRow() != -1) {
|
|
|
|
|
if (e.getButton() == MouseEvent.BUTTON3 && form.isCheckedOut() && table2.getSelectedRow() != -1) {
|
|
|
|
|
menu2.show(e.getComponent(), e.getX(), e.getY());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -852,10 +926,8 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean accept(File var1) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
return var1.getName().endsWith(".png")
|
|
|
|
|
|| var1.getName().endsWith(".jpg")
|
|
|
|
|
|| var1.getName().endsWith(".jpeg")
|
|
|
|
|
|| var1.getName().endsWith(".bmp");
|
|
|
|
|
return var1.getName().endsWith(".png") || var1.getName().endsWith(".jpg")
|
|
|
|
|
|| var1.getName().endsWith(".jpeg") || var1.getName().endsWith(".bmp");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
fileChooser.showOpenDialog(menu);// 参数表示定位
|
|
|
|
@ -866,15 +938,12 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
String as2[] = { "Image" };
|
|
|
|
|
TCComponentDatasetType datasetType;
|
|
|
|
|
try {
|
|
|
|
|
datasetType = (TCComponentDatasetType) session
|
|
|
|
|
.getTypeComponent("Dataset");
|
|
|
|
|
TCComponentDataset dataset = datasetType
|
|
|
|
|
.create(file.getName(), "", "Image");
|
|
|
|
|
datasetType = (TCComponentDatasetType) session.getTypeComponent("Dataset");
|
|
|
|
|
TCComponentDataset dataset = datasetType.create(file.getName(), "", "Image");
|
|
|
|
|
dataset.setFiles(as1, as2);
|
|
|
|
|
TCComponent[] comps = form.getRelatedComponents();
|
|
|
|
|
AIFComponentContext[] ref = form.whereReferenced();
|
|
|
|
|
TCComponentItemRevision rev = (TCComponentItemRevision) ref[0]
|
|
|
|
|
.getComponent();
|
|
|
|
|
TCComponentItemRevision rev = (TCComponentItemRevision) ref[0].getComponent();
|
|
|
|
|
rev.add("IMAN_specification", dataset);
|
|
|
|
|
String uid = dataset.getUid();
|
|
|
|
|
System.out.println("uid:" + uid);
|
|
|
|
@ -884,17 +953,14 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
int[] arr = model.getSpan(row, col);
|
|
|
|
|
System.out.println("row:" + arr[0] + ",col:" + arr[1]);
|
|
|
|
|
icon.setImage(icon.getImage().getScaledInstance(
|
|
|
|
|
table.getColumnModel().getColumn(col)
|
|
|
|
|
.getPreferredWidth() * arr[1],
|
|
|
|
|
table.getRowHeight() * arr[0],
|
|
|
|
|
Image.SCALE_SMOOTH));
|
|
|
|
|
table.getColumnModel().getColumn(col).getPreferredWidth() * arr[1],
|
|
|
|
|
table.getRowHeight() * arr[0], Image.SCALE_SMOOTH));
|
|
|
|
|
JLabel label = new JLabel();
|
|
|
|
|
label.setLayout(new FlowLayout(FlowLayout.CENTER));
|
|
|
|
|
label.setIcon(icon);
|
|
|
|
|
label.addMouseListener(showImg(file.getPath()));
|
|
|
|
|
label.setToolTipText(uid);
|
|
|
|
|
model.setValueAt(label, table.getSelectedRow(),
|
|
|
|
|
table.getSelectedColumn());
|
|
|
|
|
model.setValueAt(label, table.getSelectedRow(), table.getSelectedColumn());
|
|
|
|
|
} catch (TCException e1) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e1.printStackTrace();
|
|
|
|
@ -913,13 +979,11 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
if (row > top + 1 && row < bottom + 1) {
|
|
|
|
|
int num = Integer
|
|
|
|
|
.parseInt(model.getValueAt(bottom, 0).toString());
|
|
|
|
|
model.insertRow(bottom);
|
|
|
|
|
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 });
|
|
|
|
|
bottom = model.getRowCount() - end;
|
|
|
|
|
} else {
|
|
|
|
|
// 提示
|
|
|
|
|
}
|
|
|
|
@ -936,12 +1000,10 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
// 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);
|
|
|
|
|
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 });
|
|
|
|
|
bottom2 = model2.getRowCount() - end2;
|
|
|
|
|
} else {
|
|
|
|
|
// 提示
|
|
|
|
|
}
|
|
|
|
@ -957,15 +1019,14 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
if (row > top + 1 && row < bottom + 1) {
|
|
|
|
|
int num = Integer
|
|
|
|
|
.parseInt(model.getValueAt(row, 0).toString());
|
|
|
|
|
if (row >= top && row <= bottom) {
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(row, 0).toString());
|
|
|
|
|
model.insertRow(row);
|
|
|
|
|
for (int i = row; i < model.getRowCount(); i++) {
|
|
|
|
|
model.setValueAt(num + i + 1 - row, row, 0);
|
|
|
|
|
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 });
|
|
|
|
|
bottom = model.getRowCount() - end;
|
|
|
|
|
} else {
|
|
|
|
|
// 提示
|
|
|
|
|
}
|
|
|
|
@ -982,14 +1043,13 @@ public class SampleConfirmationForm extends AbstractRendering {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table2.getSelectedRow();
|
|
|
|
|
if (row >= top2 && row <= bottom2) {
|
|
|
|
|
int num = Integer
|
|
|
|
|
.parseInt(model2.getValueAt(row, 0).toString());
|
|
|
|
|
int num = Integer.parseInt(model2.getValueAt(row, 0).toString());
|
|
|
|
|
model2.insertRow(row);
|
|
|
|
|
for (int i = row; i < model2.getRowCount(); i++) {
|
|
|
|
|
model2.setValueAt(num + i + 1 - row, row, 0);
|
|
|
|
|
bottom2++;
|
|
|
|
|
for (int i = row; i <= bottom2; i++) {
|
|
|
|
|
model2.setValueAt(num + i - row, i, 0);
|
|
|
|
|
}
|
|
|
|
|
model2.combine(new int[] { row }, new int[] { 0, 1 });
|
|
|
|
|
bottom2 = model2.getRowCount() - end2;
|
|
|
|
|
} else {
|
|
|
|
|
// 提示
|
|
|
|
|
}
|
|
|
|
|