|
|
|
@ -43,12 +43,6 @@ import com.teamcenter.rac.util.PropertyLayout;
|
|
|
|
|
import com.teamcenter.rac.util.UIUtilities;
|
|
|
|
|
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
|
|
|
|
import com.teamcenter.services.rac.core.DataManagementService;
|
|
|
|
|
//导入类
|
|
|
|
|
//import com.teamcenter.services.rac.core.DataManagementService;
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn;
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateOut;
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateResponse;
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn;
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateOut;
|
|
|
|
@ -109,6 +103,18 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
*/
|
|
|
|
|
private static Map<String, Map<String, String>> rMap = new HashMap<String, Map<String,String>>();
|
|
|
|
|
|
|
|
|
|
public static void printRMap() {
|
|
|
|
|
System.out.println("begin 打印rMap集合");
|
|
|
|
|
for (Map.Entry<String, Map<String, String>> outerEntry : rMap.entrySet()) {
|
|
|
|
|
String key = outerEntry.getKey();
|
|
|
|
|
Map<String, String> innerMap = outerEntry.getValue();
|
|
|
|
|
|
|
|
|
|
System.out.println("Key: " + key);
|
|
|
|
|
for (Map.Entry<String, String> innerEntry : innerMap.entrySet()) {
|
|
|
|
|
System.out.println(">>> Inner Key: " + innerEntry.getKey() + ", Value: " + innerEntry.getValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 类构造函数
|
|
|
|
@ -136,7 +142,6 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
}
|
|
|
|
|
initUI();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -435,28 +440,10 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
if (!setFormProperty(itemRev,formList)) {
|
|
|
|
|
System.out.println("表单属性设置失败!");
|
|
|
|
|
}
|
|
|
|
|
// itemRev.lock();
|
|
|
|
|
// try {
|
|
|
|
|
// itemRev.setStringProperty("sb6_ifls", "是");
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// System.out.println("itemRev处理异常:");
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }finally {
|
|
|
|
|
// itemRev.save();
|
|
|
|
|
// itemRev.unlock();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
else if (obj instanceof TCComponentForm) {
|
|
|
|
|
form = (TCComponentForm) obj;
|
|
|
|
|
/*
|
|
|
|
|
* form.lock(); try { if (formList.size()>0) { System.out.println("开始处理表单数据");
|
|
|
|
|
* for (String[] forms : formList) { if (forms.length == 3) { String tNameString
|
|
|
|
|
* = forms[0]; String tValueString = forms[1]; String tTypeString = forms[2];
|
|
|
|
|
*
|
|
|
|
|
* setTCPropertyValue(form,tNameString,tValueString); } } } } catch (Exception
|
|
|
|
|
* e) { System.out.println("表单处理异常:"); e.printStackTrace(); }finally {
|
|
|
|
|
* form.save(); form.unlock(); }
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -547,7 +534,6 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
form.unlock();
|
|
|
|
|
}
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
// TODO 自动生成的 catch 块
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -611,7 +597,6 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -674,7 +659,6 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// TODO 自动生成的方法存根
|
|
|
|
|
Object s = e.getSource();
|
|
|
|
|
try {
|
|
|
|
|
if (s.equals(this.okButton)) {
|
|
|
|
@ -685,7 +669,6 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
try {
|
|
|
|
|
buildDrawingObjTypeFrame();
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
e2.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -704,7 +687,6 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
try {
|
|
|
|
|
createItem();
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
e2.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -715,7 +697,7 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
e2.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -761,8 +743,17 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
return ((JTextField) component).getText();
|
|
|
|
|
} else if (component instanceof JComboBox) {
|
|
|
|
|
System.out.println("JComboBox");
|
|
|
|
|
JComboBox<String> comboBox = (JComboBox<String>) component;
|
|
|
|
|
return (String)comboBox.getSelectedItem();
|
|
|
|
|
String returnValue = null;
|
|
|
|
|
// JComboBox<String> comboBox = (JComboBox<String>) component;
|
|
|
|
|
// return (String)comboBox.getSelectedItem();
|
|
|
|
|
|
|
|
|
|
JTreeComboBox treeComboBox = (JTreeComboBox ) component;
|
|
|
|
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) treeComboBox.getSelectedItem();
|
|
|
|
|
if (selectedNode != null) {
|
|
|
|
|
Object userObject = selectedNode.getUserObject();
|
|
|
|
|
returnValue = userObject.toString();
|
|
|
|
|
}
|
|
|
|
|
return returnValue;
|
|
|
|
|
} else if (component instanceof DateButton) {
|
|
|
|
|
System.out.println("DateButton");
|
|
|
|
|
DateButton dateButton = (DateButton) component;
|
|
|
|
@ -808,10 +799,10 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
this.idTextField = new JTextField(idValue);
|
|
|
|
|
}
|
|
|
|
|
this.revLabel = new JLabel("版本");
|
|
|
|
|
// String[] revs = {"S01"};//版本下拉框数组
|
|
|
|
|
//参考编码器获取新的版本
|
|
|
|
|
String newRev = tccomponentitemtype.getNewRev(null);
|
|
|
|
|
String[] revs = {newRev};
|
|
|
|
|
String[] revs = {"DX01"};//版本下拉框数组
|
|
|
|
|
// //todo 参考编码器获取新的版本
|
|
|
|
|
// String newRev = tccomponentitemtype.getNewRev(null);
|
|
|
|
|
// String[] revs = {newRev};
|
|
|
|
|
this.revComboBox = new JComboBox<String>(revs);
|
|
|
|
|
// this.revComboBox.setEditable(true);
|
|
|
|
|
|
|
|
|
@ -937,7 +928,7 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
centerPanel1.add(dateButton, gbcPropCombo);
|
|
|
|
|
propComponentMap.put(validPropName, dateButton);
|
|
|
|
|
} else if (typeValue.equals("lov")) {
|
|
|
|
|
//TODO 根据冒号后面的LOV名称获取多个lov值,封装成数组添加到propComboBox中
|
|
|
|
|
// 根据冒号后面的LOV名称获取多个lov值,封装成数组添加到propComboBox中
|
|
|
|
|
if (lovName == null) {
|
|
|
|
|
System.out.println("未获取到属性["+name+"]配置的lov名称,请检查配置!");
|
|
|
|
|
return null;
|
|
|
|
@ -945,6 +936,12 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
|
|
rMap.clear();
|
|
|
|
|
Map<String, String> lovMap = getLOVDisplay_value(tcSession, lovName);
|
|
|
|
|
System.out.println("开始打印第一层lov:");
|
|
|
|
|
for (String displayValue : lovMap.keySet()){
|
|
|
|
|
System.out.println(" lovMap:"+displayValue+"--"+lovMap.get(displayValue));
|
|
|
|
|
}
|
|
|
|
|
printRMap();
|
|
|
|
|
|
|
|
|
|
String[] displayLovName = lovMap.keySet().toArray(new String[0]);//lov显示值
|
|
|
|
|
LovProperty lovProperty = new LovProperty();//自定义的lov类型的属性类
|
|
|
|
|
lovProperty.setPropName(name);
|
|
|
|
@ -955,7 +952,13 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
|
|
// JComboBox<String> propComboBox = new JComboBox<String>(displayLovName);
|
|
|
|
|
DefaultMutableTreeNode root = generateLovTreeNode(lovMap,rMap);
|
|
|
|
|
JTreeComboBox propComboBox = new JTreeComboBox(root);
|
|
|
|
|
JTreeComboBox propComboBox = null;
|
|
|
|
|
if(root != null) {
|
|
|
|
|
propComboBox = new JTreeComboBox(root);
|
|
|
|
|
}else {
|
|
|
|
|
System.out.println("绘制多层lov失败!");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1099,16 +1102,16 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
* 获得TC LOV值的显示值-真实值集合
|
|
|
|
|
* @param seesion
|
|
|
|
|
* @param lovProp lov名称 / 真实值
|
|
|
|
|
* @return
|
|
|
|
|
* @return 第一层lov的<显示值-真实值>集合
|
|
|
|
|
* @throws TCException
|
|
|
|
|
*/
|
|
|
|
|
public static Map<String, String> getLOVDisplay_value(TCSession seesion,String lovProp) throws TCException
|
|
|
|
|
{
|
|
|
|
|
System.out.println("getLOVDisplay_value方法入参:lov名称="+lovProp);
|
|
|
|
|
Map<String, String> Display_values = new HashMap<String, String>();
|
|
|
|
|
|
|
|
|
|
TCComponentListOfValues unitLov = TCLOVUtil.findLOVByName(seesion, lovProp);
|
|
|
|
|
if(unitLov != null)
|
|
|
|
|
{
|
|
|
|
|
if(unitLov != null){
|
|
|
|
|
String[] realval = unitLov.getListOfValues().getStringListOfValues();
|
|
|
|
|
|
|
|
|
|
String value="";
|
|
|
|
@ -1120,8 +1123,13 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
Map<String, String> lovDisplay_value = getLOVDisplay_value(seesion, realval[i]);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
System.out.println("未找到LOV名称=["+lovProp+"]的lov对象!");
|
|
|
|
|
}
|
|
|
|
|
if (!Display_values.isEmpty()){
|
|
|
|
|
rMap.put(lovProp, Display_values);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Display_values;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|