Revision 3566 trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/querys/Query.java

View differences:

Query.java
1

  
1 2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2 3
*
3 4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
......
39 40
*   dac@iver.es
40 41
*/
41 42
package es.gva.cit.catalogClient.querys;
42

  
43 43
import es.gva.cit.catalogClient.traductor.ITranslator;
44 44

  
45

  
46 45
/**
47 46
 * This class implements a general query. It contains an attribute
48 47
 * for each parameter that can be showed in the search form.
49 48
 * 
49
 * 
50 50
 * @author Jorge Piera Llodra (piera_jor@gva.es)
51 51
 */
52 52
public class Query {
53

  
54
/**
55
 * 
56
 * 
57
 */
53 58
    private String title;
59

  
60
/**
61
 * 
62
 * 
63
 */
54 64
    private String titleFilter;
65

  
66
/**
67
 * 
68
 * 
69
 */
55 70
    private String abstract_;
71

  
72
/**
73
 * 
74
 * 
75
 */
56 76
    private String themeKey;
77

  
78
/**
79
 * 
80
 * 
81
 */
57 82
    private String topic;
83

  
84
/**
85
 * 
86
 * 
87
 */
58 88
    private String scale;
89

  
90
/**
91
 * 
92
 * 
93
 */
59 94
    private String provider;
95

  
96
/**
97
 * 
98
 * 
99
 */
60 100
    private String DateFrom;
101

  
102
/**
103
 * 
104
 * 
105
 */
61 106
    private String DateTo;
107
/**
108
 * 
109
 * 
110
 */
62 111
    private Coordinates coordinates;
112

  
113
/**
114
 * 
115
 * 
116
 */
63 117
    private String coordinatesFilter;
118

  
119
/**
120
 * 
121
 * 
122
 */
64 123
    private boolean isMinimized;
124

  
125
/**
126
 * 
127
 * 
128
 */
65 129
    private boolean isCoordinatesClicked;
130
/**
131
 * 
132
 * 
133
 */
66 134
    private ITranslator translator;
67 135

  
136
/**
137
 * 
138
 * 
139
 */
140
    public  Query() {        
141
        super();
142
    } 
68 143

  
69
    /**
70
         * @param title
71
         * @param titleFilter
72
         * @param abstract_
73
         * @param themeKey
74
         * @param topic
75
         * @param scale
76
         * @param provider
77
         * @param dateFrom
78
         * @param dateTo
79
         * @param coordinates
80
         * @param coordinatesFilter
81
         */
82
    public Query(String title, String titleFilter, String abstract_,
83
        String themeKey, String topic, String scale, String provider,
84
        String dateFrom, String dateTo, Coordinates coordinates,
85
        String coordinatesFilter,ITranslator translator) {
144
/**
145
 * 
146
 * 
147
 * 
148
 * @param title 
149
 * @param titleFilter 
150
 * @param abstract_ 
151
 * @param themeKey 
152
 * @param topic 
153
 * @param scale 
154
 * @param provider 
155
 * @param dateFrom 
156
 * @param dateTo 
157
 * @param coordinates 
158
 * @param coordinatesFilter 
159
 * @param translator 
160
 */
161
    public  Query(String title, String titleFilter, String abstract_, String themeKey, String topic, String scale, String provider, String dateFrom, String dateTo, Coordinates coordinates, String coordinatesFilter, ITranslator translator) {        
86 162
        super();
87 163
        this.title = title;
88 164
        this.titleFilter = titleFilter;
......
91 167
        this.topic = topic;
92 168
        this.scale = scale;
93 169
        this.provider = provider;
94

  
95 170
        //Date
96 171
        this.DateFrom = dateFrom;
97 172
        this.DateTo = dateTo;
98

  
99 173
        //Coordinates
100 174
        this.coordinates = coordinates;
101

  
102 175
        if (this.coordinates != null) {
103 176
            if (this.coordinates.getUlx().equals("") ||
104 177
                    this.coordinates.getUlx().equals("") ||
......
118 191
                }
119 192
            }
120 193
        }
121

  
122 194
        this.coordinatesFilter = coordinatesFilter;
123 195
        
124 196
        setMinimized(false);
125 197
        this.translator = translator;
126
    }
198
    } 
