01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * Created on Jan 22, 2004
17: */
18: package org.geotools.validation.spatial;
19:
20: import java.beans.IntrospectionException;
21: import java.beans.PropertyDescriptor;
22: import java.util.ResourceBundle;
23:
24: /**
25: * LineAbstractValidationBeanInfopurpose.
26: *
27: * <p>
28: * Description of LineAbstractValidationBeanInfo...
29: * </p>
30: *
31: * @author dzwiers, Refractions Research, Inc.
32: * @author $Author: dmzwiers $ (last modification)
33: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/spatial/LineNoPseudoNodeValidationBeanInfo.java $
34: * @version $Id: LineNoPseudoNodeValidationBeanInfo.java 22266 2006-10-19 11:30:55Z acuster $
35: */
36: public class LineNoPseudoNodeValidationBeanInfo extends
37: LineAbstractValidationBeanInfo {
38: /**
39: * LineAbstractValidationBeanInfoconstructor.
40: *
41: * <p>
42: * Description
43: * </p>
44: */
45: public LineNoPseudoNodeValidationBeanInfo() {
46: super ();
47: }
48:
49: /**
50: * Implementation of getPropertyDescriptors.
51: *
52: *
53: * @see java.beans.BeanInfo#getPropertyDescriptors()
54: */
55: public PropertyDescriptor[] getPropertyDescriptors() {
56: PropertyDescriptor[] pd2 = super .getPropertyDescriptors();
57: ResourceBundle resourceBundle = getResourceBundle(LineNoPseudoNodeValidation.class);
58:
59: if (pd2 == null) {
60: pd2 = new PropertyDescriptor[0];
61: }
62:
63: PropertyDescriptor[] pd = new PropertyDescriptor[pd2.length + 1];
64: int i = 0;
65:
66: for (; i < pd2.length; i++)
67: pd[i] = pd2[i];
68:
69: try {
70: pd[i] = createPropertyDescriptor("degreesAllowable",
71: LineNoPseudoNodeValidation.class, resourceBundle);
72: pd[i].setExpert(false);
73: } catch (IntrospectionException e) {
74: pd = pd2;
75:
76: // TODO error, log here
77: e.printStackTrace();
78: }
79:
80: return pd;
81: }
82: }
|