Revision 38316

View differences:

tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/querys/GazetteerOptions.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program 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
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
package org.gvsig.gazetteer.querys;
43

  
44
/**
45
 * This class is used to manage the aspect and the
46
 * filter of the gazetteer.
47
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
48
 */
49
public class GazetteerOptions {
50
	private AspectOptions aspect = null;
51
	private InteligentSearchOptions search = null;
52
	
53
	public GazetteerOptions(){
54
		aspect = new AspectOptions();
55
		search = new InteligentSearchOptions();
56
	}
57
	
58
	public AspectOptions getAspect() {
59
		return aspect;
60
	}
61

  
62
	public void setAspect(AspectOptions aspect) {
63
		this.aspect = aspect;
64
	}
65

  
66
	public InteligentSearchOptions getSearch() {
67
		return search;
68
	}
69

  
70
	public void setSearch(InteligentSearchOptions search) {
71
		this.search = search;
72
	}
73
	
74
	/**
75
	 * This class contains all the options to show the
76
	 * gazetteer search on the gvSIG view
77
	 * @author Jorge Piera Llodr? (piera_jor@gva.es)
78
	 */
79
	public class AspectOptions{
80
		private boolean goTo = false;
81
        private boolean keepOld = false;
82
        private boolean paintCurrent = false;
83
        
84
		public AspectOptions() {
85
			super();
86
		}
87
		
88
        public AspectOptions(boolean goTo, boolean keepOld, boolean paintCurrent) {
89
			super();
90
			// TODO Auto-generated constructor stub
91
			this.goTo = goTo;
92
			this.keepOld = keepOld;
93
			this.paintCurrent = paintCurrent;
94
		}
95
        
96
		public boolean isGoTo() {
97
			return goTo;
98
		}
99
		
100
		public void setGoTo(boolean goTo) {
101
			this.goTo = goTo;
102
		}
103
		
104
		public boolean isKeepOld() {
105
			return keepOld;
106
		}
107
		public void setKeepOld(boolean keepOld) {
108
			this.keepOld = keepOld;
109
		}
110
		
111
		public boolean isPaintCurrent() {
112
			return paintCurrent;
113
		}
114
		
115
		public void setPaintCurrent(boolean paintCurrent) {
116
			this.paintCurrent = paintCurrent;
117
		}
118

  
119

  
120
        
121
	}
122
	
123
	/**
124
	 * This class contains all the options to realize
125
	 * the inteligent gazetteer search
126
	 * @author Jorge Piera Llodr? (piera_jor@gva.es)
127
	 */
128
	public class InteligentSearchOptions{
129
		private boolean withAccents = false;
130

  
131
		public InteligentSearchOptions() {
132
			super();
133
		}
134

  
135
		public InteligentSearchOptions(boolean withAccents) {
136
			super();
137
			// TODO Auto-generated constructor stub
138
			this.withAccents = withAccents;
139
		}
140

  
141
		public boolean isWithAccents() {
142
			return withAccents;
143
		}
144

  
145
		public void setWithAccents(boolean withAccents) {
146
			this.withAccents = withAccents;
147
		}
148
		
149
	}
150

  
151

  
152

  
153
}
0 154

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/querys/Feature.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program 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
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
package org.gvsig.gazetteer.querys;
43
import java.awt.geom.Point2D;
44

  
45
/**
46
 * This class represents a Feature into the WFS context
47
 * 
48
 * 
49
 * @author Jorge Piera Llodra (piera_jor@gva.es)
50
 */