127 199

  
128
    /**
129
     * Return logic operators
130
     * @param titleKeys
131
     * E,A o Y --> Exact, All, anY
132
     * @return String
133
     *
134
     */
135
    public String getOperator(String concordancia) {
200
/**
201
 * Return logic operators
202
 * 
203
 * @param titleKeys E,A o Y --> Exact, All, anY
204
 * 
205
 * @return String
206
 * @param concordancia 
207
 */
208
    public String getOperator(String concordancia) {        
136 209
        if (concordancia.equals("Y")) {
137 210
            return "Or";
138 211
        } else {
139 212
            return "And";
140 213
        }
141
    }
214
    } 
142 215

  
143
    /**
144
     * @return Returns the abstract_.
145
     */
146
    public String getAbstract() {
216
/**
217
 * 
218
 * 
219
 * 
220
 * @return Returns the abstract_.
221
 */
222
    public String getAbstract() {        
147 223
        return abstract_;
148
    }
224
    } 
149 225

  
150
    /**
151
     * @param abstract_ The abstract_ to set.
152
     */
153
    public void setAbstract(String abstract_) {
226
/**
227
 * 
228
 * 
229
 * 
230
 * @param abstract_ The abstract_ to set.
231
 */
232
    public void setAbstract(String abstract_) {        
154 233
        this.abstract_ = abstract_;
155
    }
234
    } 
156 235

  
157
    /**
158
     * @return Returns the coordinates.
159
     */
160
    public Coordinates getCoordenates() {
236
/**
237
 * 
238
 * 
239
 * 
240
 * @return Returns the coordinates.
241
 */
242
    public Coordinates getCoordenates() {        
161 243
        return coordinates;
162
    }
244
    } 
163 245

  
164
    /**
165
     * @param coordenates The coordinates to set.
166
     */
167
    public void setCoordenates(Coordinates coordenates) {
246
/**
247
 * 
248
 * 
249
 * 
250
 * @param coordenates The coordinates to set.
251
 */
252
    public void setCoordenates(Coordinates coordenates) {        
168 253
        this.coordinates = coordenates;
169
    }
254
    } 
170 255

  
171
    /**
172
     * @return Returns the coordinatesFilter.
173
     */
174
    public String getCoordenatesFilter() {
256
/**
257
 * 
258
 * 
259
 * 
260
 * @return Returns the coordinatesFilter.
261
 */
262
    public String getCoordenatesFilter() {        
175 263
        return coordinatesFilter;
176
    }
264
    } 
177 265

  
178
    /**
179
     * @param coordenatesFilter The coordenatesFilter to set.
180
     */
181
    public void setCoordenatesFilter(String coordenatesFilter) {
266
/**
267
 * 
268
 * 
269
 * 
270
 * @param coordenatesFilter The coordenatesFilter to set.
271
 */
272
    public void setCoordenatesFilter(String coordenatesFilter) {        
182 273
        this.coordinatesFilter = coordenatesFilter;
183
    }
274
    } 
184 275

  
185
    /**
186
     * @return Returns the dateFrom.
187
     */
188
    public String getDateFrom() {
276
/**
277
 * 
278
 * 
279
 * 
280
 * @return Returns the dateFrom.
281
 */
282
    public String getDateFrom() {        
189 283
        return DateFrom;
190
    }
284
    } 
191 285

  
192
    /**
193
     * @param dateFrom The dateFrom to set.
194
     */
195
    public void setDateFrom(String dateFrom) {
286
/**
287
 * 
288
 * 
289
 * 
290
 * @param dateFrom The dateFrom to set.
291
 */
292
    public void setDateFrom(String dateFrom) {        
196 293
        DateFrom = dateFrom;
197
    }
294
    } 
198 295

  
199
    /**
200
     * @return Returns the dateTo.
201
     */
