refactor(createTempDrawings):优化 LovProperty 类的属性注释

- 修改 propName 注释为"看板上属性条目的最终显示名称"
- 添加 propTrueName 注释为"看板上属性条目对应属性的真实名称"
- 更新 propValue 注释为"属性的值"
mian
熊朝柱 1 month ago
parent a2f038d091
commit 6bede265c8

@ -324,7 +324,7 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
// System.out.println("已有属性条目-组件数量="+this.propComponentMap.size()); // System.out.println("已有属性条目-组件数量="+this.propComponentMap.size());
for (Map.Entry<String, JComponent> entry : this.propComponentMap.entrySet()) { for (Map.Entry<String, JComponent> entry : this.propComponentMap.entrySet()) {
String key = entry.getKey();//编辑的属性条目名称 String key = entry.getKey();//编辑的属性条目名称
String value = getComponentValue(entry.getValue());//根据组件获取选中、输入的值 String value = getComponentValue(key,entry.getValue());//根据组件获取选中、输入的值
int tag = 0; int tag = 0;
//遍历首选项配置,获取属性真实值和位置、类型等信息 //遍历首选项配置,获取属性真实值和位置、类型等信息
for (String prop : preferencePropList){ for (String prop : preferencePropList){
@ -744,17 +744,28 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
} }
/** /**
* @ *
* @param component *
* @param propShowName
* @param component
* @return * @return
*/ */
public String getComponentValue(JComponent component) { public String getComponentValue(String propShowName, JComponent component) {
System.out.println("开始根据不同类型的组件取值"); System.out.println("开始根据不同类型的组件取值");
if (component instanceof JTextField) { if (component instanceof JTextField) {
System.out.println("JTextField"); System.out.println("JTextField");
return ((JTextField) component).getText(); return ((JTextField) component).getText();
} else if (component instanceof JComboBox) { } else if (component instanceof JComboBox) {
// String returnValue = null; //通过显示名称判断该属性是否是lov
String lovType = null;
for (LovProperty lovProperty : this.lovPropertyList) {
if (lovProperty.getPropName().equals(propShowName)) {
lovType = lovProperty.getlovType();
break;
}
}
System.out.println("属性"+propShowName+"的lovtype="+(lovType == null ? "非lov属性" : lovType));
String chooseDisplay= null; String chooseDisplay= null;
if (component instanceof JTreeComboBox){ if (component instanceof JTreeComboBox){
System.out.println("JTreeComboBox"); System.out.println("JTreeComboBox");
@ -886,7 +897,7 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
for(String propInfo : this.preferencePropList){//propInfo格式为*名称=Item.object_name=string for(String propInfo : this.preferencePropList){//propInfo格式为*名称=Item.object_name=string
System.out.println("开始处理首选项配置的属性信息:"+propInfo); System.out.println("开始处理首选项配置的属性信息:"+propInfo);
String[] propConfigInfoArray= propInfo.split("="); String[] propConfigInfoArray= propInfo.split("=");
String validPropName = null; String validPropName = null;//属性条目(除去符号*后)的有效值
if (propConfigInfoArray.length >= 3){ if (propConfigInfoArray.length >= 3){
String name = propConfigInfoArray[0];//“图纸类型” String name = propConfigInfoArray[0];//“图纸类型”
System.out.println("开始获取首选项配置属性["+name+"]的信息"); System.out.println("开始获取首选项配置属性["+name+"]的信息");

@ -8,10 +8,11 @@ import java.util.Map;
* *
*/ */
public class LovProperty { public class LovProperty {
//属性名称 //看板上属性条目的最终显示名称
private String propName; private String propName;
//看板上属性条目对应属性的真实名称
private String propTrueName; private String propTrueName;
//属性 //属性
private String propValue; private String propValue;
private boolean isLov; private boolean isLov;

Loading…
Cancel
Save