//插入属性 public void inseartProperty(PropertyElement property,int index) { PropertyValueElement element = new PropertyValueElement(propertyValueManager); element.name = property.name + ""; element.ValueType = property.ValueType; element.setValue(property.getDefaultValue()); propertyValueManager.insertElement(element, index); propertyValueManager.refreshUI(); }
//刷新属性(全部填写默认属性) public void refreshProperty() { this.removeAll(); for (int i = 0; i < propertiesManager.getElementCount(); i++) { PropertyValueElement element = new PropertyValueElement(this); PropertyElement property = (PropertyElement)(propertiesManager.getElement(i)); element.name = property.name + ""; element.ValueType = property.ValueType; element.setValue(property.getDefaultValue()); addElement(element); } }
//增加属性 public void addProperty(PropertyElement property) { PropertyValueElement element = new PropertyValueElement(propertyValueManager); element.name = property.name + ""; element.ValueType = property.ValueType; element.setValue(property.getDefaultValue()); propertyValueManager.addElement(element); propertyValueManager.refreshUI(); }