Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extGeocoding / src / org / gvsig / geocoding / gui / GeocodingModel.java @ 27140

History | View | Annotate | Download (4.42 KB)

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
 * 2008 Prodevelop S.L. main developer
26
 */
27

    
28
package org.gvsig.geocoding.gui;
29

    
30
import java.io.File;
31
import java.util.ArrayList;
32
import java.util.List;
33

    
34
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
35
import org.gvsig.geocoding.extension.GeocoController;
36
import org.gvsig.geocoding.patterns.Patterngeocoding;
37
import org.gvsig.geocoding.results.GeocoLocationSet;
38
import org.slf4j.Logger;
39

    
40
import com.iver.andami.PluginServices;
41

    
42
/**
43
 * Model of the panels
44
 * 
45
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
46
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
47
 */
48

    
49
public class GeocodingModel implements IGeocodingModel {
50

    
51
        @SuppressWarnings("unused")
52
        private static final Logger log = PluginServices.getLogger();
53

    
54
        private GeocoController control = null;
55

    
56
        private Patterngeocoding pattern = null;
57

    
58
        private File patternFile = null;
59

    
60
        private String address1 = "";
61

    
62
        private String address2 = "";
63

    
64
        private String address3 = "";
65

    
66
        private FLyrVect lyr = null;
67

    
68
        private List<GeocoLocationSet> results;
69

    
70
        private boolean simple = true;
71

    
72
        /**
73
         * Constructor
74
         * 
75
         * @param _control
76
         */
77
        public GeocodingModel(GeocoController _control) {
78

    
79
                this.control = _control;
80
                pattern = control.loadInitialPattern();
81
                this.setPatternFile(new File("/home/vicent/default.xml"));
82
                results = new ArrayList<GeocoLocationSet>();
83
        }
84

    
85
        /**
86
         * This method gets the Geocoding Pattern
87
         * 
88
         * @return
89
         */
90
        public Patterngeocoding getPattern() {
91
                return pattern;
92
        }
93

    
94
        /**
95
         * This method sets the Geocoding Pattern
96
         * 
97
         * @param pat
98
         */
99
        public void setPattern(Patterngeocoding pat) {
100
                pattern = pat;
101
        }
102

    
103
        /**
104
         * This method gets the first address
105
         * 
106
         * @return
107
         */
108
        public String getAddress1() {
109
                return address1;
110
        }
111

    
112
        /**
113
         * This method gets the second address
114
         * 
115
         * @return
116
         */
117
        public String getAddress2() {
118
                return address2;
119
        }
120

    
121
        /**
122
         * This method gets the third address
123
         * 
124
         * @return
125
         */
126
        public String getAddress3() {
127
                return address3;
128
        }
129

    
130
        /**
131
         * This method sets the first address
132
         * 
133
         * @param a1
134
         */
135
        public void setAddress1(String a1) {
136
                address1 = a1;
137
        }
138

    
139
        /**
140
         * This method sets the second address
141
         * 
142
         * @param a2
143
         */
144
        public void setAddress2(String a2) {
145
                address2 = a2;
146
        }
147

    
148
        /**
149
         * This method sets the third address
150
         * 
151
         * @param a3
152
         */
153
        public void setAddress3(String a3) {
154
                address3 = a3;
155
        }
156

    
157
        /**
158
         * This method gets the layer source
159
         * 
160
         * @return
161
         */
162
        public FLyrVect getLyr() {
163
                return lyr;
164
        }
165

    
166
        /**
167
         * This method sets the layer source
168
         * 
169
         * @param lyr
170
         */
171
        public void setLyr(FLyrVect lyr) {
172
                this.lyr = lyr;
173
        }
174

    
175
        /**
176
         * Get the pattern file
177
         * 
178
         * @return
179
         */
180
        public File getPatternFile() {
181
                return patternFile;
182
        }
183

    
184
        /**
185
         * Save the pattern file
186
         * 
187
         * @param file
188
         */
189
        public void setPatternFile(File file) {
190
                this.patternFile = file;
191
        }
192

    
193
        /**
194
         * @return the results
195
         */
196
        public List<GeocoLocationSet> getResults() {
197
                return results;
198
        }
199

    
200
        /**
201
         * @param results
202
         *            the results to set
203
         */
204
        public void setResults(List<GeocoLocationSet> results) {
205
                this.results = results;
206
        }
207

    
208
        /**
209
         * @return the simple
210
         */
211
        public boolean isSimple() {
212
                return simple;
213
        }
214

    
215
        /**
216
         * @param simple
217
         *            the simple to set
218
         */
219
        public void setSimple(boolean simple) {
220
                this.simple = simple;
221
        }
222

    
223
}