From 6bede265c8ddf328a46b90bc08a8a4fddf7759c3 Mon Sep 17 00:00:00 2001 From: xiongcz Date: Wed, 14 May 2025 11:03:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor(createTempDrawings):=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20LovProperty=20=E7=B1=BB=E7=9A=84=E5=B1=9E=E6=80=A7=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 propName 注释为"看板上属性条目的最终显示名称" - 添加 propTrueName 注释为"看板上属性条目对应属性的真实名称" - 更新 propValue 注释为"属性的值" --- .../dialogs/CreateTempDrawingDialog.java | 23 ++++++++++++++----- .../createTempDrawings/pojo/LovProperty.java | 5 ++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/cn/net/connor/createTempDrawings/dialogs/CreateTempDrawingDialog.java b/src/cn/net/connor/createTempDrawings/dialogs/CreateTempDrawingDialog.java index 9da893c..1a72244 100644 --- a/src/cn/net/connor/createTempDrawings/dialogs/CreateTempDrawingDialog.java +++ b/src/cn/net/connor/createTempDrawings/dialogs/CreateTempDrawingDialog.java @@ -324,7 +324,7 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{ // System.out.println("Ŀ-="+this.propComponentMap.size()); for (Map.Entry entry : this.propComponentMap.entrySet()) { String key = entry.getKey();//༭Ŀ - String value = getComponentValue(entry.getValue());//ȡѡСֵ + String value = getComponentValue(key,entry.getValue());//ȡѡСֵ int tag = 0; //ѡãȡʵֵλá͵Ϣ for (String prop : preferencePropList){ @@ -744,17 +744,28 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{ } /** - * @ݲͬ͵ȡֵ - * @param component + * + * ݲͬ͵ȡֵ + * @param propShowName Ŀڿչʾ + * @param component ĿӦ * @return */ - public String getComponentValue(JComponent component) { + public String getComponentValue(String propShowName, JComponent component) { System.out.println("ʼݲͬ͵ȡֵ"); if (component instanceof JTextField) { System.out.println("JTextField"); return ((JTextField) component).getText(); } 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; if (component instanceof 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 System.out.println("ʼѡõϢ"+propInfo); String[] propConfigInfoArray= propInfo.split("="); - String validPropName = null; + String validPropName = null;//Ŀȥ*󣩵Чֵ if (propConfigInfoArray.length >= 3){ String name = propConfigInfoArray[0];//ͼֽ͡ System.out.println("ʼȡѡ["+name+"]Ϣ"); diff --git a/src/cn/net/connor/createTempDrawings/pojo/LovProperty.java b/src/cn/net/connor/createTempDrawings/pojo/LovProperty.java index 032d50f..2a80b5c 100644 --- a/src/cn/net/connor/createTempDrawings/pojo/LovProperty.java +++ b/src/cn/net/connor/createTempDrawings/pojo/LovProperty.java @@ -8,10 +8,11 @@ import java.util.Map; * */ public class LovProperty { - // + //Ŀʾ private String propName; + //ĿӦԵʵ private String propTrueName; - //ֵ + //Եֵ private String propValue; private boolean isLov;