Revision 44202 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureAttributeDescriptor.java

View differences:

DefaultFeatureAttributeDescriptor.java
199 199
        this.allowIndexDuplicateds = other.allowIndexDuplicateds;
200 200
        this.hidden = other.hidden;
201 201
        this.dataProfile = other.dataProfile;
202
        
203
        this.availableValues = other.availableValues;
204
        this.description = other.description;
205
        this.minValue = other.minValue;
206
        this.maxValue = other.maxValue;
207
        this.label = other.label;
208
        this.order = other.order;
209
        this.groupName = other.groupName;
210
        if( other.tags==null ) {
211
            this.tags = null;
212
        } else {
213
            try {
214
                this.tags = (Tags) other.tags.clone();
215
            } catch (Exception ex) {
216
            }
217
        }
218
        // TODO: ? Habria que clonarlos ?
219
        this.availableValuesMethod = other.availableValuesMethod;
220
        this.calculateMethod = other.calculateMethod;
202 221
    }
203 222
    
204 223
    public void setFeatureType(FeatureType type) {
......
545 564
        isIndexAscending = state.getBoolean("isIndexAscending");
546 565
        allowIndexDuplicateds = state.getBoolean("allowIndexDuplicateds");
547 566

  
548
//        FIXME: availableValues 
549

  
567
        Map<String,Object> values = state.getMap("availableValues");
568
        if( values == null || values.isEmpty()  ) {
569
            this.availableValues = null;
570
        } else {
571
            this.availableValues = new DynObjectValueItem[values.size()];
572
            int n = 0;
573
            for (Entry<String, Object> entry : values.entrySet()) {
574
                this.availableValues[n++] = new DynObjectValueItem(entry.getValue(), entry.getKey());
575
            }
576
        }
577
        
550 578
        description = state.getString("description");
551 579
        minValue = state.get("minValue");
552 580
        maxValue = state.get("maxValue");
......
612 640
        state.set("isIndexAscending", isIndexAscending);
613 641
        state.set("allowIndexDuplicateds", allowIndexDuplicateds);
614 642
        
615
//        FIXME: availableValues 
616

  
643
        if( this.availableValues==null ) {
644
            state.setNull("availableValues");
645
        } else {
646
            Map<String,Object> values = new HashMap<>();
647
            for (DynObjectValueItem value : availableValues) {
648
                values.put(value.getLabel(),value.getValue());
649
            }
650
            state.set("availableValues", values);
651
        }
617 652
        state.set("description", description);
618 653
        state.set("minValue", minValue);
619 654
        state.set("maxValue", maxValue);
......
669 704
            definition.addDynFieldBoolean("indexed");
670 705
            definition.addDynFieldBoolean("isIndexAscending");
671 706
            definition.addDynFieldBoolean("allowIndexDuplicateds");
672
//            definition.addDynFieldInt("availableValues");
673
            definition.addDynFieldInt("description");
674
            definition.addDynFieldInt("minValue");
675
            definition.addDynFieldInt("maxValue");
676
            definition.addDynFieldInt("label");
707
            definition.addDynFieldMap("availableValues");
708
            definition.addDynFieldString("description");
709
            definition.addDynFieldObject("minValue");
710
            definition.addDynFieldObject("maxValue");
711
            definition.addDynFieldString("label");
677 712
            definition.addDynFieldInt("order");
678 713
            definition.addDynFieldBoolean("hidden");
679
            definition.addDynFieldInt("groupName");
714
            definition.addDynFieldString("groupName");
680 715
        }
681 716
    }
682 717

  

Also available in: Unified diff