Revision 20421

View differences:

trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/shp/ShpFeature.java
32 32
	}
33 33

  
34 34

  
35
	void load(DbaseFile dbf,IGeometry geometry) throws ReadException, IsNotFeatureSettingException{
35
	void load(DbaseFile dbf,IGeometry geometry) throws ReadException{
36 36
		Iterator iterator=featureType.iterator();
37
		this.loading();
38
		while (iterator.hasNext()) {
39
			IFeatureAttributeDescriptor descriptor = (IFeatureAttributeDescriptor) iterator.next();
40
			int i=descriptor.ordinal();
41
			String fieldType=descriptor.getDataType();
42
			if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_GEOMETRY)){
43
				this.setGeometry(i,geometry);
44
			}
45
			if (dbf.getFieldCount()<=i)
46
				return ;
47
			String value=dbf.getStringFieldValue((int) this.featureIndex, i);
48
			value=value.trim();
37
		try{
38
			this.loading();
39
			while (iterator.hasNext()) {
40
				IFeatureAttributeDescriptor descriptor = (IFeatureAttributeDescriptor) iterator.next();
41
				int i=descriptor.ordinal();
42
				String fieldType=descriptor.getDataType();
43
				if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_GEOMETRY)){
44
					this.setGeometry(i,geometry);
45
				}
46
				if (dbf.getFieldCount()<=i)
47
					return ;
48
				String value=dbf.getStringFieldValue((int) this.featureIndex, i);
49
				value=value.trim();
49 50

  
50
			if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_STRING)){
51
				this.set(i,value);
52
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DOUBLE)){
53
				try{
54
					Double.parseDouble(value);
55
				}catch (NumberFormatException e) {
56
					value="0";
51
				if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_STRING)){
52
					this.set(i,value);
53
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DOUBLE)){
54
					try{
55
						Double.parseDouble(value);
56
					}catch (NumberFormatException e) {
57
						value="0";
58
					}
59
					this.set(i,Double.parseDouble(value));
60
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_INT)){
61
					this.set(i,Integer.parseInt(value));
62
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_FLOAT)){
63
					this.set(i,Float.parseFloat(value));
64
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_LONG)){
65
					this.set(i,Long.parseLong(value));
66
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BOOLEAN)){
67
					this.set(i,Boolean.parseBoolean(value));
68
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BYTE)){
69
					this.set(i,Byte.parseByte(value));
70
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DATE)){
71
					String year = value.substring(0, 4);
72
					String month = value.substring(4, 6);
73
					String day = value.substring(6, 8);
74
					DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, ukLocale);
75
					/* Calendar c = Calendar.getInstance();
76
					 c.clear();
77
					 c.set(Integer.parseInt(year), Integer.parseInt(month),
78
					 Integer.parseInt(day));
79
					 c.set(Calendar.MILLISECOND, 0); */
80
					String strAux = month + "/" + day + "/" + year;
81
					Date dat=null;
82
					try {
83
						dat = df.parse(strAux);
84
					} catch (ParseException e) {
85
						throw new ReadException(this.store.getName(),e);
86
					}
87
					this.set(i,dat);
88
				}else{
89
					this.set(i,null);
57 90
				}
58
				this.set(i,Double.parseDouble(value));
59
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_INT)){
60
				this.set(i,Integer.parseInt(value));
61
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_FLOAT)){
62
				this.set(i,Float.parseFloat(value));
63
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_LONG)){
64
				this.set(i,Long.parseLong(value));
65
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BOOLEAN)){
66
				this.set(i,Boolean.parseBoolean(value));
67
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BYTE)){
68
				this.set(i,Byte.parseByte(value));
69
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DATE)){
70
				String year = value.substring(0, 4);
71
				String month = value.substring(4, 6);
72
				String day = value.substring(6, 8);
73
				DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, ukLocale);
74
				/* Calendar c = Calendar.getInstance();
75
		            c.clear();
76
		            c.set(Integer.parseInt(year), Integer.parseInt(month),
77
		                Integer.parseInt(day));
78
		            c.set(Calendar.MILLISECOND, 0); */
79
				String strAux = month + "/" + day + "/" + year;
80
				Date dat=null;
81
				try {
82
					dat = df.parse(strAux);
83
				} catch (ParseException e) {
84
					throw new ReadException(this.store.getName(),e);
85
				}
86
				this.set(i,dat);
87
			}else{
88
				this.set(i,null);
89 91
			}
92
			this.stopLoading();
93
		}catch (IsNotFeatureSettingException e) {
94
			e.printStackTrace();
90 95
		}
91
		this.stopLoading();
92 96
	}
93 97

  
94 98

  
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/shp/SHPStore.java
8 8
import java.lang.ref.WeakReference;
9 9
import java.nio.ByteOrder;
10 10
import java.nio.channels.FileChannel;
11
import java.text.DateFormat;
12
import java.text.ParseException;
13 11
import java.util.Collection;
14
import java.util.Date;
15 12
import java.util.Iterator;
16 13
import java.util.List;
17 14

  
......
35 32
import org.gvsig.data.vectorial.IFeatureCollection;
36 33
import org.gvsig.data.vectorial.IFeatureID;
37 34
import org.gvsig.data.vectorial.IFeatureType;
38
import org.gvsig.data.vectorial.IsNotFeatureSettingException;
35
import org.gvsig.data.vectorial.IsNotAttributeSettingException;
39 36
import org.gvsig.exceptions.BaseException;
40 37
import org.gvsig.metadata.IMetadata;
41 38
import org.gvsig.metadata.IMetadataManager;
......
68 65
			featureType=super.getDefaultFeatureType();
69 66

  
70 67
			DefaultAttributeDescriptor dad=new DefaultAttributeDescriptor();
71
	        dad.setName("GEOMETRY");
72
	        dad.setType(IFeatureAttributeDescriptor.TYPE_GEOMETRY);
68
			try {
69
				dad.loading();
70
				dad.setName("GEOMETRY");
71
				dad.setType(IFeatureAttributeDescriptor.TYPE_GEOMETRY);
72
				dad.stopLoading();
73
			} catch (IsNotAttributeSettingException e1) {
74
				// TODO Auto-generated catch block
75
				e1.printStackTrace();
76
			}
73 77
	        featureType.add(dad);
74 78
	        featureType.setDefaultGeometry("GEOMETRY");