202
    public String getDateTo() {
296
/**
297
 * 
298
 * 
299
 * 
300
 * @return Returns the dateTo.
301
 */
302
    public String getDateTo() {        
203 303
        return DateTo;
204
    }
304
    } 
205 305

  
206
    /**
207
     * @param dateTo The dateTo to set.
208
     */
209
    public void setDateTo(String dateTo) {
306
/**
307
 * 
308
 * 
309
 * 
310
 * @param dateTo The dateTo to set.
311
 */
312
    public void setDateTo(String dateTo) {        
210 313
        DateTo = dateTo;
211
    }
314
    } 
212 315

  
213
    /**
214
     * @return Returns the provider.
215
     */
216
    public String getProvider() {
316
/**
317
 * 
318
 * 
319
 * 
320
 * @return Returns the provider.
321
 */
322
    public String getProvider() {        
217 323
        return provider;
218
    }
324
    } 
219 325

  
220
    /**
221
     * @param provider The provider to set.
222
     */
223
    public void setProvider(String provider) {
326
/**
327
 * 
328
 * 
329
 * 
330
 * @param provider The provider to set.
331
 */
332
    public void setProvider(String provider) {        
224 333
        this.provider = provider;
225
    }
334
    } 
226 335

  
227
    /**
228
     * @return Returns the scale.
229
     */
230
    public String getScale() {
336
/**
337
 * 
338
 * 
339
 * 
340
 * @return Returns the scale.
341
 */
342
    public String getScale() {        
231 343
        return scale;
232
    }
344
    } 
233 345

  
234
    /**
235
     * @param scale The scale to set.
236
     */
237
    public void setScale(String scale) {
346
/**
347
 * 
348
 * 
349
 * 
350
 * @param scale The scale to set.
351
 */
352
    public void setScale(String scale) {        
238 353
        this.scale = scale;
239
    }
354
    } 
240 355

  
241
    /**
242
     * @return Returns the themeKey.
243
     */
244
    public String getThemeKey() {
356
/**
357
 * 
358
 * 
359
 * 
360
 * @return Returns the themeKey.
361
 */
362
    public String getThemeKey() {        
245 363
        return themeKey;
246
    }
364
    } 
247 365

  
248
    /**
249
     * @param themeKey The themeKey to set.
250
     */
251
    public void setThemeKey(String themeKey) {
366
/**
367
 * 
368
 * 
369
 * 
370
 * @param themeKey The themeKey to set.
371
 */
372
    public void setThemeKey(String themeKey) {        
252 373
        this.themeKey = themeKey;
253
    }
374
    } 
254 375

  
255
    /**
256
     * @return Returns the title.
257
     */
258
    public String getTitle() {
376
/**
377
 * 
378
 * 
379
 * 
380
 * @return Returns the title.
381
 */
382
    public String getTitle() {        
259 383
        return title;
260
    }
384
    } 
261 385

  
262
    /**
263
     * @param title The title to set.
264
     */
265
    public void setTitle(String title) {
386
/**
387
 * 
388
 * 
389
 * 
390
 * @param title The title to set.
391
 */
392
    public void setTitle(String title) {        
266 393
        this.title = title;
267
    }
394
    } 
268 395

  
269
    /**
270
     * @return Returns the titleFilter.
271
     */
272
    public String getTitleFilter() {
396
/**
397
 * 
398
 * 
399
 * 
400
 * @return Returns the titleFilter.
401
 */
402
    public String getTitleFilter() {        
273 403
        return titleFilter;
274
    }
404
    } 
275 405

  
276
    /**
277
     * @param titleFilter The titleFilter to set.
278
     */
279
    public void setTitleFilter(String titleFilter) {
406
/**
407
 * 
408
 * 
409
 * 
410
 * @param titleFilter The titleFilter to set.
411
 */
412
    public void setTitleFilter(String titleFilter) {        
280 413
        this.titleFilter = titleFilter;
281
    }
414
    } 
282 415

  
283
    /**
284
     * @return Returns the topic.
285
     */
286
    public String getTopic() {
416
/**
417
 * 
418
 * 
419
 * 
420
 * @return Returns the topic.
421
 */
422
    public String getTopic() {        
287 423
        return topic;
288
    }
424
    } 
