Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extWCS / src / com / iver / cit / gvsig / gui / wcs / WCSWizardData.java @ 3401

History | View | Annotate | Download (5.71 KB)

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

    
43
import java.util.ArrayList;
44
import java.util.Iterator;
45

    
46
import com.iver.cit.gvsig.gui.wizards.WizardData;
47

    
48

    
49

    
50
/**
51
 * This class holds the WCSWizard's info
52
 * 
53
 * Contiene la informaci?n del asistente WCS
54
 * 
55
 * @author jaume - jaume.dominguez@iver.es
56
 *
57
 */
58

    
59
public class WCSWizardData extends WizardData{
60
    private String title;
61
    private String Abstract;
62
    private ArrayList coverages;
63
    private String[] coverageNames;
64

    
65
    /**
66
     * The server description.
67
     * 
68
     * La descripci?n del servidor
69
     * @return String
70
     */
71
    public String getAbstract() {
72
            if (Abstract == null) return "None";
73
        return Abstract;
74
    }
75
    
76
    /**
77
     * An ArrayList with the coverage formats.
78
     * 
79
     * Los formatos de la cobertura
80
     *
81
     * @return
82
     */ 
83
    public ArrayList getCoverageFormatos(String nomCobertura) {
84
        return getCoverageInfo(nomCobertura).getFormats();
85
    }
86

    
87
    /**
88
     * Finds the coverage within the coverage list
89
     * 
90
     * Busca la cobertura en la lista de coberturas
91
     *
92
     * @return CoverageInfo
93
     */
94
    public CoverageInfo getCoverageInfo(String name) {
95
            Iterator i=coverages.iterator();
96
            while (i.hasNext()){
97
                    CoverageInfo ci = (CoverageInfo) i.next();
98
                    if (ci.name.equals(name)) return ci;  
99
            }
100
        return null;
101
    }
102
    
103
    /**
104
     * Returns an ArrayList containing the supported SRS of the coverage specified 
105
     * by name.
106
     * 
107
     * Devuelve una lista de SRSs soportados por la cobertura "name".
108
     * 
109
     * @param name
110
     * @return ArrayList
111
     */
112
    public ArrayList getCoverageSRSs(String name){
113
            CoverageInfo ci = getCoverageInfo(name);
114
            return ci.getSRSs();
115
    }
116
    /**
117
     * Server's title (not used in gvSIG)
118
     * 
119
     * T?tulo del servidor (no se usa en gvSIG)
120
     *
121
     * @return
122
     */
123
    public String getTitle() {
124
            if (title == null) return "None";
125
        return title;
126
    }
127

    
128
    /**
129
     * Equivalent to the setDescription method
130
     * 
131
     * Equivalente a setDescription
132
     *
133
     * @param string
134
     */
135
    public void setAbstract(String string) {
136
        Abstract = string;
137
    }
138

    
139

    
140
    /**
141
     * Adds a coverage to the coverages list
142
     * 
143
     * A?ande una cobertura a la lista de coberturas
144
     *
145
     * @param CoverageInfo
146
     */
147
    public void setCoverage(CoverageInfo info) {
148
        coverages.add(info);
149
    }
150

    
151
    /**
152
     * Sets the server's title (not used in gvSIG)
153
     * 
154
     * Establece el t?tulo del servidor (no se usa en gvSIG)
155
     *
156
     * @param string
157
     */
158
    public void setTitle(String string) {
159
        title = string;
160
    }
161
    
162
    /**
163
     * Sets the server's description.
164
     * 
165
     * Establece la descripci?n del servidor.
166
     * @param String
167
     */
168
    public void setDescription(String s) {
169
            setAbstract(s);
170
    }
171
    
172
    /**
173
     * Returns the server's descrition
174
     * 
175
     * Recupera la descripci?n del servidor
176
     * @return "None" if the server doesn't specify any description
177
     */
178
    public String getDescription(){
179
            if (getAbstract() == null) return "None";
180
            return getAbstract();
181
    }
182

    
183
        /**
184
         * Sets the coverage names
185
         * 
186
         * @param String[] coverageNames
187
         */
188
        public void setCoverageNames(String[] coverageNames) {
189
                this.coverageNames = coverageNames;
190
        }
191
        
192
        /** 
193
         * Returns an String[] containing the coverage names.
194
         * @return String
195
         */
196
        public String[] getCoverageNames() {
197
                return this.coverageNames;
198
        }
199
        
200
        /** 
201
         * Sets the coverages list from an ArrayList
202
         * 
203
         * @param coverages
204
         */
205
        public void setCoveragesList(ArrayList coverages){
206
                this.coverages = coverages;
207
        }
208

    
209
        /**
210
         * Returns an ArrayList containing the positions for the TIME
211
         * 
212
         * Devuelve las posiciones del tiempo
213
         * @param string
214
         * @return
215
         */
216
        public ArrayList getCoverageTimes(String name) {
217
                   CoverageInfo ci = getCoverageInfo(name);
218
                   if (ci.getTimes()== null) return new ArrayList();
219
            return ci.getTimes();
220
         }
221
        
222
        /**
223
         * Returns an ArrayList containing a list of Parametro with the parameters list
224
         * and its possible values of a coverage specified by its name.
225
         * 
226
         * Devuelve la lista de par?metros (y sus posibles valores) de la cobertura y sus
227
         * posibles valores de una cobertura especificada por su nombre
228
         * 
229
         * @return ArrayList
230
         */
231
                
232
        public ArrayList getCoverageParameters(String name){
233
                CoverageInfo ci = getCoverageInfo(name);
234
                return ci.getParametros();
235
        }
236

    
237
        /**
238
         * Gets the coverage label.
239
         */
240
        public String getCoverageLabel(String name) {
241
                CoverageInfo ci = getCoverageInfo(name);
242
                return ci.getLabel();
243
        }        
244
}