svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.swing / org.gvsig.fmap.dal.swing.impl / src / main / java / org / gvsig / fmap / dal / swing / impl / featuretable / table / DynFieldFacadeOfAFeatureAttributeDescriptor.java @ 44160
History | View | Annotate | Download (11.3 KB)
1 |
|
---|---|
2 |
package org.gvsig.fmap.dal.swing.impl.featuretable.table; |
3 |
|
4 |
import java.text.DateFormat; |
5 |
import java.util.List; |
6 |
import org.cresques.cts.IProjection; |
7 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
8 |
import org.gvsig.fmap.dal.feature.FeatureAttributeEmulator; |
9 |
import org.gvsig.fmap.dal.feature.FeatureAttributeGetter; |
10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
11 |
import org.gvsig.fmap.dal.feature.FeatureType; |
12 |
import org.gvsig.fmap.geom.Geometry; |
13 |
import org.gvsig.fmap.geom.type.GeometryType; |
14 |
import org.gvsig.timesupport.Interval; |
15 |
import org.gvsig.tools.dataTypes.CoercionException; |
16 |
import org.gvsig.tools.dataTypes.DataType; |
17 |
import org.gvsig.tools.dynobject.DynField; |
18 |
import org.gvsig.tools.dynobject.DynField_v2; |
19 |
import org.gvsig.tools.dynobject.DynObjectValueItem; |
20 |
import org.gvsig.tools.dynobject.DynStruct; |
21 |
import org.gvsig.tools.dynobject.exception.DynFieldIsNotAContainerException; |
22 |
import org.gvsig.tools.dynobject.exception.DynFieldValidateException; |
23 |
import org.gvsig.tools.evaluator.Evaluator; |
24 |
|
25 |
|
26 |
public class DynFieldFacadeOfAFeatureAttributeDescriptor implements FeatureAttributeDescriptor { |
27 |
|
28 |
private DynField field;
|
29 |
public DynFieldFacadeOfAFeatureAttributeDescriptor(DynField field) {
|
30 |
this.field = field;
|
31 |
} |
32 |
|
33 |
@Override
|
34 |
public FeatureAttributeDescriptor getCopy() {
|
35 |
try {
|
36 |
return (FeatureAttributeDescriptor) field.clone();
|
37 |
} catch (CloneNotSupportedException ex) { |
38 |
throw new RuntimeException(ex); |
39 |
} |
40 |
} |
41 |
|
42 |
@Override
|
43 |
public String getDataTypeName() { |
44 |
return field.getDataType().getName();
|
45 |
} |
46 |
|
47 |
@Override
|
48 |
public int getSize() { |
49 |
return 1; |
50 |
} |
51 |
|
52 |
@Override
|
53 |
public int getPrecision() { |
54 |
return 0; |
55 |
} |
56 |
|
57 |
@Override
|
58 |
public Class getObjectClass() { |
59 |
return this.getDataType().getDefaultClass(); |
60 |
} |
61 |
|
62 |
@Override
|
63 |
public int getMinimumOccurrences() { |
64 |
return 0; |
65 |
} |
66 |
|
67 |
@Override
|
68 |
public int getMaximumOccurrences() { |
69 |
return 0; |
70 |
} |
71 |
|
72 |
@Override
|
73 |
public boolean isPrimaryKey() { |
74 |
return false; |
75 |
} |
76 |
|
77 |
@Override
|
78 |
public boolean allowNull() { |
79 |
return true; |
80 |
} |
81 |
|
82 |
@Override
|
83 |
public Evaluator getEvaluator() {
|
84 |
return null; |
85 |
} |
86 |
|
87 |
@Override
|
88 |
public IProjection getSRS() {
|
89 |
return null; |
90 |
} |
91 |
|
92 |
@Override
|
93 |
public int getGeometryType() { |
94 |
return Geometry.TYPES.GEOMETRY;
|
95 |
} |
96 |
|
97 |
@Override
|
98 |
public int getGeometrySubType() { |
99 |
return Geometry.SUBTYPES.UNKNOWN;
|
100 |
} |
101 |
|
102 |
@Override
|
103 |
public GeometryType getGeomType() {
|
104 |
return null; |
105 |
} |
106 |
|
107 |
@Override
|
108 |
public DateFormat getDateFormat() { |
109 |
return null; |
110 |
} |
111 |
|
112 |
@Override
|
113 |
public int getIndex() { |
114 |
return -1; |
115 |
} |
116 |
|
117 |
@Override
|
118 |
public Object getAdditionalInfo(String infoName) { |
119 |
return null; |
120 |
} |
121 |
|
122 |
@Override
|
123 |
public boolean isAutomatic() { |
124 |
return false; |
125 |
} |
126 |
|
127 |
@Override
|
128 |
public boolean isTime() { |
129 |
return false; |
130 |
} |
131 |
|
132 |
@Override
|
133 |
public boolean isIndexed() { |
134 |
return false; |
135 |
} |
136 |
|
137 |
@Override
|
138 |
public boolean allowIndexDuplicateds() { |
139 |
return false; |
140 |
} |
141 |
|
142 |
@Override
|
143 |
public boolean isIndexAscending() { |
144 |
return false; |
145 |
} |
146 |
|
147 |
@Override
|
148 |
public FeatureAttributeGetter getFeatureAttributeGetter() {
|
149 |
return null; |
150 |
} |
151 |
|
152 |
@Override
|
153 |
public void setFeatureAttributeGetter(FeatureAttributeGetter featureAttributeGetter) { |
154 |
} |
155 |
|
156 |
@Override
|
157 |
public FeatureAttributeEmulator getFeatureAttributeEmulator() {
|
158 |
return null; |
159 |
} |
160 |
|
161 |
@Override
|
162 |
public String getName() { |
163 |
return this.field.getName(); |
164 |
} |
165 |
|
166 |
@Override
|
167 |
public int getType() { |
168 |
return this.field.getDataType().getType(); |
169 |
} |
170 |
|
171 |
@Override
|
172 |
public DataType getDataType() {
|
173 |
return this.field.getDataType(); |
174 |
} |
175 |
|
176 |
@Override
|
177 |
public String getSubtype() { |
178 |
return null; |
179 |
} |
180 |
|
181 |
@Override
|
182 |
public String getDescription() { |
183 |
return this.field.getDescription(); |
184 |
} |
185 |
|
186 |
@Override
|
187 |
public Object getDefaultValue() { |
188 |
return this.field.getDefaultValue(); |
189 |
} |
190 |
|
191 |
@Override
|
192 |
public String getGroup() { |
193 |
return this.field.getGroup(); |
194 |
} |
195 |
|
196 |
@Override
|
197 |
public int getOder() { |
198 |
return this.field.getOder(); |
199 |
} |
200 |
|
201 |
@Override
|
202 |
public boolean isMandatory() { |
203 |
return this.field.isMandatory(); |
204 |
} |
205 |
|
206 |
@Override
|
207 |
public boolean isPersistent() { |
208 |
return this.field.isPersistent(); |
209 |
} |
210 |
|
211 |
@Override
|
212 |
public boolean isHidden() { |
213 |
return this.field.isHidden(); |
214 |
} |
215 |
|
216 |
@Override
|
217 |
public boolean isReadOnly() { |
218 |
return this.field.isReadOnly(); |
219 |
} |
220 |
|
221 |
@Override
|
222 |
public boolean isContainer() { |
223 |
return this.field.isContainer(); |
224 |
} |
225 |
|
226 |
@Override
|
227 |
public DynObjectValueItem[] getAvailableValues() { |
228 |
return this.field.getAvailableValues(); |
229 |
} |
230 |
|
231 |
@Override
|
232 |
public Object getMinValue() { |
233 |
return this.field.getMinValue(); |
234 |
} |
235 |
|
236 |
@Override
|
237 |
public Object getMaxValue() { |
238 |
return this.field.getMaxValue(); |
239 |
} |
240 |
|
241 |
@Override
|
242 |
public Class getClassOfValue() { |
243 |
return this.field.getClassOfValue(); |
244 |
} |
245 |
|
246 |
@Override
|
247 |
public Class getClassOfItems() { |
248 |
return this.field.getClassOfItems(); |
249 |
} |
250 |
|
251 |
@Override
|
252 |
public DynField setDescription(String description) { |
253 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
254 |
} |
255 |
|
256 |
@Override
|
257 |
public DynField setType(int type) { |
258 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
259 |
} |
260 |
|
261 |
@Override
|
262 |
public DynField setType(DataType type) {
|
263 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
264 |
} |
265 |
|
266 |
@Override
|
267 |
public DynField setSubtype(String subtype) { |
268 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
269 |
} |
270 |
|
271 |
@Override
|
272 |
public DynField setDefaultFieldValue(Object defaultValue) { |
273 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
274 |
} |
275 |
|
276 |
@Override
|
277 |
public DynField setGroup(String groupName) { |
278 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
279 |
} |
280 |
|
281 |
@Override
|
282 |
public DynField setOrder(int order) { |
283 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
284 |
} |
285 |
|
286 |
@Override
|
287 |
public DynField setMandatory(boolean mandatory) { |
288 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
289 |
} |
290 |
|
291 |
@Override
|
292 |
public DynField setHidden(boolean hidden) { |
293 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
294 |
} |
295 |
|
296 |
@Override
|
297 |
public DynField setPersistent(boolean persistent) { |
298 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
299 |
} |
300 |
|
301 |
@Override
|
302 |
public DynField setAvailableValues(DynObjectValueItem[] values) { |
303 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
304 |
} |
305 |
|
306 |
@Override
|
307 |
public DynField setAvailableValues(List values) { |
308 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
309 |
} |
310 |
|
311 |
@Override
|
312 |
public DynField setMinValue(Object minValue) { |
313 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
314 |
} |
315 |
|
316 |
@Override
|
317 |
public DynField setMaxValue(Object maxValue) { |
318 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
319 |
} |
320 |
|
321 |
@Override
|
322 |
public DynField setClassOfValue(Class theClass) throws DynFieldIsNotAContainerException { |
323 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
324 |
} |
325 |
|
326 |
@Override
|
327 |
public DynField setClassOfItems(Class theClass) throws DynFieldIsNotAContainerException { |
328 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
329 |
} |
330 |
|
331 |
@Override
|
332 |
public DynField setReadOnly(boolean isReadOnly) { |
333 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
334 |
} |
335 |
|
336 |
@Override
|
337 |
public DynField getElementsType() {
|
338 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
339 |
} |
340 |
|
341 |
@Override
|
342 |
public DynField setElementsType(int type) throws DynFieldIsNotAContainerException { |
343 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
344 |
} |
345 |
|
346 |
@Override
|
347 |
public DynField setElementsType(DynStruct type) throws DynFieldIsNotAContainerException { |
348 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
349 |
} |
350 |
|
351 |
@Override
|
352 |
public void validate(Object value) throws DynFieldValidateException { |
353 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
354 |
} |
355 |
|
356 |
@Override
|
357 |
public Object coerce(Object value) throws CoercionException { |
358 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
359 |
} |
360 |
|
361 |
@Override
|
362 |
public int getTheTypeOfAvailableValues() { |
363 |
return this.field.getTheTypeOfAvailableValues(); |
364 |
} |
365 |
|
366 |
@Override
|
367 |
public DynField setDefaultDynValue(Object defaultValue) { |
368 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
369 |
} |
370 |
|
371 |
@Override
|
372 |
public DynField setTheTypeOfAvailableValues(int type) { |
373 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
374 |
} |
375 |
|
376 |
@Override
|
377 |
public Object clone() throws CloneNotSupportedException { |
378 |
DynFieldFacadeOfAFeatureAttributeDescriptor other = (DynFieldFacadeOfAFeatureAttributeDescriptor) super.clone();
|
379 |
other.field = (DynField) other.field.clone(); |
380 |
return other;
|
381 |
} |
382 |
|
383 |
@Override
|
384 |
public boolean isComputed() { |
385 |
if( field instanceof DynField_v2 ) { |
386 |
return ((DynField_v2)field).isCalculated();
|
387 |
} |
388 |
return false; |
389 |
} |
390 |
|
391 |
@Override
|
392 |
public FeatureStore getStore() {
|
393 |
return null; |
394 |
} |
395 |
|
396 |
@Override
|
397 |
public FeatureType getFeatureType() {
|
398 |
return null; |
399 |
} |
400 |
|
401 |
@Override
|
402 |
public Interval getInterval() {
|
403 |
return null; |
404 |
} |
405 |
|
406 |
@Override
|
407 |
public String getDataProfileName() { |
408 |
return null; |
409 |
} |
410 |
|
411 |
@Override
|
412 |
public String[] getRequiredFieldNames() { |
413 |
return null; |
414 |
} |
415 |
} |