289 425

  
290
    /**
291
     * @param topic The topic to set.
292
     */
293
    public void setTopic(String topic) {
426
/**
427
 * 
428
 * 
429
 * 
430
 * @param topic The topic to set.
431
 */
432
    public void setTopic(String topic) {        
294 433
        this.topic = topic;
295
    }
296
    
297
    /**
298
     * @return Returns the isMinimized.
299
     */
300
    public boolean isMinimized() {
434
    } 
435

  
436
/**
437
 * 
438
 * 
439
 * 
440
 * @return Returns the isMinimized.
441
 */
442
    public boolean isMinimized() {        
301 443
        return isMinimized;
302
    }
303
    /**
304
     * @param isMinimized The isMinimized to set.
305
     */
306
    public void setMinimized(boolean isMinimized) {
444
    } 
445

  
446
/**
447
 * 
448
 * 
449
 * 
450
 * @param isMinimized The isMinimized to set.
451
 */
452
    public void setMinimized(boolean isMinimized) {        
307 453
        this.isMinimized = isMinimized;
308 454
        if (isMinimized){
309 455
            this.setAbstract(getTitle());
310 456
        }
311
    }
312
    /**
313
     * @return Returns the isCoordinatesClicked.
314
     */
315
    public boolean isCoordinatesClicked() {
457
    } 
458

  
459
/**
460
 * 
461
 * 
462
 * 
463
 * @return Returns the isCoordinatesClicked.
464
 */
465
    public boolean isCoordinatesClicked() {        
316 466
        return isCoordinatesClicked;
317
    }
318
    /**
319
     * @param isCoordinatesClicked The isCoordinatesClicked to set.
320
     */
321
    public void setCoordinatesClicked(boolean isCoordinatesClicked) {
467
    } 
468

  
469
/**
470
 * 
471
 * 
472
 * 
473
 * @param isCoordinatesClicked The isCoordinatesClicked to set.
474
 */
475
    public void setCoordinatesClicked(boolean isCoordinatesClicked) {        
322 476
        this.isCoordinatesClicked = isCoordinatesClicked;
323
    }
324
    /**
325
     * @return Returns the translator.
326
     */
327
    public ITranslator getTranslator() {
477
    } 
478

  
479
/**
480
 * 
481
 * 
482
 * 
483
 * @return Returns the translator.
484
 */
485
    public ITranslator getTranslator() {        
328 486
        return translator;
329
    }
330
    /**
331
     * @param translator The translator to set.
332
     */
333
    public void setTranslator(ITranslator translator) {
487
    } 
488

  
489
/**
490
 * 
491
 * 
492
 * 
493
 * @param translator The translator to set.
494
 */
495
    public void setTranslator(ITranslator translator) {        
334 496
        this.translator = translator;
335
    }
336
    
337
    /**
338
     * It returns the lower scale
339
     * @return
340
     * String or Null if ther is not a low value (0)
341
     */
342
    public String getMinScale(){
497
    } 
498

  
499
/**
500
 * It returns the lower scale
501
 * 
502
 * 
503
 * @return String or Null if ther is not a low value (0)
504
 */
505
    public String getMinScale() {        
343 506
        if (scale.equals(">1.000.000")){
344 507
                return "1000000";
345 508
        }
......
361 524
        }
362 525
               
363 526
        return null;        
364
    }
365
    
366
    /**
367
     * It returns the upper scale
368
     * @return
369
     * String or Null if ther is not a value (infinity)
370
     */
371
    public String getMaxScale(){
527
    } 
528

  
529
/**
530
 * It returns the upper scale
531
 * 
532
 * 
533
 * @return String or Null if ther is not a value (infinity)
534
 */
535
    public String getMaxScale() {        
372 536
        if (scale.equals("1.000.000 - 250.000")){
373 537
            return "1000000";
374 538
        }
......
390 554
        }       
391 555
           
392 556
        return null;        
393
    }
394
}
557
    } 
558
 }

Also available in: Unified diff