75 79

  
......
139 143
//
140 144
//	    }
141 145

  
142
	protected void doFinishEdition() throws WriteException, ReadException, IsNotFeatureSettingException {
146
	protected void doFinishEdition() throws WriteException, ReadException {
143 147
		IFeaturesWriter writer = getFeaturesWriter();
144 148
        writer.init(this);
145 149
        writer.updateFeatureType(featureType);
......
169 173
		return coll;
170 174
	}
171 175

  
172
	public IFeature getFeatureByID(IFeatureID id) throws ReadException, IsNotFeatureSettingException {
176
	public IFeature getFeatureByID(IFeatureID id) throws ReadException {
173 177
		if (this.alterMode){
174 178
    		if (featureManager.contains(id)) {
175 179
    			return featureManager.getFeature(id);
......
339 343
		}
340 344
		return metadata;
341 345
	}
342
	protected IFeature getFeatureByPosition(IFeatureType featureType,long position) throws ReadException, IsNotFeatureSettingException {
346
	protected IFeature getFeatureByPosition(IFeatureType featureType,long position) throws ReadException {
343 347
		ShpFeature feature=new ShpFeature(featureType,this,position);
344 348
		feature.load(dbf, this.getGeometry(position));
345 349
		return feature;
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dbf/DBFFeatureCollectionWithFeatureID.java
144 144
				feature = fid.getFeature(featureType);
145 145
			} catch (ReadException e) {
146 146
				throw new RuntimeException(e);
147
			} catch (IsNotFeatureSettingException e) {
148
				throw new RuntimeException(e);
149 147
			}
150 148
			return feature;
151 149
		}
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dbf/DBFStore.java
31 31
import org.gvsig.data.vectorial.IFeatureCollection;
32 32
import org.gvsig.data.vectorial.IFeatureID;
33 33
import org.gvsig.data.vectorial.IFeatureType;
34
import org.gvsig.data.vectorial.IsNotAttributeSettingException;
34 35
import org.gvsig.data.vectorial.IsNotFeatureSettingException;
35 36
import org.gvsig.exceptions.BaseException;
36 37
import org.gvsig.metadata.IMetadata;
......
54 55
			dbf.open(file);
55 56
			featureType=new DefaultFeatureType();
56 57
			    for (int i = 0; i < dbf.getFieldCount(); i++) {
57
			    	IFeatureAttributeDescriptor fad=createFeatureAttribute(i);
58
			    	IFeatureAttributeDescriptor fad;
59
					try {
60
						fad = createFeatureAttribute(i);
61
					} catch (IsNotAttributeSettingException e) {
62
						throw new InitializeException(this.getName(),e);
63
					}
58 64
	                featureType.add(fad);
59 65
	            }
60 66
	    }
61 67

  
62 68

  
63
	 private IFeatureAttributeDescriptor createFeatureAttribute(int i) {
69
	 private IFeatureAttributeDescriptor createFeatureAttribute(int i) throws IsNotAttributeSettingException {
64 70
	        char fieldType = dbf.getFieldType(i);
65 71
	        DefaultAttributeDescriptor dad=new DefaultAttributeDescriptor();
72
	        dad.loading();
66 73
	        dad.setName(dbf.getFieldName(i));
67 74
	        dad.setSize(dbf.getFieldLength(i));
68 75
	        if (fieldType == 'L') {
......
83 90
	        } else {
84 91
//	            throw new BadFieldDriverException(getName(),null,String.valueOf(fieldType));
85 92
	        }
93
	        dad.stopLoading();
86 94
	      	return dad;
87 95

  
88 96
	    }
89 97

  
90
	protected void doFinishEdition() throws WriteException, ReadException, IsNotFeatureSettingException {
98
	protected void doFinishEdition() throws WriteException, ReadException {
91 99
		IFeaturesWriter writer = getFeaturesWriter();
92 100
        writer.init(this);
93 101
        writer.updateFeatureType(featureType);
......
119 127

  
120 128
	}
121 129

  
122
	public IFeature getFeatureByID(IFeatureID id) throws ReadException, IsNotFeatureSettingException {
130
	public IFeature getFeatureByID(IFeatureID id) throws ReadException {
123 131
		if (this.alterMode){
124 132
    		if (featureManager.contains(id)) {
125 133
    			return featureManager.getFeature(id);
......
224 232
		return metadata;
225 233
	}
226 234

  
227
	protected IFeature getFeatureByPosition(IFeatureType ft,long position) throws ReadException, IsNotFeatureSettingException {
235
	protected IFeature getFeatureByPosition(IFeatureType ft,long position) throws ReadException {
228 236
//		 Field Type (C  or M)
229 237
//       char cfieldType = fieldTypes[fieldId];
230 238
//       int fieldType = getFieldType(fieldId);
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dbf/DBFFeatureCollection.java
180 180
						feature=featureID.getFeature(featureType);
181 181
					} catch (ReadException e) {
182 182
						throw new RuntimeException(e);
183
					}catch (IsNotFeatureSettingException e) {
184
						throw new RuntimeException(e);
185 183
					}
186 184
				}else if (featureManager!=null && (position-driverFeatureCount)<featureManager.getNum()){
187 185
					int pos=(int)(position-driverFeatureCount);
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dbf/DBFFeatureID.java
17 17
	long getIndex(){
18 18
		return featureIndex;
19 19
	}
20
	public IFeature getFeature(IFeatureType featureType) throws ReadException, IsNotFeatureSettingException {
20
	public IFeature getFeature(IFeatureType featureType) throws ReadException{
21 21
		return store.getFeatureByID(this);
22 22
	}
23 23
	public boolean equals(Object obj) {
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dbf/DBFFeature.java
29 29
	}
30 30

  
31 31

  
32
	void load(DbaseFile dbf) throws ReadException, IsNotFeatureSettingException{
33
		 Iterator iterator=featureType.iterator();
34
		 this.loading();
35
		 while (iterator.hasNext()) {
36
			   IFeatureAttributeDescriptor descriptor = (IFeatureAttributeDescriptor) iterator.next();
37
			   int i=descriptor.ordinal();
38
			   if (dbf.getFieldCount()<=i)
39
				return;
40
			String value=dbf.getStringFieldValue((int) this.featureIndex, i);
41
			value=value.trim();
42
			String fieldType=descriptor.getDataType();
43
			if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_STRING)){
44
				this.set(i,value);
45
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DOUBLE)){
46
				try{
47
					Double.parseDouble(value);
48
				}catch (NumberFormatException e) {
49
					value="0";
32
	void load(DbaseFile dbf) throws ReadException{
33
		try{
34
			Iterator iterator=featureType.iterator();
35
			this.loading();
36
			while (iterator.hasNext()) {
37
				IFeatureAttributeDescriptor descriptor = (IFeatureAttributeDescriptor) iterator.next();
38
				int i=descriptor.ordinal();
39
				if (dbf.getFieldCount()<=i)
40
					return;
41
				String value=dbf.getStringFieldValue((int) this.featureIndex, i);
42
				value=value.trim();
43
				String fieldType=descriptor.getDataType();
44
				if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_STRING)){
45
					this.set(i,value);
46
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DOUBLE)){
47
					try{
48
						Double.parseDouble(value);
49
					}catch (NumberFormatException e) {
50
						value="0";
51
					}
52
					this.set(i,Double.parseDouble(value));
53
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_INT)){
54
					this.set(i,Integer.parseInt(value));
55
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_FLOAT)){
56
					this.set(i,Float.parseFloat(value));
57
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_LONG)){
58
					this.set(i,Long.parseLong(value));
59
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BOOLEAN)){
60
					this.set(i,Boolean.parseBoolean(value));
61
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BYTE)){
62
					this.set(i,Byte.parseByte(value));
63
				}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DATE)){
64
					String year = value.substring(0, 4);
65
					String month = value.substring(4, 6);
66
					String day = value.substring(6, 8);
67
					DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, ukLocale);
68
					/* Calendar c = Calendar.getInstance();
69
					 c.clear();
70
					 c.set(Integer.parseInt(year), Integer.parseInt(month),
71
					 Integer.parseInt(day));
72
					 c.set(Calendar.MILLISECOND, 0); */
73
					String strAux = month + "/" + day + "/" + year;
74
					Date dat=null;
75
					try {
76
						dat = df.parse(strAux);
77
					} catch (ParseException e) {
78
						throw new ReadException(this.store.getName(),e);
79
					}
80
					this.set(i,dat);
81
				}else{
82
					this.set(i,null);
50 83
				}
51
				this.set(i,Double.parseDouble(value));
52
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_INT)){
53
				this.set(i,Integer.parseInt(value));
54
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_FLOAT)){
55
				this.set(i,Float.parseFloat(value));
56
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_LONG)){
57
				this.set(i,Long.parseLong(value));
58
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BOOLEAN)){
59
				this.set(i,Boolean.parseBoolean(value));
60
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_BYTE)){
61
				this.set(i,Byte.parseByte(value));
62
			}else if (fieldType.equals(IFeatureAttributeDescriptor.TYPE_DATE)){
63
				 String year = value.substring(0, 4);
64
		            String month = value.substring(4, 6);
65
		            String day = value.substring(6, 8);
66
		            DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, ukLocale);
67
		            /* Calendar c = Calendar.getInstance();
68
		            c.clear();
69
		            c.set(Integer.parseInt(year), Integer.parseInt(month),
70
		                Integer.parseInt(day));
71
		            c.set(Calendar.MILLISECOND, 0); */
72
		            String strAux = month + "/" + day + "/" + year;
73
		            Date dat=null;
74
		            try {
75
		                dat = df.parse(strAux);
76
		            } catch (ParseException e) {
77
		                throw new ReadException(this.store.getName(),e);
78
		            }
79
				this.set(i,dat);
80
			}else{
81
				this.set(i,null);
82 84
			}
85
			this.stopLoading();
86
		}catch (IsNotFeatureSettingException e) {
87
			e.printStackTrace();
83 88
		}
84
		 this.stopLoading();
85

  
86 89
	}