51
public class Feature {
52
    private String Id;
53
    private String Name;
54
    private String Description;
55
    private Point2D coordinates;
56

  
57
/**
58
 * @param id 
59
 * @param name 
60
 * @param description 
61
 * @param coordinates 
62
 */
63
    public  Feature(String id, String name, String description, Point2D coordinates) {        
64
        super();
65
        Id = id;
66
        Name = name;
67
        Description = description;
68
        this.coordinates = coordinates;
69
    } 
70

  
71
/**
72
 * 
73
 * 
74
 * 
75
 * @return Returns the coordinates.
76
 */
77
    public Point2D getCoordinates() {        
78
        return coordinates;
79
    } 
80

  
81
/**
82
 * 
83
 * 
84
 * 
85
 * @param coordinates The coordinates to set.
86
 */
87
    public void setCoordinates(Point2D coordinates) {        
88
        this.coordinates = coordinates;
89
    } 
90

  
91
/**
92
 * 
93
 * 
94
 * 
95
 * @return Returns the description.
96
 */
97
    public String getDescription() {        
98
        return Description;
99
    } 
100

  
101
/**
102
 * 
103
 * 
104
 * 
105
 * @param description The description to set.
106
 */
107
    public void setDescription(String description) {        
108
        Description = description;
109
    } 
110

  
111
/**
112
 * 
113
 * 
114
 * 
115
 * @return Returns the id.
116
 */
117
    public String getId() {        
118
        return Id;
119
    } 
120

  
121
/**
122
 * 
123
 * 
124
 * 
125
 * @param id The id to set.
126
 */
127
    public void setId(String id) {        
128
        Id = id;
129
    } 
130

  
131
/**
132
 * 
133
 * 
134
 * 
135
 * @return Returns the name.
136
 */
137
    public String getName() {        
138
        return Name;
139
    } 
140

  
141
/**
142
 * 
143
 * 
144
 * 
145
 * @param name The name to set.
146
 */
147
    public void setName(String name) {        
148
        Name = name;
149
    } 
150

  
151
    /*
152
     * (non-Javadoc)
153
     * @see java.lang.Object#toString()
154
     */
155
    public String toString() {        
156
        return getDescription();
157
    } 
158
 }
0 159

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/querys/FeatureType.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program 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
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.gazetteer.querys;
43
import org.gvsig.catalog.querys.Coordinates;
44

  
45
/**
46
 * This class represents a thesaurus name (city, cementer, ...)
47
 * 
48
 * 
49
 * @author Jorge Piera Llodra (piera_jor@gva.es)
50
 */
51
public class FeatureType {
52
	private String name;
53
	private String title;
54
	private String abstract_;
55
	private FeatureTypeAttribute[] attributes = null;
56
	private String keywords;
57
	private String srs;
58
	private Coordinates coordinates;
59
	private FeatureType[] featureTypes;
60

  
61
	public  FeatureType() {        
62
		
63
	} 
64

  
65
	/**
66
	 * @param name 
67
	 */
68
	public  FeatureType(String name) {        
69
		this.name = name;		
70
	} 
71

  
72
	/**
73
	 * @return Returns the name.
74
	 */
75
	public String getName() {        
76
		return name;
77
	} 
78

  
79
	/**
80
	 * @param name The name to set.
81
	 */
82
	public void setName(String name) {        
83
		this.name = name;
84
	} 
85

  
86
	/**
87
	 * @return Returns the abstract_.
88
	 */
89
	public String getAbstract() {        
90
		return abstract_;
91
	} 
92

  
93
	/**
94
	 * @param abstract_ The abstract_ to set.
95
	 */
96
	public void setAbstract(String abstract_) {        
97
		this.abstract_ = abstract_;
98
	} 
99

  
100
	/**
101
	 * @return Returns the coordinates.
102
	 */
103
	public Coordinates getCoordinates() {        
104
		return coordinates;
105
	} 
106

  
107
	/**
108
	 * @param coordinates The coordinates to set.
109
	 */
110
	public void setCoordinates(Coordinates coordinates) {        
111
		this.coordinates = coordinates;
112
	} 
113

  
114
	/**
115
	 * @return Returns the keywords.
116
	 */
117
	public String getKeywords() {        
118
		return keywords;
119
	} 
120

  
121
	/**
122
	 * @param keywords The keywords to set.
123
	 */
124
	public void setKeywords(String keywords) {        
125
		this.keywords = keywords;
126
	} 
127

  
128
	/**
129
	 * @return Returns the srs.
130
	 */
131
	public String getSrs() {        
132
		return srs;
133
	} 
134

  
135
	/**
136
	 * @param srs The srs to set.
137
	 */
138
	public void setSrs(String srs) {        
139
		this.srs = srs;
140
	} 
141

  
142
	/**
143
	 * @return Returns the title.
144
	 */
145
	public String getTitle() {        
146
		return title;
147
	} 
148

  
149
	/**
150
	 * @param title The title to set.
151
	 */
152
	public void setTitle(String title) {        
153
		this.title = title;
154
	} 
155

  
156
	/**
157
	 * To load into a List
158
	 * @return 
159
	 */
160
	public String toString() {        
161
		return title;
162
	} 
163

  
164
	/**
165
	 * @return Returns the features.
166
	 */
167
	public FeatureType[] getFeatures() {        
168
		return featureTypes;
169
	} 
170

  
171
	/**
172
	 * @param features The features to set.
173
	 */
174
	public void setFeatures(FeatureType[] featureTypes) {        
175
		this.featureTypes = featureTypes;
176
	} 
177

  
178
	/**
179
	 * @return Returns the fields.
180
	 */
181
	public FeatureTypeAttribute[] getFields() {        
182
		return attributes; 
183
	} 
184

  
185
	/**
186
	 * @param fields The fields to set.
187
	 */
188
	public void setFields(FeatureTypeAttribute[] attributes) {        
189
		this.attributes = attributes;
190
	} 
191
}
0 192

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/querys/GazetteerQuery.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program 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
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.gazetteer.querys;
43
import org.gvsig.catalog.querys.Coordinates;
44
import org.gvsig.catalog.querys.DiscoveryServiceQuery;
45
import org.gvsig.catalog.utils.CatalogConstants;
46

  
47
/**
48
 * This class contains all the queryable fields that the user interface
49
 * supports.
50
 * @author Jorge Piera Llodra (piera_jor@gva.es)
51
 */
