|
|
|
@ -0,0 +1,411 @@
|
|
|
|
|
package com.connor.jd.plm.form;
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.Color;
|
|
|
|
|
import java.awt.Component;
|
|
|
|
|
import java.awt.Dimension;
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
import java.awt.event.MouseAdapter;
|
|
|
|
|
import java.awt.event.MouseEvent;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory;
|
|
|
|
|
import javax.swing.JMenuItem;
|
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
|
import javax.swing.JPopupMenu;
|
|
|
|
|
import javax.swing.JTable;
|
|
|
|
|
import javax.swing.JTextField;
|
|
|
|
|
import javax.swing.SwingConstants;
|
|
|
|
|
import javax.swing.table.DefaultTableCellRenderer;
|
|
|
|
|
|
|
|
|
|
import com.connor.jd.plm.table.CTMap;
|
|
|
|
|
import com.connor.jd.plm.table.CTable;
|
|
|
|
|
import com.connor.jd.plm.table.JCheckPanel;
|
|
|
|
|
import com.connor.jd.plm.table.MyCellEditor3;
|
|
|
|
|
import com.connor.jd.plm.table.TCTableUtil;
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponent;
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentForm;
|
|
|
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
|
|
|
import com.teamcenter.rac.stylesheet.AbstractRendering;
|
|
|
|
|
|
|
|
|
|
public class ExperimentalPowerOfAttorneyForm extends AbstractRendering {
|
|
|
|
|
private TCComponentForm form;
|
|
|
|
|
private CTMap model;
|
|
|
|
|
private CTable table;
|
|
|
|
|
private int top = 10;
|
|
|
|
|
private int end = 4;
|
|
|
|
|
private int bottom;
|
|
|
|
|
private Map<String, String> prop;
|
|
|
|
|
private List<String> disableEdit;
|
|
|
|
|
private Map<String, int[]> general;
|
|
|
|
|
private JCheckPanel bgqf;
|
|
|
|
|
private JPopupMenu menu = new JPopupMenu();
|
|
|
|
|
private JMenuItem addR;
|
|
|
|
|
private JMenuItem delR;
|
|
|
|
|
private JMenuItem test;
|
|
|
|
|
private String[] colNames = new String[] { "jd2_no", "jd2_name", "jd2_bgq", "jd2_bgh", "jd2_risk", "jd2_csjh",
|
|
|
|
|
"jd2_bz" };
|
|
|
|
|
private String[][] rows;
|
|
|
|
|
|
|
|
|
|
public ExperimentalPowerOfAttorneyForm(TCComponent arg0) throws Exception {
|
|
|
|
|
super(arg0);
|
|
|
|
|
if (arg0 instanceof TCComponentForm) {
|
|
|
|
|
this.form = (TCComponentForm) arg0;
|
|
|
|
|
loadRendering();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void loadRendering() throws TCException {
|
|
|
|
|
this.setLayout(new BorderLayout());
|
|
|
|
|
JPanel root = new JPanel(new BorderLayout());
|
|
|
|
|
root.setPreferredSize(new Dimension(800, 600));
|
|
|
|
|
|
|
|
|
|
// 内容
|
|
|
|
|
prop = form.getProperties();
|
|
|
|
|
model = new CTMap(20, 11);
|
|
|
|
|
bottom = model.getRowCount() - end;
|
|
|
|
|
disableEdit = new ArrayList<>();// 不允许编辑
|
|
|
|
|
general = new HashMap<String, int[]>();// 要填写的一般属性
|
|
|
|
|
model.setValueAt("吉德", 0, 0);
|
|
|
|
|
disableEdit.add("0,0");
|
|
|
|
|
model.setValueAt("试验委托书", 0, 3);
|
|
|
|
|
disableEdit.add("0,3");
|
|
|
|
|
model.setValueAt("表号", 0, 8);
|
|
|
|
|
disableEdit.add("0,8");
|
|
|
|
|
model.setValueAt("生效期", 1, 8);
|
|
|
|
|
disableEdit.add("1,8");
|
|
|
|
|
general.put("jd2_bh", new int[] { 0, 9 });
|
|
|
|
|
general.put("jd2_sxq", new int[] { 1, 9 });
|
|
|
|
|
model.setValueAt("委托项目:", 3, 0);
|
|
|
|
|
disableEdit.add("3,0");
|
|
|
|
|
model.setValueAt("委托部门:", 4, 0);
|
|
|
|
|
disableEdit.add("4,0");
|
|
|
|
|
general.put("jd2_wtxm", new int[] { 3, 3 });
|
|
|
|
|
general.put("jd2_wtbm", new int[] { 4, 3 });
|
|
|
|
|
model.setValueAt("供货厂家:", 3, 6);
|
|
|
|
|
disableEdit.add("3,6");
|
|
|
|
|
model.setValueAt("接受部门:", 4, 6);
|
|
|
|
|
disableEdit.add("4,6");
|
|
|
|
|
general.put("jd2_ghcj", new int[] { 3, 8 });
|
|
|
|
|
general.put("jd2_jsbm", new int[] { 4, 8 });
|
|
|
|
|
model.setValueAt("变更区分:", 5, 0);
|
|
|
|
|
bgqf = new JCheckPanel(new String[] { "复制模", "降本", "二元化", "改善优化", "新规部品" });
|
|
|
|
|
model.setValueAt(bgqf, 5, 2);
|
|
|
|
|
model.setValueAt("部品型号:", 7, 0);
|
|
|
|
|
disableEdit.add("7,0");
|
|
|
|
|
general.put("jd2_bpxh", new int[] { 7, 2 });
|
|
|
|
|
model.setValueAt("适用型号:", 7, 6);
|
|
|
|
|
disableEdit.add("7,6");
|
|
|
|
|
general.put("jd2_syxh", new int[] { 7, 7 });
|
|
|
|
|
model.setValueAt("变更内容", 8, 0);
|
|
|
|
|
disableEdit.add("8,0");
|
|
|
|
|
|
|
|
|
|
model.setValueAt("NO", top, 0);
|
|
|
|
|
disableEdit.add(top + ",0");
|
|
|
|
|
model.setValueAt("名称", top, 1);
|
|
|
|
|
disableEdit.add(top + ",1");
|
|
|
|
|
model.setValueAt("变更前", top, 2);
|
|
|
|
|
disableEdit.add(top + ",2");
|
|
|
|
|
model.setValueAt("变更后", top, 5);
|
|
|
|
|
disableEdit.add(top + ",5");
|
|
|
|
|
model.setValueAt("Risk", top, 8);
|
|
|
|
|
disableEdit.add(top + ",8");
|
|
|
|
|
model.setValueAt("测试计划", top, 9);
|
|
|
|
|
disableEdit.add(top + ",9");
|
|
|
|
|
model.setValueAt("备注", top, 10);
|
|
|
|
|
disableEdit.add(top + ",10");
|
|
|
|
|
|
|
|
|
|
model.setValueAt("预计完成日期:", bottom, 0);
|
|
|
|
|
disableEdit.add(bottom + ",0");
|
|
|
|
|
general.put("jd2_yjwcrq", new int[] { bottom, 2 });
|
|
|
|
|
model.setValueAt("编制签名:", bottom + 1, 0);
|
|
|
|
|
disableEdit.add(bottom + 1 + ",0");
|
|
|
|
|
model.setValueAt("批准签名:", bottom + 2, 0);
|
|
|
|
|
disableEdit.add(bottom + 3 + ",0");
|
|
|
|
|
general.put("jd2_bz", new int[] { bottom + 2, 2 });
|
|
|
|
|
general.put("jd2_pz", new int[] { bottom + 3, 2 });
|
|
|
|
|
model.setValueAt("编制时间:", bottom + 2, 5);
|
|
|
|
|
disableEdit.add(bottom + 2 + ",5");
|
|
|
|
|
model.setValueAt("批准时间:", bottom + 3, 5);
|
|
|
|
|
disableEdit.add(bottom + 3 + ",5");
|
|
|
|
|
general.put("jd2_bzrq", new int[] { bottom + 2, 8 });
|
|
|
|
|
general.put("jd2_pzrq", new int[] { bottom + 3, 8 });
|
|
|
|
|
|
|
|
|
|
model.combine(new int[] { 0, 1, 2 }, new int[] { 0, 1, 2 });
|
|
|
|
|
model.combine(new int[] { 0, 1, 2 }, new int[] { 3, 4, 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { 0 }, new int[] { 9, 10 });
|
|
|
|
|
model.combine(new int[] { 1 }, new int[] { 9, 10 });
|
|
|
|
|
model.combine(new int[] { 2 }, new int[] { 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { 3 }, new int[] { 0, 1, 2 });
|
|
|
|
|
model.combine(new int[] { 3 }, new int[] { 3, 4, 5 });
|
|
|
|
|
model.combine(new int[] { 3 }, new int[] { 6, 7 });
|
|
|
|
|
model.combine(new int[] { 3 }, new int[] { 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { 4 }, new int[] { 0, 1, 2 });
|
|
|
|
|
model.combine(new int[] { 4 }, new int[] { 3, 4, 5 });
|
|
|
|
|
model.combine(new int[] { 4 }, new int[] { 6, 7 });
|
|
|
|
|
model.combine(new int[] { 4 }, new int[] { 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { 5 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 5 }, new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { 6 }, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { 7 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { 7 }, new int[] { 2, 3, 4, 5 });
|
|
|
|
|
model.combine(new int[] { 7 }, new int[] { 7, 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { 8, 9 }, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { top }, new int[] { 2, 3, 4 });
|
|
|
|
|
model.combine(new int[] { top }, new int[] { 5, 6, 7 });
|
|
|
|
|
for (int i = top + 1; i <= bottom; i++) {
|
|
|
|
|
model.combine(new int[] { i }, new int[] { 2, 3, 4 });
|
|
|
|
|
model.combine(new int[] { i }, new int[] { 5, 6, 7 });
|
|
|
|
|
model.setValueAt(i - top, i, 0);
|
|
|
|
|
disableEdit.add(i + ",0");
|
|
|
|
|
}
|
|
|
|
|
model.combine(new int[] { bottom + 1 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { bottom + 1 }, new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 2, 3, 4 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { bottom + 2 }, new int[] { 8, 9, 10 });
|
|
|
|
|
model.combine(new int[] { bottom + 3 }, new int[] { 0, 1 });
|
|
|
|
|
model.combine(new int[] { bottom + 3 }, new int[] { 2, 3, 4 });
|
|
|
|
|
model.combine(new int[] { bottom + 3 }, new int[] { 5, 6, 7 });
|
|
|
|
|
model.combine(new int[] { bottom + 3 }, new int[] { 8, 9, 10 });
|
|
|
|
|
|
|
|
|
|
table = new CTable(model) {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isCellEditable(int row, int col) {
|
|
|
|
|
if (isEditorDisable(disableEdit, row, col)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
table.setRowHeight(25);
|
|
|
|
|
table.setBorder(BorderFactory.createLineBorder(Color.black));
|
|
|
|
|
table.getColumnModel().getColumn(0).setPreferredWidth(40);
|
|
|
|
|
table.getColumnModel().getColumn(1).setPreferredWidth(100);
|
|
|
|
|
table.getColumnModel().getColumn(2).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(3).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(4).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(5).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(6).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(7).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(8).setPreferredWidth(80);
|
|
|
|
|
table.getColumnModel().getColumn(9).setPreferredWidth(150);
|
|
|
|
|
table.getColumnModel().getColumn(10).setPreferredWidth(60);
|
|
|
|
|
|
|
|
|
|
DefaultTableCellRenderer tcr1 = new DefaultTableCellRenderer() {
|
|
|
|
|
// 重写方法
|
|
|
|
|
@Override
|
|
|
|
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
|
|
|
|
boolean hasFocus, int row, int column) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
if (value instanceof JPanel) {
|
|
|
|
|
return (JPanel) value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
setBackground(Color.white);
|
|
|
|
|
// if(points1.contains(new Point(row,column)))
|
|
|
|
|
// setForeground(new Color(0,0,255));
|
|
|
|
|
// else
|
|
|
|
|
setForeground(Color.black);
|
|
|
|
|
if (isSelected) {
|
|
|
|
|
setBackground(new Color(0, 120, 215));
|
|
|
|
|
setForeground(Color.white);
|
|
|
|
|
}
|
|
|
|
|
if (table.getRowHeight(row) != maxPreferredHeight) // 少了这行则处理器瞎忙
|
|
|
|
|
table.setRowHeight(row, maxPreferredHeight);
|
|
|
|
|
|
|
|
|
|
setText(value == null ? "" : value.toString());
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
tcr1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
|
table.setDefaultRenderer(Object.class, tcr1);
|
|
|
|
|
table.getColumnModel().getColumn(2).setCellEditor(new MyCellEditor3(new JTextField()));
|
|
|
|
|
table.addMouseListener(rightClick());
|
|
|
|
|
|
|
|
|
|
// 右键菜单
|
|
|
|
|
menu.setVisible(false);
|
|
|
|
|
addR = new JMenuItem("新增行");
|
|
|
|
|
addR.setEnabled(false);
|
|
|
|
|
menu.add(addR);
|
|
|
|
|
addR.addActionListener(addRow());
|
|
|
|
|
delR = new JMenuItem("删除行");
|
|
|
|
|
delR.setEnabled(false);
|
|
|
|
|
menu.add(delR);
|
|
|
|
|
delR.addActionListener(delRow());
|
|
|
|
|
test = new JMenuItem("测试项");
|
|
|
|
|
test.setEnabled(false);
|
|
|
|
|
menu.add(test);
|
|
|
|
|
test.addActionListener(test());
|
|
|
|
|
|
|
|
|
|
// 填写数据
|
|
|
|
|
for (Entry<String, int[]> entry : general.entrySet()) {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
model.setValueAt(prop.get(entry.getKey()), entry.getValue()[0], entry.getValue()[1]);
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("未找到属性 " + entry.getKey());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_bgqf")) {
|
|
|
|
|
bgqf.setSelected(prop.get("jd2_bgqf"));
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("未找到属性 jd2_bgqf");
|
|
|
|
|
}
|
|
|
|
|
rows = TCTableUtil.getTableRows(form, "jd2_sywts", colNames);
|
|
|
|
|
for (int i = 0; i < rows.length; i++) {
|
|
|
|
|
if (top + i + 1 > bottom) {
|
|
|
|
|
this.addRow();
|
|
|
|
|
}
|
|
|
|
|
model.setValueAt(rows[i], top + i + 1, i > 2 ? i > 3 ? i + 4 : i + 2 : i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
root.add(table, BorderLayout.CENTER);
|
|
|
|
|
this.add(menu);
|
|
|
|
|
this.add(root);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveRendering() {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
for (Entry<String, int[]> entry : general.entrySet()) {
|
|
|
|
|
if (prop.containsKey(entry.getKey())) {
|
|
|
|
|
String value = model.getValueAt(entry.getValue()[0], entry.getValue()[1]).toString();
|
|
|
|
|
try {
|
|
|
|
|
if (form.getTCProperty(entry.getKey()).getLOV() != null && !"".equals(value)) {
|
|
|
|
|
value = (String) form.getTCProperty(entry.getKey()).getLOV().getListOfValues()
|
|
|
|
|
.getRealValue(value);
|
|
|
|
|
}
|
|
|
|
|
System.out.println(entry.getKey() + ":" + value);
|
|
|
|
|
form.setProperty(entry.getKey(), value);
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (prop.containsKey("jd2_bgqf")) {
|
|
|
|
|
String value = bgqf.getSelectedText() == null ? "" : bgqf.getSelectedText();
|
|
|
|
|
try {
|
|
|
|
|
if (form.getTCProperty("jd2_bgqf").getLOV() != null && !"".equals(value)) {
|
|
|
|
|
value = (String) form.getTCProperty("jd2_bgqf").getLOV().getListOfValues().getRealValue(value);
|
|
|
|
|
}
|
|
|
|
|
System.out.println("jd2_bgqf:" + value);
|
|
|
|
|
form.setProperty("jd2_bgqf", value);
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (prop.containsKey("jd2_sywts")) {
|
|
|
|
|
List<String[]> data = new ArrayList<String[]>();
|
|
|
|
|
int num = 0;
|
|
|
|
|
while (model.getValueAt(top + 2 + num, 1) != null && !"".equals(model.getValueAt(top + 2 + num, 1))) {
|
|
|
|
|
String[] row = new String[7];
|
|
|
|
|
for (int ii = 0; ii < row.length; ii++) {
|
|
|
|
|
Object object = model.getValueAt(top + 1 + num, ii > 2 ? ii > 3 ? ii + 4 : ii + 2 : ii);
|
|
|
|
|
if (object == null) {
|
|
|
|
|
row[ii] = "";
|
|
|
|
|
} else {
|
|
|
|
|
row[ii] = object.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data.add(row);
|
|
|
|
|
num++;
|
|
|
|
|
if (top + 1 + num > bottom) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String[][] dataArr = data.toArray(new String[data.size()][]);
|
|
|
|
|
System.out.println(Arrays.deepToString(dataArr));
|
|
|
|
|
TCTableUtil.setTableRows(form, "jd2_sywts", "JD2_SYWTS", colNames, dataArr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean isEditorDisable(List<String> list, int row, int col) {
|
|
|
|
|
return list.contains(row + "," + col);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MouseAdapter rightClick() {
|
|
|
|
|
return new MouseAdapter() {
|
|
|
|
|
@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);
|
|
|
|
|
delR.setEnabled(flag);
|
|
|
|
|
test.setEnabled(flag);
|
|
|
|
|
menu.show(e.getComponent(), e.getX(), e.getY());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener addRow() {
|
|
|
|
|
return 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 });
|
|
|
|
|
model.combine(new int[] { bottom }, new int[] { 5, 6, 7 });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener delRow() {
|
|
|
|
|
return new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
int num = Integer.parseInt(model.getValueAt(bottom, 0).toString());
|
|
|
|
|
model.removeRow(row);
|
|
|
|
|
bottom--;
|
|
|
|
|
if (row <= bottom) {
|
|
|
|
|
for (int i = row; i <= bottom; i++) {
|
|
|
|
|
model.setValueAt(num + i - row, i, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionListener test() {
|
|
|
|
|
return new ActionListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
int row = table.getSelectedRow();
|
|
|
|
|
ComponentTestFrame.getInstance(rows[row - top - 1]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|