87 90

  
88 91
	public IFeatureID getID() {
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dxf/DXFStore.java
44 44
import org.gvsig.data.vectorial.IFeatureCollection;
45 45
import org.gvsig.data.vectorial.IFeatureID;
46 46
import org.gvsig.data.vectorial.IFeatureType;
47
import org.gvsig.data.vectorial.IsNotAttributeSettingException;
47 48
import org.gvsig.data.vectorial.IsNotFeatureSettingException;
48 49
import org.gvsig.data.vectorial.MemoryFeature;
49 50
import org.gvsig.data.vectorial.filter.FeatureFilterParser;
......
112 113
	 static IFeatureType newFeatureType(){
113 114
			DefaultFeatureType fType= new DefaultFeatureType();
114 115

  
116
			try{
115 117
			DefaultAttributeDescriptor descriptorID = new DefaultAttributeDescriptor();
118
			descriptorID.loading();
116 119
			descriptorID.setType(IFeatureAttributeDescriptor.TYPE_INT);
117 120
			descriptorID.setName("ID");
118 121
			descriptorID.setDefaultValue(new Integer(0));
122
			descriptorID.stopLoading();
119 123
			fType.add(descriptorID);
120 124

  
121 125
			DefaultAttributeDescriptor descriptorShape = new DefaultAttributeDescriptor();
126
			descriptorShape.loading();
122 127
			descriptorShape.setType(IFeatureAttributeDescriptor.TYPE_GEOMETRY);
123 128
			descriptorShape.setName("GEOMETRY");
124 129
			descriptorShape.setDefaultValue(null);
130
			descriptorShape.stopLoading();
125 131
			fType.add(descriptorShape);
126 132
			fType.setDefaultGeometry("GEOMETRY");
127 133

  
128 134
			DefaultAttributeDescriptor descriptorEntity = new DefaultAttributeDescriptor();
135
			descriptorEntity.loading();
129 136
			descriptorEntity.setType(IFeatureAttributeDescriptor.TYPE_STRING);
130 137
			descriptorEntity.setName("Entity");
131 138
			descriptorEntity.setDefaultValue("Entity");
139
			descriptorEntity.stopLoading();
132 140
			fType.add(descriptorEntity);
133 141

  
134 142
			DefaultAttributeDescriptor descriptorLayer = new DefaultAttributeDescriptor();
143
			descriptorLayer.loading();
135 144
			descriptorLayer.setType(IFeatureAttributeDescriptor.TYPE_STRING);
136 145
			descriptorLayer.setName("Layer");
137 146
			descriptorLayer.setDefaultValue("default");
147
			descriptorLayer.stopLoading();
138 148
			fType.add(descriptorLayer);
139 149

  
140 150
			DefaultAttributeDescriptor descriptorColor = new DefaultAttributeDescriptor();
151
			descriptorColor.loading();
141 152
			descriptorColor.setType(IFeatureAttributeDescriptor.TYPE_INT);
142 153
			descriptorColor.setName("Color");
143 154
			descriptorColor.setDefaultValue(new Integer(0));
155
			descriptorColor.stopLoading();
144 156
			fType.add(descriptorColor);
145 157

  
146 158
			DefaultAttributeDescriptor descriptorElevation = new DefaultAttributeDescriptor();
159
			descriptorElevation.loading();
147 160
			descriptorElevation.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
148 161
			descriptorElevation.setName("Elevation");
149 162
			descriptorElevation.setDefaultValue(new Double(0));
163
			descriptorElevation.stopLoading();
150 164
			fType.add(descriptorElevation);
151 165

  
152 166
			DefaultAttributeDescriptor descriptorThickness = new DefaultAttributeDescriptor();
167
			descriptorThickness.loading();
153 168
			descriptorThickness.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
154 169
			descriptorThickness.setName("Thickness");
155 170
			descriptorThickness.setDefaultValue(new Double(0));
171
			descriptorThickness.stopLoading();
156 172
			fType.add(descriptorThickness);
157 173

  
158 174
			DefaultAttributeDescriptor descriptorText = new DefaultAttributeDescriptor();
175
			descriptorText.loading();
159 176
			descriptorText.setType(IFeatureAttributeDescriptor.TYPE_STRING);
160 177
			descriptorText.setName("Text");
161 178
			descriptorText.setDefaultValue("");
179
			descriptorText.stopLoading();
162 180
			fType.add(descriptorText);
163 181

  
164 182
			DefaultAttributeDescriptor descriptorHeightText = new DefaultAttributeDescriptor();
183
			descriptorHeightText.loading();
165 184
			descriptorHeightText.setType(IFeatureAttributeDescriptor.TYPE_FLOAT);
166 185
			descriptorHeightText.setName("HeightText");
167 186
			descriptorHeightText.setDefaultValue(new Float(10));
187
			descriptorHeightText.stopLoading();
168 188
			fType.add(descriptorHeightText);
169 189

  
170 190
			DefaultAttributeDescriptor descriptorRotationText = new DefaultAttributeDescriptor();
191
			descriptorRotationText.loading();
171 192
			descriptorRotationText.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
172 193
			descriptorRotationText.setName("Rotation");
173 194
			descriptorRotationText.setDefaultValue(new Double(10));
195
			descriptorRotationText.stopLoading();
174 196
			fType.add(descriptorRotationText);
197
			}catch (IsNotAttributeSettingException e) {
198
				e.printStackTrace();
199
			}
175 200

  
176

  
177 201
			return fType;
178 202

  
179 203
	 }
......
182 206
			featureType= newFeatureType();
183 207
		}