52
public class GazetteerQuery extends DiscoveryServiceQuery{
53
	private String name;
54
	private String nameFilter;
55
	private String fieldAttribute;
56
	private int recsByPage;
57
	private Coordinates coordinates;
58
	private String coordinatesFilter;
59
	private boolean isCoordinatesClicked;
60
	private GazetteerOptions options;
61
	public java.util.Collection thesaurusName = new java.util.ArrayList();
62
	
63

  
64
	/**
65
	 * @param name 
66
	 * @param nameFilter 
67
	 * @param feature 
68
	 * @param fieldAttribute 
69
	 * @param recsByPage 
70
	 * @param coordinates 
71
	 * @param coordinatesFilter 
72
	 */
73
	public GazetteerQuery(String name, String nameFilter, FeatureType[] feature, String fieldAttribute, int recsByPage, Coordinates coordinates, String coordinatesFilter) {        
74
		super();
75
		this.name = name;
76
		this.nameFilter = nameFilter;
77
		setFeatures(feature);
78
		this.fieldAttribute = fieldAttribute;
79
		this.recsByPage = recsByPage;
80
		this.coordinates = coordinates;
81
		this.coordinatesFilter = coordinatesFilter;
82
		options = new GazetteerOptions();
83
	} 
84

  
85
	/**
86
	 * Constructor
87
	 */
88
	public  GazetteerQuery() {        
89
		super();
90
		options = new GazetteerOptions();		
91
	} 
92

  
93
	/**
94
	 * To search a place by name
95
	 * @param name Place name
96
	 * @param description Thesaurus description
97
	 */
98
	public  GazetteerQuery(String name, String description) {        
99
		super();
100
		FeatureType[] thesaurus = new FeatureType[1];
101
		thesaurus[0] = new FeatureType();
102
		thesaurus[0].setName(description);
103
		this.name = name;
104
		this.nameFilter = CatalogConstants.ANY_WORD;
105
		setFeatures(thesaurus);
106
		this.recsByPage = 100;
107
		this.coordinates = null;
108
		this.coordinatesFilter = null;		
109
	} 
110

  
111
	/**
112
	 * @return Returns the coordinates.
113
	 */
114
	public Coordinates getCoordinates() {        
115
		return coordinates;
116
	} 
117

  
118
	/**
119
	 * @param coordinates The coordinates to set.
120
	 */
121
	public void setCoordinates(Coordinates coordinates) {        
122
		this.coordinates = coordinates;
123
	} 
124

  
125
	/**
126
	 * @return Returns the coordinatesFilter.
127
	 */
128
	public String getCoordinatesFilter() {        
129
		return coordinatesFilter;
130
	} 
131

  
132
	/**
133
	 * @param coordinatesFilter The coordinatesFilter to set.
134
	 */
135
	public void setCoordinatesFilter(String coordinatesFilter) {        
136
		this.coordinatesFilter = coordinatesFilter;
137
	} 
138

  
139
	/**
140
	 * @return Returns the feature.
141
	 */
142
	public FeatureType[] getFeatures() {        
143
		FeatureType[] aux = new FeatureType[thesaurusName.size()];
144
		for (int i=0 ; i<aux.length ; i++){
145
			aux[i] = (FeatureType)thesaurusName.toArray()[i];
146
		}
147
		return aux;  
148
	} 
149

  
150
	/**
151
	 * @param feature The feature to set.
152
	 * @param features The feature to set.
153
	 */
154
	public void setFeatures(FeatureType[] features) {        
155
		this.thesaurusName = new java.util.ArrayList();
156
		if (features == null){
157
			return;
158
		}
159
		for (int i=0 ; i<features.length ; i++){
160
			this.thesaurusName.add(features[i]);
161
		}     
162
	} 
163

  
164
	/**
165
	 * @return Returns the name.
166
	 */
167
	public String getName() {        
168
		return name;
169
	} 
170

  
171
	/**
172
	 * @param name The name to set.
173
	 */
174
	public void setName(String name) {        
175
		this.name = name;
176
	} 
177

  
178
	/**
179
	 * @return Returns the nameFilter.
180
	 */
181
	public String getNameFilter() {        
182
		return nameFilter;
183
	} 
184

  
185
	/**
186
	 * @param nameFilter The nameFilter to set.
187
	 */
188
	public void setNameFilter(String nameFilter) {        
189
		this.nameFilter = nameFilter;
190
	} 
191

  
192
	/**
193
	 * @return Returns the recsByPage.
194
	 */
195
	public int getRecsByPage() {        
196
		return recsByPage;
197
	} 
198

  
199
	/**
200
	 * @param recsByPage The recsByPage to set.
201
	 */
202
	public void setRecsByPage(int recsByPage) {        
203
		this.recsByPage = recsByPage;
204
	} 
205

  
206
	/**
207
	 * @return Returns the fieldAttribute.
208
	 */
209
	public String getFieldAttribute() {        
210
		return fieldAttribute;
211
	} 
212

  
213
	/**
214
	 * @param fieldAttribute The fieldAttribute to set.
215
	 */
216
	public void setFieldAttribute(String fieldAttribute) {        
217
		this.fieldAttribute = fieldAttribute;
218
	} 
219

  
220
	/**
221
	 * @return Returns the isCoordinatesClicked.
222
	 */
223
	public boolean isCoordinatesClicked() {        
224
		return isCoordinatesClicked;
225
	} 
226

  
227
	/**
228
	 * @param isCoordinatesClicked The isCoordinatesClicked to set.
229
	 */
230
	public void setCoordinatesClicked(boolean isCoordinatesClicked) {        
231
		this.isCoordinatesClicked = isCoordinatesClicked;
232
	}
233

  
234
	/**
235
	 * @return the gaazetter options
236
	 */	
237
	public GazetteerOptions getOptions() {
238
		return options;
239
	}
240

  
241
	/**
242
	 * Set the options
243
	 * @param options
244
	 */
245
	public void setOptions(GazetteerOptions options) {
246
		this.options = options;
247
	}
248

  
249
}
0 250

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/querys/FeatureTypeAttribute.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program 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
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.gazetteer.querys;
43

  
44
/**
45
 * This class represents a field from a thesaurus name 
46
 * (name,description,...)
47
 * @author Jorge Piera Llodra (piera_jor@gva.es)
48
 */
49
public class FeatureTypeAttribute {
50
	private String name;
51
	private int minOccurs;
52
	private boolean nillable;
53
	private String type;
54

  
55
	/**
56
	 * @param name 
57
	 * @param minOccurs 
58
	 * @param nillable 
59
	 * @param type 
60
	 */
61
	public FeatureTypeAttribute(String name, int minOccurs, boolean nillable, String type) {        
62
		super();
63
		this.name = name;
64
		this.minOccurs = minOccurs;
65
		this.nillable = nillable;
66
		this.type = type;
67
	} 
68

  
69
	/**
70
	 * @return Returns the minOccurs.
71
	 */
72
	public int getMinOccurs() {        
73
		return minOccurs;
74
	} 
75

  
76
	/**
77
	 * @param minOccurs The minOccurs to set.
78
	 */
79
	public void setMinOccurs(int minOccurs) {        
80
		this.minOccurs = minOccurs;
81
	} 
82

  
83
	/**
84
	 * @return Returns the name.
85
	 */
86
	public String getName() {        
87
		return name;
88
	} 
89

  
90
	/**
91
	 * @param name The name to set.
92
	 */
93
	public void setName(String name) {        
94
		this.name = name;
95
	} 
96

  
97
	/**
98
	 * @return Returns the nillable.
99
	 */
100
	public boolean getNillable() {        
101
		return nillable;
102
	} 
103

  
104
	/**
105
	 * @param nillable The nillable to set.
106
	 */
107
	public void setNillable(boolean nillable) {        
108
		this.nillable = nillable;
109
	} 
110

  
111
	/**
112
	 * @return Returns the type.
113
	 */
114
	public String getType() {        
115
		return type;
116
	} 
117

  
118
	/**
119
	 * @param type The type to set.
120
	 */
121
	public void setType(String type) {        
122
		this.type = type;
123
	} 
124
	
125
	/*
126
	 * (non-Javadoc)
127
	 * @see java.lang.Object#toString()
128
	 */
129
	public String toString(){
130
		return name;
131
	}
132
}
0 133

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/GazetteerAP.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program 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
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
package org.gvsig.gazetteer;
43
import javax.swing.UIManager;
44
import javax.swing.UnsupportedLookAndFeelException;
45

  
46
import org.gvsig.gazetteer.ui.serverconnect.ServerConnectDialog;
47
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
48

  
49

  
50
/**
51
 * This class is the launcher application for the Gazetteer Client
52
 * 
53
 * 
54
 * @author Jorge Piera Llodra (piera_jor@gva.es)
55
 */
56
public class GazetteerAP {
57

  
58
/**
59
 * 
60
 * 
61
 * 
62
 * @param args 
63
 */
64
    public static void main(String[] args) {        
65
    	new DefaultLibrariesInitializer().fullInitialize();
66
    	
67
        //Get the currently installed look and feel
68
        UIManager.getLookAndFeel();
69
        // Install a different look and feel; specifically, the Windows look and feel
70
        try {
71
            UIManager.setLookAndFeel(
72
                "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
73
        } catch (InstantiationException e) {
74
        } catch (ClassNotFoundException e) {
75
        } catch (UnsupportedLookAndFeelException e) {
76
        } catch (IllegalAccessException e) {
77
        }
78
        
79
        new ServerConnectDialog();
80
    } 
81
 }
0 82

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/GazetteerLocator.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program 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
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.gazetteer;
29

  
30
import org.gvsig.tools.locator.AbstractLocator;
31
import org.gvsig.tools.locator.Locator;
32
import org.gvsig.tools.locator.LocatorException;
33

  
34
/**
35
 * This Locator provides the entry point for the gvSIG 
36
 * {@link GazetteerManager}
37
 * @see Locator
38
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
39
 */
40
public class GazetteerLocator extends AbstractLocator {
41
	private static final String LOCATOR_NAME = "GazetteerLocator";
42
	
43
	/**
44
	 * GazetteerManager name used by the locator to access the instance
45
	 */
46
	public static final String GAZETTEER_MANAGER_NAME = "GazetteerManager";
47
	private static final String GAZETTEER_MANAGER_DESCRIPTION = "GazetteerManager of gvSIG";
48

  
49
	/**
50
	 * Unique instance.
51
	 */
52
	private static final GazetteerLocator instance = new GazetteerLocator();
53
	
54
	/* (non-Javadoc)
55
	 * @see org.gvsig.tools.locator.Locator#getLocatorName()
56
	 */
57
	public String getLocatorName() {
58
		return LOCATOR_NAME;
59
	}
60
	
61
	/**
62
	 * Return a reference to {@link GazetteerManager}.
63
	 *
64
	 * @return a reference to GazetteerManager
65
	 * @throws LocatorException
66
	 *             if there is no access to the class or the class cannot be
67
	 *             instantiated
68
	 * @see Locator#get(String)
69
	 */
70
	public static GazetteerManager getGazetteerManager() throws LocatorException {
71
		return (GazetteerManager) getInstance().get(GAZETTEER_MANAGER_NAME);
72
	}
73
	
74
	/**
75
	 * Return the singleton instance.
76
	 *
77
	 * @return the singleton instance
78
	 */
79
	public static GazetteerLocator getInstance() {
80
		return instance;
81
	}
82
	
83
	/**
84
	 * Registers the Class implementing the {@link GazetteerManager} interface.
85
	 *
86
	 * @param clazz
87
	 *            implementing the IGazetteerServiceDriver interface
88
	 */
89
	public static void registerGazetteerManager(Class clazz) {
90
		getInstance().register(GAZETTEER_MANAGER_NAME, 
91
				GAZETTEER_MANAGER_DESCRIPTION,
92
				clazz);
93
	}
94
}
95

  
0 96

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/geonames/GeonamesServiceDriver.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program 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
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

  
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2009 Iver T.I.  {{Task}}
26
 */
27

  
28
package org.gvsig.gazetteer.geonames;
29

  
30
import java.awt.geom.Point2D;
31
import java.net.URI;
32
import java.util.List;
33

  
34
import org.geonames.Toponym;
35
import org.geonames.ToponymSearchCriteria;
36
import org.geonames.ToponymSearchResult;
37
import org.geonames.WebService;
38
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities;
39
import org.gvsig.catalog.exceptions.NotSupportedVersionException;
40
import org.gvsig.gazetteer.drivers.AbstractGazetteerServiceDriver;
41
import org.gvsig.gazetteer.drivers.GazetteerCapabilities;
42
import org.gvsig.gazetteer.querys.Feature;
43
import org.gvsig.gazetteer.querys.GazetteerQuery;
44
import org.gvsig.utils.swing.jcomboServer.ServerData;
45

  
46

  
47

  
48
public class GeonamesServiceDriver extends AbstractGazetteerServiceDriver {
49
	
50
	
51
	public GeonamesServiceDriver() {
52
		super();
53
		setProjection("EPSG:4326");		
54
	}
55

  
56
	/*
57
	 * (non-Javadoc)
58
	 * @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getFeature(java.net.URI, es.gva.cit.gazetteer.querys.GazetteerQuery)
59
	 */
60
	public Feature[] getFeature(URI uri, GazetteerQuery query) throws Exception {
61
		ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
62
		searchCriteria.setQ(query.getName());
63
		ToponymSearchResult searchResult = WebService.search(searchCriteria);
64
		List toponims = searchResult.getToponyms();
65
		Feature[] features = new Feature[toponims.size()];
66
		for (int i=0 ; i<toponims.size() ; i++){
67
			features[i] = converToponym((Toponym)toponims.get(i));
68
		}
69
		return features;
70
	}
71

  
72
	private Feature converToponym(Toponym toponym) {
73
		Feature feature = new Feature(toponym.getFeatureCode(), 
74
				toponym.getName(),
75
				toponym.getName(),
76
				new Point2D.Double(toponym.getLongitude(), toponym.getLatitude()));
77
		
78
		return feature;
79
	}
80

  
81
	/*
82
	 * (non-Javadoc)
83
	 * @see es.gva.cit.catalog.drivers.IDiscoveryServiceDriver#getCapabilities(java.net.URI)
84
	 */
85
	public DiscoveryServiceCapabilities getCapabilities(URI uri)
86
	throws NotSupportedVersionException {
87
		GazetteerCapabilities capabilities = new GazetteerCapabilities();
88
		return capabilities;
89
	}
90

  
91
	/*
92
	 * (non-Javadoc)
93
	 * @see es.gva.cit.catalog.drivers.IDiscoveryServiceDriver#getServiceName()
94
	 */
95
	public String getServiceName() {
96
		return "Geonames";
97
	}
98

  
99
	/*
100
	 * (non-Javadoc)
101
	 * @see es.gva.cit.catalog.drivers.AbstractDiscoveryServiceDriver#getOneServer()
102
	 */
103
	public ServerData getOneServer() {
104
		return new ServerData("www.geonames.org", "GEONAMES");
105
	}
106
	
107
	
108
}
0 109

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/GazetteerLibrary.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program 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
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.gazetteer;
29

  
30
import org.gvsig.tools.library.AbstractLibrary;
31
import org.gvsig.tools.library.LibraryException;
32
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
33

  
34
/**
35
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
36
 */
37
public class GazetteerLibrary extends AbstractLibrary  {
38

  
39
    @Override
40
    public void doRegistration() {
41
        registerAsAPI(GazetteerLibrary.class);
42
    }
43

  
44
	@Override
45
	protected void doInitialize() throws LibraryException {
46
	}
47

  
48
	@Override
49
	protected void doPostInitialize() throws LibraryException {
50
		// Validate there is any implementation registered of CatalogManager.
51
		GazetteerManager gazetteerManager = GazetteerLocator.getGazetteerManager();
52
		if (gazetteerManager == null) {
53
			throw new ReferenceNotRegisteredException(
54
					GazetteerLocator.GAZETTEER_MANAGER_NAME, 
55
					GazetteerLocator.getInstance());
56
		}		
57
	}
58
}
0 59

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/wfs/drivers/WFSGPEErrorHandler.java
1
package org.gvsig.gazetteer.wfs.drivers;
2

  
3
import org.gvsig.gpe.lib.impl.parser.GPEErrorHandler;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
53
 */
54
public class WFSGPEErrorHandler extends GPEErrorHandler{
55

  
56
}
0 57

  
tags/v2_0_0_Build_2047/applications/appGazetteer/appGazetteer/src/org/gvsig/gazetteer/wfs/drivers/WFSGPEContentHandler.java
1
package org.gvsig.gazetteer.wfs.drivers;
2

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

Also available in: Unified diff