184 208

  
185
	protected void doFinishEdition() throws WriteException, ReadException, IsNotFeatureSettingException {
209
	protected void doFinishEdition() throws WriteException, ReadException {
186 210
		IFeaturesWriter writer = getFeaturesWriter();
187 211
        writer.init(this);
188 212
        writer.updateFeatureType(featureType);
......
198 222

  
199 223
	}
200 224

  
201
	public IDataCollection getDataCollection(IFeatureType type, String filter, String order) throws ReadException, IsNotFeatureSettingException {
225
	public IDataCollection getDataCollection(IFeatureType type, String filter, String order) throws ReadException {
202 226
		if (type==null){
203 227
			type=getDefaultFeatureType();
204 228
		}
......
259 283

  
260 284
	}
261 285

  
262
	public IFeature getFeatureByID(IFeatureID id) throws ReadException, NumberFormatException, IsNotFeatureSettingException {
286
	public IFeature getFeatureByID(IFeatureID id) throws ReadException {
263 287
		if (this.alterMode){
264 288
    		if (featureManager.contains(id)) {
265 289
    			return featureManager.getFeature(id);
......
302 326
		return DATASTORE_NAME;
303 327
	}
304 328

  
305
	public void open() throws OpenException, IsNotFeatureSettingException {
329
	public void open() throws OpenException {
306 330
		this.observable.notifyObservers(
307 331
				new FeatureStoreNotification(this,FeatureStoreNotification.BEFORE_OPEN)
308 332
		);
......
403 427
			att = (String[]) featureMaker.getAttributes().get(i);
404 428

  
405 429
			DefaultAttributeDescriptor descriptorAux = new DefaultAttributeDescriptor();
406
			descriptorAux.setType(IFeatureAttributeDescriptor.TYPE_STRING);
407
			descriptorAux.setName(att[0]);
408
			descriptorAux.setDefaultValue("");
430
			try {
431
				descriptorAux.loading();
432
				descriptorAux.setType(IFeatureAttributeDescriptor.TYPE_STRING);
433
				descriptorAux.setName(att[0]);
434
				descriptorAux.setDefaultValue("");
435
				descriptorAux.stopLoading();
436
			} catch (IsNotAttributeSettingException e) {
437
				e.printStackTrace();
438
			}
409 439
			featureType.add(descriptorAux);
410 440

  
411 441

  
......
426 456
//			auxRow[ID_FIELD_HEIGHTTEXT] = new Double(0.0);
427 457
//			auxRow[ID_FIELD_ROTATIONTEXT] = new Double(0.0);
428 458
//			auxRow[ID_FIELD_TEXT] = null;
429
			feature.loading();
430
			Feature fea = (Feature) features.get(i);
431
			if (fea.getGeometry() instanceof Point
432
					&& !(fea.getGeometry() instanceof org.cresques.px.gml.Point3D)) {
433
				Point point = (Point) fea.getGeometry();
434
				Point2D pto = new Point2D.Double();
435
				pto = point.get(0);
436
				FShape nuevoShp;
437
				if (point.isTextPoint()) {
459
			try{
460
				feature.loading();
461
				Feature fea = (Feature) features.get(i);
462
				if (fea.getGeometry() instanceof Point
463
						&& !(fea.getGeometry() instanceof org.cresques.px.gml.Point3D)) {
464
					Point point = (Point) fea.getGeometry();
465
					Point2D pto = new Point2D.Double();
466
					pto = point.get(0);
467
					FShape nuevoShp;
468
					if (point.isTextPoint()) {
469
						feature.set(ID_FIELD_ID,i);
470
//						auxRow[ID_FIELD_ID] = new Integer(i);
471
//						feature.set(ID_FIELD_FSHAPE,"Point2D");
472
//						auxRow[ID_FIELD_FSHAPE] = new String("FPoint2D");
473
						feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
474
//						auxRow[ID_FIELD_ENTITY] = new String(fea.getProp("dxfEntity"));
475
						feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
476
//						auxRow[ID_FIELD_LAYER] = new String(fea.getProp("layer"));
477
						int auxInt = Integer.parseInt(fea.getProp("color"));
478
						feature.set(ID_FIELD_COLOR,auxInt);
479
//						auxRow[ID_FIELD_COLOR] = new Integer(auxInt);
480
						feature.set(ID_FIELD_TEXT,fea.getProp("text"));
481
//						auxRow[ID_FIELD_TEXT] = ValueFactory
482
//						.createValue(new String(fea.getProp("text")));
483
						heightText = Float.parseFloat(fea.getProp("textHeight"));
484
						feature.set(ID_FIELD_HEIGHTTEXT,heightText);
485
//						auxRow[ID_FIELD_HEIGHTTEXT] = ValueFactory
486
//						.createValue(heightText);
487
						double auxR = Double.parseDouble(fea
488
								.getProp("textRotation"));
489
						feature.set(ID_FIELD_ROTATIONTEXT,auxR);
490
//						auxRow[ID_FIELD_ROTATIONTEXT] = ValueFactory
491
//						.createValue(auxR);
492
						double auxE = Double.parseDouble(fea.getProp("elevation"));
493
						feature.set(ID_FIELD_ELEVATION,auxE);
494
//						auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
495
						double auxT = Double.parseDouble(fea.getProp("thickness"));
496
						feature.set(ID_FIELD_THICKNESS,auxT);
497
//						auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
498
						// Attributes
499
						for (int j = 0; j < nAtt; j++) {
500
							String[] attributes = new String[2];
501
							attributes = (String[]) featureMaker.getAttributes()
502
							.get(j);
503
							feature.set(10+j,attributes[1]);
504
//							auxRow[10 + j] = ValueFactory.createValue(new String(
505
//							attributes[1]));
506
							if (!fea.getProp(attributes[0]).equals(attributes[1])) {
507
								feature.set(10+j,fea.getProp(attributes[0]));
508
//								auxRow[10 + j] = ValueFactory
509
//								.createValue(new String(fea
510
//								.getProp(attributes[0])));
511
							}
512
						}
513
						IGeometry geom=ShapeFactory.createPoint2D(new FPoint2D(pto.getX(), pto.getY()));
514
						feature.set(ID_FIELD_FSHAPE,geom);
515
//						feature.setDefaultGeometry(geom);
516
						addFeature(feature);
517

  
518
//						addShape(nuevoShp, auxRow);
519
					} else {
520
						feature.set(ID_FIELD_ID,i);
521
//						auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
522
//						feature.set(ID_FIELD_FSHAPE,"Point2D");
523
//						auxRow[ID_FIELD_FSHAPE] = ValueFactory
524
//						.createValue(new String("FPoint2D"));
525
						feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
526
//						auxRow[ID_FIELD_ENTITY] = ValueFactory
527
//						.createValue(new String(fea.getProp("dxfEntity")));
528
						feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
529
//						auxRow[ID_FIELD_LAYER] = ValueFactory
530
//						.createValue(new String(fea.getProp("layer")));
531
						int auxInt = Integer.parseInt(fea.getProp("color"));
532
						feature.set(ID_FIELD_COLOR,auxInt);
533
//						auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
534
						double auxE = Double.parseDouble(fea.getProp("elevation"));
535
						feature.set(ID_FIELD_ELEVATION,auxE);
536
//						auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
537
						double auxT = Double.parseDouble(fea.getProp("thickness"));
538
						feature.set(ID_FIELD_THICKNESS,auxT);
539
//						auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
540
						// Attributes
541
						for (int j = 0; j < nAtt; j++) {
542
							String[] attributes = new String[2];
543
							attributes = (String[]) featureMaker.getAttributes()
544
							.get(j);
545
							feature.set(10+j,attributes[1]);
546
//							auxRow[10 + j] = ValueFactory.createValue(new String(
547
//							attributes[1]));
548
							if (!fea.getProp(attributes[0]).equals(attributes[1])) {
549
								feature.set(10+j,fea.getProp(attributes[0]));
550
//								auxRow[10 + j] = ValueFactory
551
//								.createValue(new String(fea
552
//								.getProp(attributes[0])));
553
							}
554
						}
555
						IGeometry geom=ShapeFactory.createPoint2D(new FPoint2D(pto.getX(), pto.getY()));
556
						feature.set(ID_FIELD_FSHAPE,geom);
557
//						feature.setDefaultGeometry(geom);
558
						addFeature(feature);
559
//						addShape(nuevoShp, auxRow);
560
					}
561
				} else if (fea.getGeometry() instanceof org.cresques.px.gml.Point3D) {
562
					org.cresques.px.gml.Point3D point = (org.cresques.px.gml.Point3D) fea
563
					.getGeometry();
564
					Point3D pto = new Point3D();
565
					pto = point.getPoint3D(0);
566
					FShape nuevoShp;
567
					if (point.isTextPoint()) {
568
						feature.set(ID_FIELD_ID,i);
569
//						auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
570
						feature.set(ID_FIELD_FSHAPE,"Point3D");
571
//						auxRow[ID_FIELD_FSHAPE] = ValueFactory
572
//						.createValue(new String("FPoint3D"));
573
						feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
574
//						auxRow[ID_FIELD_ENTITY] = ValueFactory
575
//						.createValue(new String(fea.getProp("dxfEntity")));
576
						feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
577
//						auxRow[ID_FIELD_LAYER] = ValueFactory
578
//						.createValue(new String(fea.getProp("layer")));
579
						int auxInt = Integer.parseInt(fea.getProp("color"));
580
						feature.set(ID_FIELD_COLOR,auxInt);
581
//						auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
582
						feature.set(ID_FIELD_TEXT,fea.getProp("text"));
583
//						auxRow[ID_FIELD_TEXT] = ValueFactory
584
//						.createValue(new String(fea.getProp("text")));
585
						heightText = Float.parseFloat(fea.getProp("textHeight"));
586
						feature.set(ID_FIELD_HEIGHTTEXT,heightText);
587
//						auxRow[ID_FIELD_HEIGHTTEXT] = ValueFactory
588
//						.createValue(heightText);
589
						double auxR = Double.parseDouble(fea
590
								.getProp("textRotation"));
591
						feature.set(ID_FIELD_ROTATIONTEXT,auxR);
592
//						auxRow[ID_FIELD_ROTATIONTEXT] = ValueFactory
593
//						.createValue(auxR);
594
						double auxE = Double.parseDouble(fea.getProp("elevation"));
595
						feature.set(ID_FIELD_ELEVATION,auxE);
596
//						auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
597
						double auxT = Double.parseDouble(fea.getProp("thickness"));
598
						feature.set(ID_FIELD_THICKNESS,auxT);
599
//						auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
600
						// Attributes
601
						for (int j = 0; j < nAtt; j++) {
602
							String[] attributes = new String[2];
603
							attributes = (String[]) featureMaker.getAttributes()
604
							.get(j);
605
							feature.set(10+j,attributes[1]);
606
//							auxRow[10 + j] = ValueFactory.createValue(new String(
607
//							attributes[1]));
608
							if (!fea.getProp(attributes[0]).equals(attributes[1])) {
609
								feature.set(10+j,fea.getProp(attributes[0]));
610
//								auxRow[10 + j] = ValueFactory
611
//								.createValue(new String(fea
612
//								.getProp(attributes[0])));
613
							}
614
						}
615
						IGeometry geom=ShapeFactory.createPoint3D(pto.getX(), pto.getY(), pto.getZ());
616
						feature.set(ID_FIELD_FSHAPE,geom);
617
//						feature.setDefaultGeometry(geom);
618
						addFeature(feature);
619
//						addShape(nuevoShp, auxRow);
620
					} else {
621
						feature.set(ID_FIELD_ID,i);
622
//						auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
623
						feature.set(ID_FIELD_FSHAPE,"Point3D");
624
//						auxRow[ID_FIELD_FSHAPE] = ValueFactory
625
//						.createValue(new String("FPoint3D"));
626
						feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
627
//						auxRow[ID_FIELD_ENTITY] = ValueFactory
628
//						.createValue(new String(fea.getProp("dxfEntity")));
629
						feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
630
//						auxRow[ID_FIELD_LAYER] = ValueFactory
631
//						.createValue(new String(fea.getProp("layer")));
632
						int auxInt = Integer.parseInt(fea.getProp("color"));
633
						feature.set(ID_FIELD_COLOR,auxInt);
634
//						auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
635

  
636
						double auxE = Double.parseDouble(fea.getProp("elevation"));
637
						feature.set(ID_FIELD_ELEVATION,auxE);
638
//						auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
639
						double auxT = Double.parseDouble(fea.getProp("thickness"));
640
						feature.set(ID_FIELD_THICKNESS,auxT);
641
//						auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
642
						// Attributes
643
						for (int j = 0; j < nAtt; j++) {
644
							String[] attributes = new String[2];
645
							attributes = (String[]) featureMaker.getAttributes()
646
							.get(j);
647
							feature.set(10+j,attributes[1]);
648
//							auxRow[10 + j] = ValueFactory.createValue(new String(
649
//							attributes[1]));
650
							if (!fea.getProp(attributes[0]).equals(attributes[1])) {
651
								feature.set(10+j,fea.getProp(attributes[0]));
652
//								auxRow[10 + j] = ValueFactory
653
//								.createValue(new String(fea
654
//								.getProp(attributes[0])));
655
							}
656
						}
657
						IGeometry geom=ShapeFactory.createPoint3D(pto.getX(), pto.getY(), pto.getZ());
658
						feature.set(ID_FIELD_FSHAPE,geom);
659
//						feature.setDefaultGeometry(geom);
660
						addFeature(feature);
661
//						addShape(nuevoShp, auxRow);
662
					}
663
				} else if (fea.getGeometry() instanceof LineString
664
						&& !(fea.getGeometry() instanceof LineString3D)) {
665
					GeneralPathX genPathX = new GeneralPathX();
666
					Point2D[] pts = new Point2D[fea.getGeometry().pointNr()];
667
					for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
668
						pts[j] = fea.getGeometry().get(j);
669
					}
670
					genPathX.moveTo(pts[0].getX(), pts[0].getY());
671
					for (int j = 1; j < pts.length; j++) {
672
						genPathX.lineTo(pts[j].getX(), pts[j].getY());
673
					}
438 674
					feature.set(ID_FIELD_ID,i);
439
//					auxRow[ID_FIELD_ID] = new Integer(i);
440
//					feature.set(ID_FIELD_FSHAPE,"Point2D");
441
//					auxRow[ID_FIELD_FSHAPE] = new String("FPoint2D");
675
//					auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
676
					feature.set(ID_FIELD_FSHAPE,"Polyline2D");
677
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
678
//					"FPolyline2D"));
442 679
					feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
443
//					auxRow[ID_FIELD_ENTITY] = new String(fea.getProp("dxfEntity"));
680
//					auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
681
//					fea.getProp("dxfEntity")));
444 682
					feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
445
//					auxRow[ID_FIELD_LAYER] = new String(fea.getProp("layer"));
683
//					auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
684
//					fea.getProp("layer")));
446 685
					int auxInt = Integer.parseInt(fea.getProp("color"));
447 686
					feature.set(ID_FIELD_COLOR,auxInt);
448
//					auxRow[ID_FIELD_COLOR] = new Integer(auxInt);
449
					feature.set(ID_FIELD_TEXT,fea.getProp("text"));
450
//					auxRow[ID_FIELD_TEXT] = ValueFactory
451
//							.createValue(new String(fea.getProp("text")));
452
					heightText = Float.parseFloat(fea.getProp("textHeight"));
453
					feature.set(ID_FIELD_HEIGHTTEXT,heightText);
454
//					auxRow[ID_FIELD_HEIGHTTEXT] = ValueFactory
455
//							.createValue(heightText);
456
					double auxR = Double.parseDouble(fea
457
							.getProp("textRotation"));
458
					feature.set(ID_FIELD_ROTATIONTEXT,auxR);
459
//					auxRow[ID_FIELD_ROTATIONTEXT] = ValueFactory
460
//							.createValue(auxR);
687
//					auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
461 688
					double auxE = Double.parseDouble(fea.getProp("elevation"));
462 689
					feature.set(ID_FIELD_ELEVATION,auxE);
463 690
//					auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
......
467 694
					// Attributes
468 695
					for (int j = 0; j < nAtt; j++) {
469 696
						String[] attributes = new String[2];
470
						attributes = (String[]) featureMaker.getAttributes()
471
								.get(j);
697
						attributes = (String[]) featureMaker.getAttributes().get(j);
472 698
						feature.set(10+j,attributes[1]);
473 699
//						auxRow[10 + j] = ValueFactory.createValue(new String(
474
//								attributes[1]));
700
//						attributes[1]));
475 701
						if (!fea.getProp(attributes[0]).equals(attributes[1])) {
476 702
							feature.set(10+j,fea.getProp(attributes[0]));
477
//							auxRow[10 + j] = ValueFactory
478
//									.createValue(new String(fea
479
//											.getProp(attributes[0])));
703
//							auxRow[10 + j] = ValueFactory.createValue(new String(
704
//							fea.getProp(attributes[0])));
480 705
						}
481 706
					}
482
					IGeometry geom=ShapeFactory.createPoint2D(new FPoint2D(pto.getX(), pto.getY()));
707
					IGeometry geom=ShapeFactory.createPolyline2D(genPathX);
483 708
					feature.set(ID_FIELD_FSHAPE,geom);
484 709
//					feature.setDefaultGeometry(geom);
485 710
					addFeature(feature);
486

  
487 711
//					addShape(nuevoShp, auxRow);
488
				} else {
712
				} else if (fea.getGeometry() instanceof LineString3D) {
713
					GeneralPathX genPathX = new GeneralPathX();
714
					Point3D[] pts = new Point3D[fea.getGeometry().pointNr()];
715
					for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
716
						pts[j] = ((LineString3D) fea.getGeometry()).getPoint3D(j);
717
					}
718
					genPathX.moveTo(pts[0].getX(), pts[0].getY());
719
					for (int j = 1; j < pts.length; j++) {
720
						genPathX.lineTo(pts[j].getX(), pts[j].getY());
721
					}
722
					double[] elevations = new double[pts.length];
723
					for (int j = 0; j < pts.length; j++) {
724
						elevations[j] = pts[j].getZ();
725
					}
489 726
					feature.set(ID_FIELD_ID,i);
490 727
//					auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
491
//					feature.set(ID_FIELD_FSHAPE,"Point2D");
492
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory
493
//							.createValue(new String("FPoint2D"));
728
					feature.set(ID_FIELD_FSHAPE,"Polyline3D");
729
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
730
//					"FPolyline3D"));
494 731
					feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
495
//					auxRow[ID_FIELD_ENTITY] = ValueFactory
496
//							.createValue(new String(fea.getProp("dxfEntity")));
732
//					auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
733
//					fea.getProp("dxfEntity")));
497 734
					feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
498
//					auxRow[ID_FIELD_LAYER] = ValueFactory
499
//							.createValue(new String(fea.getProp("layer")));
735
//					auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
736
//					fea.getProp("layer")));
500 737
					int auxInt = Integer.parseInt(fea.getProp("color"));
501 738
					feature.set(ID_FIELD_COLOR,auxInt);
502 739
//					auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
503
					double auxE = Double.parseDouble(fea.getProp("elevation"));
504
					feature.set(ID_FIELD_ELEVATION,auxE);
505
//					auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
740
					if (fea.getProp("elevation") != null) {
741
						double auxE = Double.parseDouble(fea.getProp("elevation"));
742
						feature.set(ID_FIELD_ELEVATION,auxE);
743
//						auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
744
					}
506 745
					double auxT = Double.parseDouble(fea.getProp("thickness"));
507 746
					feature.set(ID_FIELD_THICKNESS,auxT);
508 747
//					auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
509 748
					// Attributes
510 749
					for (int j = 0; j < nAtt; j++) {
511 750
						String[] attributes = new String[2];
512
						attributes = (String[]) featureMaker.getAttributes()
513
								.get(j);
751
						attributes = (String[]) featureMaker.getAttributes().get(j);
514 752
						feature.set(10+j,attributes[1]);
515 753
//						auxRow[10 + j] = ValueFactory.createValue(new String(
516
//								attributes[1]));
754
//						attributes[1]));
517 755
						if (!fea.getProp(attributes[0]).equals(attributes[1])) {
518 756
							feature.set(10+j,fea.getProp(attributes[0]));
519
//							auxRow[10 + j] = ValueFactory
520
//									.createValue(new String(fea
521
//											.getProp(attributes[0])));
757
//							auxRow[10 + j] = ValueFactory.createValue(new String(
758
//							fea.getProp(attributes[0])));
522 759
						}
523 760
					}
524
					IGeometry geom=ShapeFactory.createPoint2D(new FPoint2D(pto.getX(), pto.getY()));
761
					IGeometry geom=ShapeFactory.createPolyline3D(genPathX,elevations);
525 762
					feature.set(ID_FIELD_FSHAPE,geom);
526 763
//					feature.setDefaultGeometry(geom);
527 764
					addFeature(feature);
528 765
//					addShape(nuevoShp, auxRow);
529
				}
530
			} else if (fea.getGeometry() instanceof org.cresques.px.gml.Point3D) {
531
				org.cresques.px.gml.Point3D point = (org.cresques.px.gml.Point3D) fea
532
						.getGeometry();
533
				Point3D pto = new Point3D();
534
				pto = point.getPoint3D(0);
535
				FShape nuevoShp;
536
				if (point.isTextPoint()) {
766
				} else if (fea.getGeometry() instanceof Polygon
767
						&& !(fea.getGeometry() instanceof Polygon3D)) {
768
					GeneralPathX genPathX = new GeneralPathX();
769
					// 050112: A?ado una posici?n m?s para el punto que cierra y
770
					// creo el objeto firstPt.
771
					Point2D firstPt = new Point2D.Double();
772
					firstPt = fea.getGeometry().get(0);
773
					Point2D[] pts = new Point2D[fea.getGeometry().pointNr() + 1];
774
					for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
775
						pts[j] = fea.getGeometry().get(j);
776
					}
777
					// 050112: A?ado el primer punto al final para cerrar los
778
					// pol?gonos.
779
					pts[fea.getGeometry().pointNr()] = firstPt;
780
					genPathX.moveTo(pts[0].getX(), pts[0].getY());
781
					for (int j = 1; j < pts.length; j++) {
782
						genPathX.lineTo(pts[j].getX(), pts[j].getY());
783
					}
537 784
					feature.set(ID_FIELD_ID,i);
538 785
//					auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
539
					feature.set(ID_FIELD_FSHAPE,"Point3D");
540
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory
541
//							.createValue(new String("FPoint3D"));
786
					feature.set(ID_FIELD_FSHAPE,"Polygon2D");
787
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
788
//					"FPolygon2D"));
542 789
					feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
543
//					auxRow[ID_FIELD_ENTITY] = ValueFactory
544
//							.createValue(new String(fea.getProp("dxfEntity")));
790
//					auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
791
//					fea.getProp("dxfEntity")));
545 792
					feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
546
//					auxRow[ID_FIELD_LAYER] = ValueFactory
547
//							.createValue(new String(fea.getProp("layer")));
793
//					auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
794
//					fea.getProp("layer")));
548 795
					int auxInt = Integer.parseInt(fea.getProp("color"));
549 796
					feature.set(ID_FIELD_COLOR,auxInt);
550 797
//					auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
551
					feature.set(ID_FIELD_TEXT,fea.getProp("text"));
552
//					auxRow[ID_FIELD_TEXT] = ValueFactory
553
//							.createValue(new String(fea.getProp("text")));
554
					heightText = Float.parseFloat(fea.getProp("textHeight"));
555
					feature.set(ID_FIELD_HEIGHTTEXT,heightText);
556
//					auxRow[ID_FIELD_HEIGHTTEXT] = ValueFactory
557
//							.createValue(heightText);
558
					double auxR = Double.parseDouble(fea
559
							.getProp("textRotation"));
560
					feature.set(ID_FIELD_ROTATIONTEXT,auxR);
561
//					auxRow[ID_FIELD_ROTATIONTEXT] = ValueFactory
562
//							.createValue(auxR);
563 798
					double auxE = Double.parseDouble(fea.getProp("elevation"));
564 799
					feature.set(ID_FIELD_ELEVATION,auxE);
565 800
//					auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
......
569 804
					// Attributes
570 805
					for (int j = 0; j < nAtt; j++) {
571 806
						String[] attributes = new String[2];
572
						attributes = (String[]) featureMaker.getAttributes()
573
								.get(j);
807
						attributes = (String[]) featureMaker.getAttributes().get(j);
574 808
						feature.set(10+j,attributes[1]);
575 809
//						auxRow[10 + j] = ValueFactory.createValue(new String(
576
//								attributes[1]));
810
//						attributes[1]));
577 811
						if (!fea.getProp(attributes[0]).equals(attributes[1])) {
578 812
							feature.set(10+j,fea.getProp(attributes[0]));
579
//							auxRow[10 + j] = ValueFactory
580
//									.createValue(new String(fea
581
//											.getProp(attributes[0])));
813
//							auxRow[10 + j] = ValueFactory.createValue(new String(
814
//							fea.getProp(attributes[0])));
582 815
						}
583 816
					}
584
					IGeometry geom=ShapeFactory.createPoint3D(pto.getX(), pto.getY(), pto.getZ());
817
					IGeometry geom=ShapeFactory.createPolygon2D(genPathX);
585 818
					feature.set(ID_FIELD_FSHAPE,geom);
586 819
//					feature.setDefaultGeometry(geom);
587 820
					addFeature(feature);
588 821
//					addShape(nuevoShp, auxRow);
589
				} else {
822
				} else if (fea.getGeometry() instanceof Polygon3D) {
823
					GeneralPathX genPathX = new GeneralPathX();
824
					// 050112: A?ado una posici?n m?s para el punto que cierra y
825
					// creo el objeto firstPt.
826
					Point3D firstPt = new Point3D();
827
					firstPt = ((Polygon3D) fea.getGeometry())
828
					.getPoint3D(0);
829
					Point3D[] pts = new Point3D[fea.getGeometry().pointNr() + 1];
830
					for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
831
						pts[j] = ((Polygon3D) fea.getGeometry())
832
						.getPoint3D(j);
833
					}
834
					// 050112: A?ado el primer punto al final para cerrar los
835
					// pol?gonos.
836
					pts[fea.getGeometry().pointNr()] = firstPt;
837
					genPathX.moveTo(pts[0].getX(), pts[0].getY());
838
					for (int j = 1; j < pts.length; j++) {
839
						genPathX.lineTo(pts[j].getX(), pts[j].getY());
840
					}
841
					double[] elevations = new double[pts.length];
842
					for (int j = 0; j < pts.length; j++) {
843
						elevations[j] = pts[j].getZ();
844
					}
590 845
					feature.set(ID_FIELD_ID,i);
591 846
//					auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
592
					feature.set(ID_FIELD_FSHAPE,"Point3D");
593
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory
594
//							.createValue(new String("FPoint3D"));
847
					feature.set(ID_FIELD_FSHAPE,"Polygon3D");
848
//					auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
849
//					"FPolygon3D"));
595 850
					feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
596
//					auxRow[ID_FIELD_ENTITY] = ValueFactory
597
//							.createValue(new String(fea.getProp("dxfEntity")));
851
//					auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
852
//					fea.getProp("dxfEntity")));
598 853
					feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
599
//					auxRow[ID_FIELD_LAYER] = ValueFactory
600
//							.createValue(new String(fea.getProp("layer")));
854
//					auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
855
//					fea.getProp("layer")));
601 856
					int auxInt = Integer.parseInt(fea.getProp("color"));
602 857
					feature.set(ID_FIELD_COLOR,auxInt);
603 858
//					auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
604

  
605
					double auxE = Double.parseDouble(fea.getProp("elevation"));
606
					feature.set(ID_FIELD_ELEVATION,auxE);
607
//					auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
859
					if (fea.getProp("elevation") != null) {
860
						double auxE = Double.parseDouble(fea.getProp("elevation"));
861
						feature.set(ID_FIELD_ELEVATION,auxE);
862
//						auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
863
					}
608 864
					double auxT = Double.parseDouble(fea.getProp("thickness"));
609 865
					feature.set(ID_FIELD_THICKNESS,auxT);
610 866
//					auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
611 867
					// Attributes
612 868
					for (int j = 0; j < nAtt; j++) {
613 869
						String[] attributes = new String[2];
614
						attributes = (String[]) featureMaker.getAttributes()
615
								.get(j);
870
						attributes = (String[]) featureMaker.getAttributes().get(j);
616 871
						feature.set(10+j,attributes[1]);
617 872
//						auxRow[10 + j] = ValueFactory.createValue(new String(
618
//								attributes[1]));
873
//						attributes[1]));
619 874
						if (!fea.getProp(attributes[0]).equals(attributes[1])) {
620 875
							feature.set(10+j,fea.getProp(attributes[0]));
621
//							auxRow[10 + j] = ValueFactory
622
//									.createValue(new String(fea
623
//											.getProp(attributes[0])));
876
//							auxRow[10 + j] = ValueFactory.createValue(new String(
877
//							fea.getProp(attributes[0])));
624 878
						}
625 879
					}
626
					IGeometry geom=ShapeFactory.createPoint3D(pto.getX(), pto.getY(), pto.getZ());
880
					IGeometry geom=ShapeFactory.createPolygon3D(genPathX,elevations);
627 881
					feature.set(ID_FIELD_FSHAPE,geom);
628 882
//					feature.setDefaultGeometry(geom);
629 883
					addFeature(feature);
630 884
//					addShape(nuevoShp, auxRow);
885
				} else {
886
					// System.out.println("Detectado feature desconocido");
631 887
				}
632
			} else if (fea.getGeometry() instanceof LineString
633
					&& !(fea.getGeometry() instanceof LineString3D)) {
634
				GeneralPathX genPathX = new GeneralPathX();
635
				Point2D[] pts = new Point2D[fea.getGeometry().pointNr()];
636
				for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
637
					pts[j] = fea.getGeometry().get(j);
638
				}
639
				genPathX.moveTo(pts[0].getX(), pts[0].getY());
640
				for (int j = 1; j < pts.length; j++) {
641
					genPathX.lineTo(pts[j].getX(), pts[j].getY());
642
				}
643
				feature.set(ID_FIELD_ID,i);
644
//				auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
645
				feature.set(ID_FIELD_FSHAPE,"Polyline2D");
646
//				auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
647
//						"FPolyline2D"));
648
				feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
649
//				auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
650
//						fea.getProp("dxfEntity")));
651
				feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
652
//				auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
653
//						fea.getProp("layer")));
654
				int auxInt = Integer.parseInt(fea.getProp("color"));
655
				feature.set(ID_FIELD_COLOR,auxInt);
656
//				auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
657
				double auxE = Double.parseDouble(fea.getProp("elevation"));
658
				feature.set(ID_FIELD_ELEVATION,auxE);
659
//				auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
660
				double auxT = Double.parseDouble(fea.getProp("thickness"));
661
				feature.set(ID_FIELD_THICKNESS,auxT);
662
//				auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
663
				// Attributes
664
				for (int j = 0; j < nAtt; j++) {
665
					String[] attributes = new String[2];
666
					attributes = (String[]) featureMaker.getAttributes().get(j);
667
					feature.set(10+j,attributes[1]);
668
//					auxRow[10 + j] = ValueFactory.createValue(new String(
669
//							 attributes[1]));
670
					if (!fea.getProp(attributes[0]).equals(attributes[1])) {
671
						feature.set(10+j,fea.getProp(attributes[0]));
672
//						auxRow[10 + j] = ValueFactory.createValue(new String(
673
//								fea.getProp(attributes[0])));
674
					}
675
				}
676
				IGeometry geom=ShapeFactory.createPolyline2D(genPathX);
677
				feature.set(ID_FIELD_FSHAPE,geom);
678
//				feature.setDefaultGeometry(geom);
679
				addFeature(feature);
680
//				addShape(nuevoShp, auxRow);
681
			} else if (fea.getGeometry() instanceof LineString3D) {
682
				GeneralPathX genPathX = new GeneralPathX();
683
				Point3D[] pts = new Point3D[fea.getGeometry().pointNr()];
684
				for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
685
					pts[j] = ((LineString3D) fea.getGeometry()).getPoint3D(j);
686
				}
687
				genPathX.moveTo(pts[0].getX(), pts[0].getY());
688
				for (int j = 1; j < pts.length; j++) {
689
					genPathX.lineTo(pts[j].getX(), pts[j].getY());
690
				}
691
				double[] elevations = new double[pts.length];
692
				for (int j = 0; j < pts.length; j++) {
693
					elevations[j] = pts[j].getZ();
694
				}
695
				feature.set(ID_FIELD_ID,i);
696
//				auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
697
				feature.set(ID_FIELD_FSHAPE,"Polyline3D");
698
//				auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
699
//						"FPolyline3D"));
700
				feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
701
//				auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
702
//						fea.getProp("dxfEntity")));
703
				feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
704
//				auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
705
//						fea.getProp("layer")));
706
				int auxInt = Integer.parseInt(fea.getProp("color"));
707
				feature.set(ID_FIELD_COLOR,auxInt);
708
//				auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
709
				if (fea.getProp("elevation") != null) {
710
					double auxE = Double.parseDouble(fea.getProp("elevation"));
711
					feature.set(ID_FIELD_ELEVATION,auxE);
712
//					auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
713
				}
714
				double auxT = Double.parseDouble(fea.getProp("thickness"));
715
				feature.set(ID_FIELD_THICKNESS,auxT);
716
//				auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
717
				// Attributes
718
				for (int j = 0; j < nAtt; j++) {
719
					String[] attributes = new String[2];
720
					attributes = (String[]) featureMaker.getAttributes().get(j);
721
					feature.set(10+j,attributes[1]);
722
//					auxRow[10 + j] = ValueFactory.createValue(new String(
723
//							attributes[1]));
724
					if (!fea.getProp(attributes[0]).equals(attributes[1])) {
725
						feature.set(10+j,fea.getProp(attributes[0]));
726
//						auxRow[10 + j] = ValueFactory.createValue(new String(
727
//								fea.getProp(attributes[0])));
728
					}
729
				}
730
				IGeometry geom=ShapeFactory.createPolyline3D(genPathX,elevations);
731
				feature.set(ID_FIELD_FSHAPE,geom);
732
//				feature.setDefaultGeometry(geom);
733
				addFeature(feature);
734
//				addShape(nuevoShp, auxRow);
735
			} else if (fea.getGeometry() instanceof Polygon
736
					&& !(fea.getGeometry() instanceof Polygon3D)) {
737
				GeneralPathX genPathX = new GeneralPathX();
738
				// 050112: A?ado una posici?n m?s para el punto que cierra y
739
				// creo el objeto firstPt.
740
				Point2D firstPt = new Point2D.Double();
741
				firstPt = fea.getGeometry().get(0);
742
				Point2D[] pts = new Point2D[fea.getGeometry().pointNr() + 1];
743
				for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
744
					pts[j] = fea.getGeometry().get(j);
745
				}
746
				// 050112: A?ado el primer punto al final para cerrar los
747
				// pol?gonos.
748
				pts[fea.getGeometry().pointNr()] = firstPt;
749
				genPathX.moveTo(pts[0].getX(), pts[0].getY());
750
				for (int j = 1; j < pts.length; j++) {
751
					genPathX.lineTo(pts[j].getX(), pts[j].getY());
752
				}
753
				feature.set(ID_FIELD_ID,i);
754
//				auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
755
				feature.set(ID_FIELD_FSHAPE,"Polygon2D");
756
//				auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
757
//						"FPolygon2D"));
758
				feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
759
//				auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
760
//						fea.getProp("dxfEntity")));
761
				feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
762
//				auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
763
//						fea.getProp("layer")));
764
				int auxInt = Integer.parseInt(fea.getProp("color"));
765
				feature.set(ID_FIELD_COLOR,auxInt);
766
//				auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
767
				double auxE = Double.parseDouble(fea.getProp("elevation"));
768
				feature.set(ID_FIELD_ELEVATION,auxE);
769
//				auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
770
				double auxT = Double.parseDouble(fea.getProp("thickness"));
771
				feature.set(ID_FIELD_THICKNESS,auxT);
772
//				auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
773
				// Attributes
774
				for (int j = 0; j < nAtt; j++) {
775
					String[] attributes = new String[2];
776
					attributes = (String[]) featureMaker.getAttributes().get(j);
777
					feature.set(10+j,attributes[1]);
778
//					auxRow[10 + j] = ValueFactory.createValue(new String(
779
//							attributes[1]));
780
					if (!fea.getProp(attributes[0]).equals(attributes[1])) {
781
						feature.set(10+j,fea.getProp(attributes[0]));
782
//						auxRow[10 + j] = ValueFactory.createValue(new String(
783
//								fea.getProp(attributes[0])));
784
					}
785
				}
786
				IGeometry geom=ShapeFactory.createPolygon2D(genPathX);
787
				feature.set(ID_FIELD_FSHAPE,geom);
788
//				feature.setDefaultGeometry(geom);
789
				addFeature(feature);
790
//				addShape(nuevoShp, auxRow);
791
			} else if (fea.getGeometry() instanceof Polygon3D) {
792
				GeneralPathX genPathX = new GeneralPathX();
793
				// 050112: A?ado una posici?n m?s para el punto que cierra y
794
				// creo el objeto firstPt.
795
				Point3D firstPt = new Point3D();
796
				firstPt = ((Polygon3D) fea.getGeometry())
797
						.getPoint3D(0);
798
				Point3D[] pts = new Point3D[fea.getGeometry().pointNr() + 1];
799
				for (int j = 0; j < fea.getGeometry().pointNr(); j++) {
800
					pts[j] = ((Polygon3D) fea.getGeometry())
801
							.getPoint3D(j);
802
				}
803
				// 050112: A?ado el primer punto al final para cerrar los
804
				// pol?gonos.
805
				pts[fea.getGeometry().pointNr()] = firstPt;
806
				genPathX.moveTo(pts[0].getX(), pts[0].getY());
807
				for (int j = 1; j < pts.length; j++) {
808
					genPathX.lineTo(pts[j].getX(), pts[j].getY());
809
				}
810
				double[] elevations = new double[pts.length];
811
				for (int j = 0; j < pts.length; j++) {
812
					elevations[j] = pts[j].getZ();
813
				}
814
				feature.set(ID_FIELD_ID,i);
815
//				auxRow[ID_FIELD_ID] = ValueFactory.createValue(i);
816
				feature.set(ID_FIELD_FSHAPE,"Polygon3D");
817
//				auxRow[ID_FIELD_FSHAPE] = ValueFactory.createValue(new String(
818
//						"FPolygon3D"));
819
				feature.set(ID_FIELD_ENTITY,fea.getProp("dxfEntity"));
820
//				auxRow[ID_FIELD_ENTITY] = ValueFactory.createValue(new String(
821
//						fea.getProp("dxfEntity")));
822
				feature.set(ID_FIELD_LAYER,fea.getProp("layer"));
823
//				auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(new String(
824
//						fea.getProp("layer")));
825
				int auxInt = Integer.parseInt(fea.getProp("color"));
826
				feature.set(ID_FIELD_COLOR,auxInt);
827
//				auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(auxInt);
828
				if (fea.getProp("elevation") != null) {
829
					double auxE = Double.parseDouble(fea.getProp("elevation"));
830
					feature.set(ID_FIELD_ELEVATION,auxE);
831
//					auxRow[ID_FIELD_ELEVATION] = ValueFactory.createValue(auxE);
832
				}
833
				double auxT = Double.parseDouble(fea.getProp("thickness"));
834
				feature.set(ID_FIELD_THICKNESS,auxT);
835
//				auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(auxT);
836
				// Attributes
837
				for (int j = 0; j < nAtt; j++) {
838
					String[] attributes = new String[2];
839
					attributes = (String[]) featureMaker.getAttributes().get(j);
840
					feature.set(10+j,attributes[1]);
841
//					auxRow[10 + j] = ValueFactory.createValue(new String(
842
//							attributes[1]));
843
					if (!fea.getProp(attributes[0]).equals(attributes[1])) {
844
						feature.set(10+j,fea.getProp(attributes[0]));
845
//						auxRow[10 + j] = ValueFactory.createValue(new String(
846
//								fea.getProp(attributes[0])));
847
					}
848
				}
849
				IGeometry geom=ShapeFactory.createPolygon3D(genPathX,elevations);
850
				feature.set(ID_FIELD_FSHAPE,geom);
851
//				feature.setDefaultGeometry(geom);
852
				addFeature(feature);
853
//				addShape(nuevoShp, auxRow);
854
			} else {
855
				// System.out.println("Detectado feature desconocido");
888
				feature.stopLoading();
889
			}catch (IsNotFeatureSettingException e) {
890
				e.printStackTrace();
856 891
			}
857
			feature.stopLoading();
858 892
		}
859 893

  
860 894
		defaultLegend = LegendFactory
trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dgn/DGNStore.java
39 39
import org.gvsig.data.vectorial.IFeatureCollection;
40 40
import org.gvsig.data.vectorial.IFeatureID;
41 41
import org.gvsig.data.vectorial.IFeatureType;
42
import org.gvsig.data.vectorial.IsNotAttributeSettingException;
42 43
import org.gvsig.data.vectorial.IsNotFeatureSettingException;
43 44
import org.gvsig.data.vectorial.filter.FeatureFilterParser;
44 45
import org.gvsig.data.vectorial.order.FeatureComparator;
......
85 86

  
86 87
	static IFeatureType newFeatureType(){
87 88
		DefaultFeatureType fType= new DefaultFeatureType();
89
		try {
90
			DefaultAttributeDescriptor descriptorID = new DefaultAttributeDescriptor();
91
			descriptorID.loading();
92
			descriptorID.setType(IFeatureAttributeDescriptor.TYPE_INT);
93
			descriptorID.setName("ID");
94
			descriptorID.setDefaultValue(new Integer(0));
95
			descriptorID.stopLoading();
96
			fType.add(descriptorID);
97
			fType.setFieldsId(new String[] {"ID"});
88 98

  
89
		DefaultAttributeDescriptor descriptorID = new DefaultAttributeDescriptor();
90
		descriptorID.setType(IFeatureAttributeDescriptor.TYPE_INT);
91
		descriptorID.setName("ID");
92
		descriptorID.setDefaultValue(new Integer(0));
93
		fType.add(descriptorID);
94
		fType.setFieldsId(new String[] {"ID"});
99
			DefaultAttributeDescriptor descriptorEntity = new DefaultAttributeDescriptor();
100
			descriptorEntity.loading();
101
			descriptorEntity.setType(IFeatureAttributeDescriptor.TYPE_STRING);
102
			descriptorEntity.setName("Entity");
103
			descriptorEntity.setDefaultValue("Entity");
104
			descriptorEntity.stopLoading();
105
			fType.add(descriptorEntity);
95 106

  
96
		DefaultAttributeDescriptor descriptorEntity = new DefaultAttributeDescriptor();
97
		descriptorEntity.setType(IFeatureAttributeDescriptor.TYPE_STRING);
98
		descriptorEntity.setName("Entity");
99
		descriptorEntity.setDefaultValue("Entity");
100
		fType.add(descriptorEntity);
107
			DefaultAttributeDescriptor descriptorLayer = new DefaultAttributeDescriptor();
108
			descriptorLayer.loading();
109
			descriptorLayer.setType(IFeatureAttributeDescriptor.TYPE_INT);
110
			descriptorLayer.setName("Layer");
111
			descriptorLayer.setDefaultValue(new Integer(0));
112
			descriptorLayer.stopLoading();
113
			fType.add(descriptorLayer);
101 114

  
102
		DefaultAttributeDescriptor descriptorLayer = new DefaultAttributeDescriptor();
103
		descriptorLayer.setType(IFeatureAttributeDescriptor.TYPE_INT);
104
		descriptorLayer.setName("Layer");
105
		descriptorLayer.setDefaultValue(new Integer(0));
106
		fType.add(descriptorLayer);
115
			DefaultAttributeDescriptor descriptorColor = new DefaultAttributeDescriptor();
116
			descriptorColor.loading();
117
			descriptorColor.setType(IFeatureAttributeDescriptor.TYPE_INT);
118
			descriptorColor.setName("Color");
119
			descriptorColor.setDefaultValue(new Integer(0));
120
			descriptorColor.stopLoading();
121
			fType.add(descriptorColor);
107 122

  
108
		DefaultAttributeDescriptor descriptorColor = new DefaultAttributeDescriptor();
109
		descriptorColor.setType(IFeatureAttributeDescriptor.TYPE_INT);
110
		descriptorColor.setName("Color");
111
		descriptorColor.setDefaultValue(new Integer(0));
112
		fType.add(descriptorColor);
123
			//		DefaultAttributeDescriptor descriptorElevation = new DefaultAttributeDescriptor();
124
			//		descriptorElevation.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
125
			//		descriptorElevation.setName("Elevation");
126
			//		descriptorElevation.setDefaultValue(new Double(0));
127
			//		featureType.add(descriptorElevation);
128
			//
129
			//		DefaultAttributeDescriptor descriptorThickness = new DefaultAttributeDescriptor();
130
			//		descriptorThickness.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
131
			//		descriptorThickness.setName("Thickness");
132
			//		descriptorThickness.setDefaultValue(new Double(0));
133
			//		featureType.add(descriptorThickness);
113 134

  
114
		//		DefaultAttributeDescriptor descriptorElevation = new DefaultAttributeDescriptor();
115
		//		descriptorElevation.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
116
		//		descriptorElevation.setName("Elevation");
117
		//		descriptorElevation.setDefaultValue(new Double(0));
118
		//		featureType.add(descriptorElevation);
119
		//
120
		//		DefaultAttributeDescriptor descriptorThickness = new DefaultAttributeDescriptor();
121
		//		descriptorThickness.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
122
		//		descriptorThickness.setName("Thickness");
123
		//		descriptorThickness.setDefaultValue(new Double(0));
124
		//		featureType.add(descriptorThickness);
135
			DefaultAttributeDescriptor descriptorHeightText = new DefaultAttributeDescriptor();
136
			descriptorHeightText.loading();
137
			descriptorHeightText.setType(IFeatureAttributeDescriptor.TYPE_FLOAT);
138
			descriptorHeightText.setName("HeightText");
139
			descriptorHeightText.setDefaultValue(new Float(0));
140
			descriptorHeightText.stopLoading();
141
			fType.add(descriptorHeightText);
125 142

  
126
		DefaultAttributeDescriptor descriptorHeightText = new DefaultAttributeDescriptor();
127
		descriptorHeightText.setType(IFeatureAttributeDescriptor.TYPE_FLOAT);
128
		descriptorHeightText.setName("HeightText");
129
		descriptorHeightText.setDefaultValue(new Float(0));
130
		fType.add(descriptorHeightText);
143
			DefaultAttributeDescriptor descriptorRotationText = new DefaultAttributeDescriptor();
144
			descriptorRotationText.loading();
145
			descriptorRotationText.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
146
			descriptorRotationText.setName("RotationText");
147
			descriptorRotationText.setDefaultValue(new Double(0));
148
			descriptorRotationText.stopLoading();
149
			fType.add(descriptorRotationText);
131 150

  
132
		DefaultAttributeDescriptor descriptorRotationText = new DefaultAttributeDescriptor();
133
		descriptorRotationText.setType(IFeatureAttributeDescriptor.TYPE_DOUBLE);
134
		descriptorRotationText.setName("RotationText");
135
		descriptorRotationText.setDefaultValue(new Double(0));
136
		fType.add(descriptorRotationText);
151
			DefaultAttributeDescriptor descriptorText = new DefaultAttributeDescriptor();
152
			descriptorText.loading();
153
			descriptorText.setType(IFeatureAttributeDescriptor.TYPE_STRING);
154
			descriptorText.setName("Text");
155
			descriptorText.setDefaultValue("");
156
			descriptorText.stopLoading();
157
			fType.add(descriptorText);
137 158

  
138
		DefaultAttributeDescriptor descriptorText = new DefaultAttributeDescriptor();
139
		descriptorText.setType(IFeatureAttributeDescriptor.TYPE_STRING);
140
		descriptorText.setName("Text");
141
		descriptorText.setDefaultValue("");
142
		fType.add(descriptorText);
159
			DefaultAttributeDescriptor descriptorShape = new DefaultAttributeDescriptor();
160
			descriptorShape.loading();
143 161

  
144
		DefaultAttributeDescriptor descriptorShape = new DefaultAttributeDescriptor();
145
		descriptorShape.setType(IFeatureAttributeDescriptor.TYPE_GEOMETRY);
146
		descriptorShape.setName("GEOMETRY");
147
		descriptorShape.setDefaultValue(null);
148
		fType.add(descriptorShape);
149
		fType.setDefaultGeometry("GEOMETRY");
162
			descriptorShape.setType(IFeatureAttributeDescriptor.TYPE_GEOMETRY);
163

  
164
			descriptorShape.setName("GEOMETRY");
165
			descriptorShape.setDefaultValue(null);
166
			descriptorShape.stopLoading();
167
			fType.add(descriptorShape);
168
			fType.setDefaultGeometry("GEOMETRY");
169
		} catch (IsNotAttributeSettingException e) {
170
			e.printStackTrace();
171
		}
150 172
		return fType;
151 173

  
152 174

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff